Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are Pod and Service operations are no longer PropagationPolicyConfigurable? #2745

Closed
milosonator opened this issue Jan 22, 2021 · 1 comment · Fixed by #2814 or jenkinsci/kubernetes-client-api-plugin#83
Assignees
Labels

Comments

@milosonator
Copy link

Upgrading from 4.9.0 to 4.13.10, I find the following code no longer working:

kubernetesClient.services().inNamespace("myNameSpace").withLabel("myLabel").withPropagationPolicy(DeletionPropagation.BACKGROUND).delete(); // already upgraded to enum style instead of string propagation policy

However, I can't call withPropagationPolicy on this operation. Is this no longer supported, or did this not make sense to begin with, and was therefore removed? If no, how can I ensure I can set the propagation behavior for this delete operation?

Is it no longer there because the delete can't cascade to anything since Pods and Services don't have any dependents? Any help much appreciated.

@rohanKanojia
Copy link
Member

Apologies for this. I think it affects all resources not just Pod and Service. both cascading and withPropagationPolicy seem to be unavailable. I think we broke this in between the releases. For now, you should be able to work around this :

ServiceList svcList = kubernetesClient.services()
  .inNamespace("myNameSpace")
  .withLabel("myLabel")
  .list();
kubernetesClient.resourceList(svcList)
  .inNamespace("myNameSpace")
  .withPropagationPolicy(DeletionPropagation.BACKGROUND)
  .delete();

@manusa manusa added the bug label Feb 8, 2021
@rohanKanojia rohanKanojia self-assigned this Feb 15, 2021
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 15, 2021
manusa pushed a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 16, 2021
manusa pushed a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 16, 2021
This was referenced Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment