Skip to content

Commit 7779bc0

Browse files
authored
Merge pull request kubernetes-client#937 from yue9944882/regen-custom-spec
Regen: Custom object supports server-side apply
2 parents b956777 + baa4833 commit 7779bc0

734 files changed

Lines changed: 2942 additions & 1569 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extended/src/main/java/io/kubernetes/client/extended/generic/GenericKubernetesApi.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,19 @@ public KubernetesApiResponse<ApiType> create(ApiType object, final CreateOptions
398398
this.resourcePlural,
399399
object,
400400
null,
401+
createOptions.getDryRun(),
402+
createOptions.getFieldManager(),
401403
null);
402404
} else {
403405
return customObjectsApi.createClusterCustomObjectCall(
404-
this.apiGroup, this.apiVersion, this.resourcePlural, object, null, null);
406+
this.apiGroup,
407+
this.apiVersion,
408+
this.resourcePlural,
409+
object,
410+
null,
411+
createOptions.getDryRun(),
412+
createOptions.getFieldManager(),
413+
null);
405414
}
406415
});
407416
}
@@ -434,6 +443,8 @@ public KubernetesApiResponse<ApiType> update(ApiType object, final UpdateOptions
434443
this.resourcePlural,
435444
objectMeta.getName(),
436445
object,
446+
updateOptions.getDryRun(),
447+
updateOptions.getFieldManager(),
437448
null);
438449
} else {
439450
return customObjectsApi.replaceClusterCustomObjectCall(
@@ -442,6 +453,8 @@ public KubernetesApiResponse<ApiType> update(ApiType object, final UpdateOptions
442453
this.resourcePlural,
443454
objectMeta.getName(),
444455
object,
456+
updateOptions.getDryRun(),
457+
updateOptions.getFieldManager(),
445458
null);
446459
}
447460
});
@@ -466,7 +479,15 @@ public KubernetesApiResponse<ApiType> patch(
466479
apiTypeClass,
467480
() -> {
468481
return customObjectsApi.patchClusterCustomObjectCall(
469-
this.apiGroup, this.apiVersion, this.resourcePlural, name, patch, null);
482+
this.apiGroup,
483+
this.apiVersion,
484+
this.resourcePlural,
485+
name,
486+
patch,
487+
patchOptions.getDryRun(),
488+
patchOptions.getFieldManager(),
489+
patchOptions.getForce(),
490+
null);
470491
});
471492
}
472493

@@ -505,6 +526,9 @@ public KubernetesApiResponse<ApiType> patch(
505526
this.resourcePlural,
506527
name,
507528
patch,
529+
patchOptions.getDryRun(),
530+
patchOptions.getFieldManager(),
531+
patchOptions.getForce(),
508532
null);
509533
return tweakCallForCoreV1Group(call);
510534
},
@@ -544,6 +568,7 @@ public KubernetesApiResponse<ApiType> delete(String name, final DeleteOptions de
544568
null,
545569
null,
546570
null,
571+
null,
547572
deleteOptions, // TODO: fill/convert the option
548573
null);
549574
});
@@ -578,6 +603,7 @@ public KubernetesApiResponse<ApiType> delete(
578603
null,
579604
null,
580605
null,
606+
null,
581607
deleteOptions, // TODO: fill/convert the option
582608
null);
583609
});
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
package io.kubernetes.client.extended.generic.options;
22

33
public class CreateOptions {
4-
private Boolean dryRun;
5-
// TODO: structured field-manager for better server-side apply integeration
6-
private Object fieldManager;
4+
private String dryRun;
5+
private String fieldManager;
6+
7+
public String getDryRun() {
8+
return dryRun;
9+
}
10+
11+
public void setDryRun(String dryRun) {
12+
this.dryRun = dryRun;
13+
}
14+
15+
public String getFieldManager() {
16+
return fieldManager;
17+
}
18+
19+
public void setFieldManager(String fieldManager) {
20+
this.fieldManager = fieldManager;
21+
}
722
}
Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
11
package io.kubernetes.client.extended.generic.options;
22

3-
public class PatchOptions {}
3+
public class PatchOptions {
4+
private String dryRun;
5+
private String fieldManager;
6+
private Boolean force;
7+
8+
public String getDryRun() {
9+
return dryRun;
10+
}
11+
12+
public void setDryRun(String dryRun) {
13+
this.dryRun = dryRun;
14+
}
15+
16+
public Boolean getForce() {
17+
return force;
18+
}
19+
20+
public void setForce(Boolean force) {
21+
this.force = force;
22+
}
23+
24+
public String getFieldManager() {
25+
return fieldManager;
26+
}
27+
28+
public void setFieldManager(String fieldManager) {
29+
this.fieldManager = fieldManager;
30+
}
31+
}
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
package io.kubernetes.client.extended.generic.options;
22

3-
public class UpdateOptions {}
3+
public class UpdateOptions {
4+
private String dryRun;
5+
private String fieldManager;
6+
7+
public String getDryRun() {
8+
return dryRun;
9+
}
10+
11+
public void setDryRun(String dryRun) {
12+
this.dryRun = dryRun;
13+
}
14+
15+
public String getFieldManager() {
16+
return fieldManager;
17+
}
18+
19+
public void setFieldManager(String fieldManager) {
20+
this.fieldManager = fieldManager;
21+
}
22+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fbd3c4f2dd1b3900712cd2b2efe11afb28fcdbda141797af573c328e96522c70
1+
799686d5b43497dec49e41fd0588fea8a493b10c7b6e2b8e81b9662a86476bbe

0 commit comments

Comments
 (0)