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
fix #4590: only using a builder if there are visitors #4593
Conversation
89deeda
to
fae2717
Compare
SonarCloud Quality Gate failed. |
Maybe I'm not following it OK, but this PR seems to change the current behavior. It now changes the namespace of the context as opposed to changing the namespace of the item in the context. If this is the case, I'm not really sure of the possible side-effects this might have. |
The logic for changing the item namespace at the list level was redundant - it was simply preserved from the original logic. The responsibility for changing the namespace is now handled as part of the resource(item) method, which is called by the logic to perform any of the operations. |
Yes, I understand, but considering a maybe very random use-case (related to #4574) where a user might be doing: kubernetesClient.resource($resource).inNamespace("new-namespace").get();
// or
kubernetesClient.load($resource).inNamespace("new-namespace").get();
// or the #4574 proposal
kubernetesClient.resource($resource).inNamespace("new-namespace").item(); The behavior won't be the same (AFAIU) I'm not opposing to this change, I'm just highlighting the possible side-effects and repercussions. |
No, the behavior is the same - if needed the item namespace will reflect the namespace specified in inNamespace. The only case that is different is if the item does not have a namespace, then the namespace won't be set - the resource(item) logic will leave the resource alone in that case. |
OK, I was missing the important part here: NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl |
Description
Fixes #4590 - the namespace modification is no longer needed in the NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl because the logic in resource(item) will already handle that. This removes the need to construct a builder for just simple operations.
Type of change
test, version modification, documentation, etc.)
Checklist