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

edit() should not be allowed as a ~~NonNamespaceOperation~~ #3772

Closed
manusa opened this issue Jan 20, 2022 · 0 comments · Fixed by #3798
Closed

edit() should not be allowed as a ~~NonNamespaceOperation~~ #3772

manusa opened this issue Jan 20, 2022 · 0 comments · Fixed by #3798
Assignees
Labels

Comments

@manusa
Copy link
Member

manusa commented Jan 20, 2022

Describe the bug

#2832 (#2588) introduced the WritableOperation interface which extends the Editable interface.

This allows NonNamespaceOperation to perform edit method calls when neither the item or the name of the resource has been specified. This is not allowed.

Operations such as:

client.pods().edit(pod -> new PodBuilder(pod)/*...*/.build()); 

should not be possible.

Fabric8 Kubernetes Client version

5.2.0 onwards

Expected behavior

client.pods().withName("pod-name").edit(pod -> new PodBuilder(pod)/*...*/.build()); 
client.pods().load(/* ... */).edit(pod -> new PodBuilder(pod)/*...*/.build()); 

Runtime

other (please specify in additional context)

Kubernetes API Server version

other (please specify in additional context)

Environment

other (please specify in additional context)

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

@manusa manusa added the bug label Jan 20, 2022
@rohanKanojia rohanKanojia self-assigned this Feb 3, 2022
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 3, 2022
…ations shouldn't be allowed in NonNamespaceOperation (fabric8io#3772)

Remove reference to `WritableOperation<T>` interface from
NonNamespaceOperation as it exposes `edit()`, `patch()` and other
mutating operations.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Feb 4, 2022
…ations shouldn't be allowed in NonNamespaceOperation (#3772)

Remove reference to `WritableOperation<T>` interface from
NonNamespaceOperation as it exposes `edit()`, `patch()` and other
mutating operations.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Feb 4, 2022
…ations shouldn't be allowed in NonNamespaceOperation (#3772)

Remove reference to `WritableOperation<T>` interface from
NonNamespaceOperation as it exposes `edit()`, `patch()` and other
mutating operations.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>

(cherry picked from commit 89ec394)
@manusa manusa changed the title edit() should not be allowed as a NonNamespaceOperation edit() should not be allowed as a ~~NonNamespaceOperation~~ Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants