Skip to content

Commit

Permalink
adding a utility method for just patch type
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins authored and manusa committed May 26, 2021
1 parent 390de03 commit d1ab437
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public class PatchContext {
private String fieldManager;
private Boolean force;
private PatchType patchType;

public static PatchContext of(PatchType type) {
return new PatchContext.Builder().withPatchType(type).build();
}

public List<String> getDryRun() {
return dryRun;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onClose() {
client.pods()
.inNamespace(currentNamespace)
.withName("sample-watch-pod")
.patch(new PatchContext.Builder().withPatchType(PatchType.STRATEGIC_MERGE).build(), new PodBuilder()
.patch(PatchContext.of(PatchType.STRATEGIC_MERGE), new PodBuilder()
.withNewMetadata()
.addToLabels("foo", "bar")
.endMetadata()
Expand Down

0 comments on commit d1ab437

Please sign in to comment.