-
I found the equivalent for "kubectl get pods" in PodListEquivalent.java |
Beta Was this translation helpful? Give feedback.
Answered by
Fasi27
Nov 17, 2023
Replies: 1 comment 1 reply
-
@Fasi27 : You can try using client.apps()
.deployments()
.inNamespace("default")
.withName("jkube-spring-boot3-native-image-demo")
.edit(d -> new DeploymentBuilder(d)
.editSpec()
.editTemplate()
.editSpec()
.editContainer(0)
.addNewEnv()
.withName("TEST_ENV_KEY")
.withValue("TEST_ENV_VAL_UPDATED")
.endEnv()
.endContainer()
.endSpec()
.endTemplate()
.endSpec()
.build()); Or maybe directly use patch: client.apps()
.deployments()
.inNamespace("default")
.withName("jkube-spring-boot3-native-image-demo")
.patch(PatchContext.of(PatchType.STRATEGIC_MERGE),
"{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"spring-boot\",\"env\":[{\"name\":\"PATCHED_ENV\", \"value\":\"PATCH_ENV_VAL_UPDATED\"}]}]}}}}"); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i tried with edit:
the existing env with the same name was also there. Then i added: .removeMatchingFromEnv(envPre -> envPre.getName().equals("TEST_ENV_KEY")) in front of .addNewEnv() and it worked perfectly! Thanks!