Skip to content

Commit 393a6a3

Browse files
committed
Compile and test fixes.
1 parent d110f82 commit 393a6a3

File tree

15 files changed

+96
-83
lines changed

15 files changed

+96
-83
lines changed

e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CoreV1ApiTest extends Specification {
2828
Configuration.setDefaultApiClient(apiClient)
2929
def namespaceFoo = new V1Namespace().metadata(new V1ObjectMeta().name("e2e-basic"))
3030
when:
31-
V1Namespace created = corev1api.createNamespace(namespaceFoo, null, null, null)
31+
V1Namespace created = corev1api.createNamespace(namespaceFoo, null, null, null, null)
3232
then:
3333
created != null
3434
when:

extended/src/main/java/io/kubernetes/client/extended/event/legacy/LegacyEventBroadcaster.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public LegacyEventBroadcaster(CoreV1Api coreV1Api) {
4444
@Override
4545
public CoreV1Event create(CoreV1Event event) throws ApiException {
4646
return coreV1Api.createNamespacedEvent(
47-
event.getMetadata().getNamespace(), event, null, null, null);
47+
event.getMetadata().getNamespace(), event, null, null, null, null);
4848
}
4949

5050
@Override
@@ -55,6 +55,7 @@ public CoreV1Event update(CoreV1Event event) throws ApiException {
5555
event,
5656
null,
5757
null,
58+
null,
5859
null);
5960
}
6061

@@ -71,6 +72,7 @@ public CoreV1Event patch(CoreV1Event event, V1Patch patch) throws ApiException {
7172
null,
7273
null,
7374
null,
75+
null,
7476
null),
7577
V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH,
7678
coreV1Api.getApiClient());

extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlScale.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public ApiType execute() throws KubectlException {
5656
new V1Patch(jsonPatchStr),
5757
null,
5858
null,
59+
null,
5960
null, // field-manager is optional
6061
null,
6162
null),
@@ -66,15 +67,15 @@ public ApiType execute() throws KubectlException {
6667
apiTypeClass,
6768
() ->
6869
api.patchNamespacedReplicaSetCall(
69-
name, namespace, new V1Patch(jsonPatchStr), null, null, null, null, null),
70+
name, namespace, new V1Patch(jsonPatchStr), null, null, null, null, null, null),
7071
V1Patch.PATCH_FORMAT_JSON_PATCH,
7172
this.apiClient);
7273
} else if (apiTypeClass.equals(V1StatefulSet.class)) {
7374
return PatchUtils.patch(
7475
apiTypeClass,
7576
() ->
7677
api.patchNamespacedStatefulSetCall(
77-
name, namespace, new V1Patch(jsonPatchStr), null, null, null, null, null),
78+
name, namespace, new V1Patch(jsonPatchStr), null, null, null, null, null, null),
7879
V1Patch.PATCH_FORMAT_JSON_PATCH,
7980
this.apiClient);
8081
} else {

extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlTaint.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
*/
1313
package io.kubernetes.client.extended.kubectl;
1414

15+
import static io.kubernetes.client.openapi.models.V1Taint.EffectEnum.NOEXECUTE;
16+
import static io.kubernetes.client.openapi.models.V1Taint.EffectEnum.NOSCHEDULE;
17+
import static io.kubernetes.client.openapi.models.V1Taint.EffectEnum.PREFERNOSCHEDULE;
18+
1519
import io.kubernetes.client.extended.kubectl.exception.KubectlException;
1620
import io.kubernetes.client.openapi.ApiException;
1721
import io.kubernetes.client.openapi.apis.CoreV1Api;
1822
import io.kubernetes.client.openapi.models.V1Node;
23+
import io.kubernetes.client.openapi.models.V1Taint;
1924
import io.kubernetes.client.util.taints.Taints;
20-
import io.kubernetes.client.util.taints.Taints.Effect;
2125
import io.kubernetes.client.util.taints.Taints.TaintsBuilder;
2226
import java.io.IOException;
2327
import java.util.HashMap;
@@ -82,18 +86,18 @@ private V1Node executeInternal() throws KubectlException, ApiException, IOExcept
8286
builder.removeTaint(taint.getKey(), makeEffect(taint.getValue()));
8387
}
8488
}
85-
return v1.replaceNode(name, node, null, null, null);
89+
return v1.replaceNode(name, node, null, null, null, null);
8690
}
8791

