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 (kubernetes-client) : edit()
, patch()
and other mutating operations shouldn't be allowed in NonNamespaceOperation (#3772)
#3798
Conversation
…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>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@rohanKanojia @manusa One small possibility is to allow the methods that pass in an object to not require withName as it can be inferred. |
I created the issue for the edit and patch methods. I assume that the PR just reverted the interface implementation to what it was before introducing the issue, right @rohanKanojia?
Yes. IIRC this was already possible before this PR was merged, so just adding the interfaces would be enough. |
I think these edit, patch interfaces were not part of NonNamespaceOperation before 5.2.0 . They were added by me during dry run implementation |
I was asking namely about |
This was introduced in the mentioned PR (#2832). However, this operation IIRC should work, since the name can be inferred from the resource. In the current PR, you removed this. I'm assuming because of this. The issue only mentioned patch/edit, I only merged the PR because I was assuming this was the prior behavior. So, as Steven suggested, this operation (I wouldn't do this for patch, only for replace) could be added back. And if I'm not mistaken, for the replace implementation, we already have the logic to retrieve the name, so it should be as simple as adding the interface in the right place. Does this sound clearer now? |
…espaceOperation This was introduced by mistake in Dry Run implementation as part of WritableOperation and was subsequently removed in fabric8io#3798 But it makes sense for replace operation to work without name. It can be inferred from the passed object. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…espaceOperation This was introduced by mistake in Dry Run implementation as part of WritableOperation and was subsequently removed in fabric8io#3798 But it makes sense for replace operation to work without name. It can be inferred from the passed object. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…espaceOperation This was introduced by mistake in Dry Run implementation as part of WritableOperation and was subsequently removed in fabric8io#3798 But it makes sense for replace operation to work without name. It can be inferred from the passed object. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…espaceOperation This was introduced by mistake in Dry Run implementation as part of WritableOperation and was subsequently removed in #3798 But it makes sense for replace operation to work without name. It can be inferred from the passed object. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…espaceOperation This was introduced by mistake in Dry Run implementation as part of WritableOperation and was subsequently removed in fabric8io#3798 But it makes sense for replace operation to work without name. It can be inferred from the passed object. Signed-off-by: Rohan Kumar <rohaan@redhat.com> (cherry picked from commit ea07b7f) Signed-off-by: Marc Nuri <marc@marcnuri.com>
…espaceOperation This was introduced by mistake in Dry Run implementation as part of WritableOperation and was subsequently removed in fabric8io#3798 But it makes sense for replace operation to work without name. It can be inferred from the passed object. Signed-off-by: Rohan Kumar <rohaan@redhat.com> (cherry picked from commit ea07b7f) Signed-off-by: Marc Nuri <marc@marcnuri.com>
…espaceOperation This was introduced by mistake in Dry Run implementation as part of WritableOperation and was subsequently removed in #3798 But it makes sense for replace operation to work without name. It can be inferred from the passed object. Signed-off-by: Rohan Kumar <rohaan@redhat.com> (cherry picked from commit ea07b7f) Signed-off-by: Marc Nuri <marc@marcnuri.com>
Description
Fix #3772
Remove reference to
WritableOperation<T>
interface fromNonNamespaceOperation as it exposes
edit()
,patch()
and othermutating operations.
Signed-off-by: Rohan Kumar rohaan@redhat.com
Type of change
test, version modification, documentation, etc.)
Checklist