Patching a serviceaccount #5826
Unanswered
mikebell90
asked this question in
Q&A
Replies: 1 comment 6 replies
-
@mikebell90 : Hello, I tried reproducing the issue on minikube but for me labels seem to be added in ServiceAccount. Which version of KubernetesClient are you using? I tried these methods:
kubernetesClient.serviceAccounts().inNamespace("default").withName("build-robot")
.edit(s -> new ServiceAccountBuilder(s)
.editOrNewMetadata()
.addToLabels("app", "dipun")
.addToLabels("foo", "bar")
.addToLabels("otmetaComponent", "newthing")
.endMetadata()
.build()); |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm moving over from official kubernetes java client to fabric8. When I wanted to patch a service account before, I generated a json patch and things worked nicely. However this always fails with fabric8, the api server rejects with a 422.
apiClient.serviceAccounts().inNamespace(namespace).withName(name).patch(PatchContext.of(PatchType.JSON),jsonPatchStr);
with jsonPatchStr = (note it's an array of patches)
Gets error
I have also tried base64ing the json patch.
Beta Was this translation helpful? Give feedback.
All reactions