88-
private Effect makeEffect(String effect) throws KubectlException {
89-
if (effect.equals(Effect.NO_SCHEDULE.toString())) {
90-
return Effect.NO_SCHEDULE;
92+
private V1Taint.EffectEnum makeEffect(String effect) throws KubectlException {
93+
if (effect.equals(NOSCHEDULE.toString())) {
94+
return NOSCHEDULE;
9195
}
92-
if (effect.equals(Effect.PREFER_NO_SCHEDULE.toString())) {
93-
return Effect.PREFER_NO_SCHEDULE;
96+
if (effect.equals(PREFERNOSCHEDULE.toString())) {
97+
return PREFERNOSCHEDULE;
9498
}
95-
if (effect.equals(Effect.NO_EXECUTE.toString())) {
96-
return Effect.NO_EXECUTE;
99+
if (effect.equals(NOEXECUTE.toString())) {
100+
return NOEXECUTE;
97101
}
98102
throw new KubectlException("Unknown effect: " + effect);
99103
}

extended/src/main/java/io/kubernetes/client/extended/leaderelection/resourcelock/ConfigMapLock.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public boolean create(LeaderElectionRecord record) {
9797
}
9898
configMap.setMetadata(objectMeta);
9999
V1ConfigMap createdConfigMap =
100-
coreV1Client.createNamespacedConfigMap(namespace, configMap, null, null, null);
100+
coreV1Client.createNamespacedConfigMap(namespace, configMap, null, null, null, null);
101101
configMapRefer.set(createdConfigMap);
102102
return true;
103103
} catch (ApiException e) {
@@ -121,7 +121,8 @@ public boolean update(LeaderElectionRecord record) {
121121
coreV1Client.getApiClient().getJSON().serialize(record));
122122
// TODO consider to retry if receiving a 409 code
123123
V1ConfigMap replacedConfigMap =
124-
coreV1Client.replaceNamespacedConfigMap(name, namespace, configMap, null, null, null);
124+
coreV1Client.replaceNamespacedConfigMap(
125+
name, namespace, configMap, null, null, null, null);
125126
configMapRefer.set(replacedConfigMap);
126127
return true;
127128
} catch (ApiException e) {

extended/src/main/java/io/kubernetes/client/extended/leaderelection/resourcelock/EndpointsLock.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public boolean create(LeaderElectionRecord record) {
9696
}
9797
endpoints.setMetadata(objectMeta);
9898
V1Endpoints createdendpoints =
99-
coreV1Client.createNamespacedEndpoints(namespace, endpoints, null, null, null);
99+
coreV1Client.createNamespacedEndpoints(namespace, endpoints, null, null, null, null);
100100
endpointsRefer.set(createdendpoints);
101101
return true;
102102
} catch (ApiException e) {
@@ -120,7 +120,8 @@ public boolean update(LeaderElectionRecord record) {
120120
coreV1Client.getApiClient().getJSON().serialize(record));
121121
// TODO consider to retry if receiving a 409 code
122122
V1Endpoints replacedEndpoints =
123-
coreV1Client.replaceNamespacedEndpoints(name, namespace, endpoints, null, null, null);
123+
coreV1Client.replaceNamespacedEndpoints(
124+
name, namespace, endpoints, null, null, null, null);
124125
endpointsRefer.set(replacedEndpoints);
125126
return true;
126127
} catch (ApiException e) {

extended/src/main/java/io/kubernetes/client/extended/leaderelection/resourcelock/LeaseLock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public boolean create(LeaderElectionRecord record) {
7878
new V1Lease().metadata(objectMeta).spec(getLeaseFromRecord(record)),
7979
null,
8080
null,
81+
null,
8182
null);
8283
leaseRefer.set(createdLease);
8384
return true;
@@ -97,7 +98,7 @@ public boolean update(LeaderElectionRecord record) {
9798
V1Lease latest = leaseRefer.get();
9899
latest.setSpec(getLeaseFromRecord(record));
99100
V1Lease updatedLease =
100-
coordinationV1Api.replaceNamespacedLease(name, namespace, latest, null, null, null);
101+
coordinationV1Api.replaceNamespacedLease(name, namespace, latest, null, null, null, null);
101102
leaseRefer.set(updatedLease);
102103
return true;
103104
} catch (ApiException e) {

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
<module>fluent</module>
1717
<module>spring</module>
1818
<module>e2e</module>
19+
<!--
1920
<module>examples</module>
21+
-->
2022
<module>client-java-contrib/cert-manager</module>
2123
<module>client-java-contrib/prometheus-operator</module>
2224
<module>client-java-contrib/admissionreview</module>

util/src/main/java/io/kubernetes/client/util/CSRUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ public static void approve(ApiClient apiClient, String csrObjName) throws ApiExc
6868
.getStatus()
6969
.addConditionsItem(
7070
new V1CertificateSigningRequestCondition()
71-
.type("Approved")
71+
.type(V1CertificateSigningRequestCondition.TypeEnum.APPROVED)
7272
.status("True")
7373
.reason("Kubernetes Java Client")
7474
.lastTransitionTime(now)
7575
.lastUpdateTime(now));
76-
api.replaceCertificateSigningRequestApproval(csrObjName, current, null, null, null);
76+
api.replaceCertificateSigningRequestApproval(csrObjName, current, null, null, null, null);
7777
}
7878

7979
/**
@@ -119,7 +119,7 @@ public static boolean createIfAbsent(ApiClient apiClient, V1CertificateSigningRe
119119
throws ApiException {
120120
CertificatesV1Api api = new CertificatesV1Api(apiClient);
121121
try {
122-
api.createCertificateSigningRequest(csr, null, null, null);
122+
api.createCertificateSigningRequest(csr, null, null, null, null);
123123
return true;
124124
} catch (ApiException e) {
125125
if (e.getCode() == 409) { // HTTP-Conflict

util/src/main/java/io/kubernetes/client/util/ModelMapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ private static void initApiVersionList() {
352352
preBuiltApiVersions.add("V1beta1");
353353
preBuiltApiVersions.add("V1alpha1");
354354
preBuiltApiVersions.add("V1");
355+
preBuiltApiVersions.add("V2");
355356
}
356357

357358
private static void initModelMap() throws IOException {

0 commit comments

Comments
 (0)