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

Fix the arguments being passed to kubectl patch #1266

Closed
wants to merge 1 commit into from

Conversation

ian-howell
Copy link
Contributor

  • The kubectl patch will fail if the --type merge argument is not
    passed. It also requires for the patch manifest to be enclosed in single
    quotes.

  • This also updates the k8s resource example

Resolves #1223

@CLAassistant
Copy link

CLAassistant commented Mar 18, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sarabala1979 can you check?

@jessesuen jessesuen self-requested a review March 18, 2019 23:30
@jessesuen
Copy link
Member

@ian-howell - @sarabala1979 explained that this is the intended behavior which I agree with. We want the default behavior to use strategic merge patching (which is the kubectl default). If we need other merge types, we can supply it as a different field.

The kubectl patch will fail if the --type merge argument is not
passed. It also requires for the patch manifest to be enclosed in single
quotes.

This should be working for strategic merge patching.

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention is for patch to use strategic merge patching. If we need to support other styles patching, we should provide it as an option

@ian-howell
Copy link
Contributor Author

@jessesuen I understand. I'll take a second look at this tomorrow to suss out why patches are failing in my workflows

@ian-howell
Copy link
Contributor Author

ian-howell commented Mar 19, 2019

I'm not sure I understand. Without the --type merge flag, I get the error

Error from server (UnsupportedMediaType):
the body of the request was in an unknown format - accepted media types include:
application/json-patch+json, application/merge-patch+json

@jessesuen @sarabala1979 Could one of you provide an example patch to be used with this feature?

EDIT: On further inspection, I've found that patching doesn't work for me because I am using Custom Resources. I'll go ahead and work on getting other patch strategies as an option, as per @jessesuen's suggestion

* The `kubectl patch` will fail if the `--type merge` argument is not
  passed. It also requires for the patch manifest to be enclosed in single
  quotes.

* This also updates the k8s resource example
@ian-howell
Copy link
Contributor Author

Closing in favor of #1269

@ian-howell ian-howell closed this Mar 19, 2019
@ian-howell ian-howell deleted the bugfix/patch branch March 19, 2019 16:15
@sarabala1979
Copy link
Member

yes, correct. strategic-merge-patch is supported only standard resources
https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubernetes Resource action: patch is not supported
4 participants