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

Add kubectl apply edit-last-applied subcommand #42256

Merged
merged 1 commit into from
May 26, 2017

Conversation

shiywang
Copy link
Contributor

@shiywang shiywang commented Feb 28, 2017

third command of kubernetes/community#287
Fixes #44905
@pwittrock @adohe @ymqytw @kubernetes/sig-cli-feature-requests could you guys have an early review ? cause some of feature I'm not sure about, will add unit tests if you think it's ok.

@k8s-ci-robot
Copy link
Contributor

Hi @shiywang. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 28, 2017
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Feb 28, 2017
@deads2k
Copy link
Contributor

deads2k commented Feb 28, 2017

@kubernetes/sig-cli-feature-requests

@shiywang shiywang changed the title [WIP] add kubectl apply edit-last-applied subcommand Add kubectl apply edit-last-applied subcommand Mar 1, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 6, 2017
@shiywang
Copy link
Contributor Author

shiywang commented Mar 7, 2017

@pwittrock @adohe also add some unit tests, ptal

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2017
@dims
Copy link
Member

dims commented Mar 8, 2017

@k8s-bot ok to test

@dims
Copy link
Member

dims commented Mar 10, 2017

@shiywang : can you please see the broken tests?

@shiywang
Copy link
Contributor Author

@dims sure, done

@dims
Copy link
Member

dims commented Mar 29, 2017

@pwittrock @adohe @ymqytw @kubernetes/sig-cli-feature-requests Can one of you please chime in?

@mengqiy
Copy link
Member

mengqiy commented Mar 29, 2017

/assign @ymqytw

@dims
Copy link
Member

dims commented Mar 29, 2017

/unassign @dims

@mengqiy
Copy link
Member

mengqiy commented Mar 31, 2017

According to kubectl convention

Validate: performs validation on the struct fields and returns appropriate errors.

Validate it should not have non-validation stuff in it. Leave it empty if there is nothing to do with validation.

I will revisit this tomorrow.

@mengqiy
Copy link
Member

mengqiy commented Mar 31, 2017

/release-note

@shiywang
Copy link
Contributor Author

shiywang commented May 24, 2017

@alexandercampbell thanks for you comments

You could fall back to VISUAL as well, although I'm not sure anybody sets that variable any more.

I think current is fine, this command is almost same as kubectl edit in edit way

How is this verified?

if not, return Error from server (NotFound) I guess

Where is this change used?

used in function RunSetLastApplied

Sorry, how can we be sure that tempInfos has one item?

there's only one last-applied-configuration object per objects

@shiywang
Copy link
Contributor Author

@mengqiy @liggitt updated, ptal

InfoList []*resource.Info
Mapper meta.RESTMapper
Typer runtime.ObjectTyper
ApplyPatchTypeList []types.PatchType
Copy link
Member

Choose a reason for hiding this comment

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

prefer a list of structs containing the patch content and patch type over parallel lists:

PatchBufferList    []PatchBuffer
...

type PatchBuffer struct {
	Patch     []byte
	PatchType types.PatchType
}

@shiywang
Copy link
Contributor Author

@k8s-bot pull-kubernetes-federation-e2e-gce test this

@shiywang
Copy link
Contributor Author

@liggitt updated, not sure why pull-kubernetes-federation-e2e-gce always failed, ptal
@mengqiy @fabianofranz @pwittrock ping for approval

@liggitt
Copy link
Member

liggitt commented May 24, 2017

LGTM

@mengqiy
Copy link
Member

mengqiy commented May 24, 2017

Thanks for your review.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 24, 2017
@shiywang
Copy link
Contributor Author

@k8s-bot pull-kubernetes-federation-e2e-gce test this

# Edit the last-applied-configuration annotations by type/name in YAML.
kubectl apply edit-last-applied deployment/nginx

# Edit the last-applied-configuration annotations by file in JSON
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment above at line 55 is punctuated, but this comment is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, nice catch

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 25, 2017
@shiywang
Copy link
Contributor Author

shiywang commented May 25, 2017

only add a punctuation
@mengqiy @fabianofranz @liggitt @pwittrock could you guys take a look and give an approval ?
I would like to finish the whole apply subcommand before feature freeze

@shiywang
Copy link
Contributor Author

/lgtm

@k8s-ci-robot
Copy link
Contributor

@shiywang: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mengqiy
Copy link
Member

mengqiy commented May 25, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 25, 2017
@liggitt
Copy link
Member

liggitt commented May 25, 2017

/approve

1 similar comment
@pwittrock
Copy link
Member

/approve

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, mengqiy, pwittrock, shiywang

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 26, 2017
@mengqiy
Copy link
Member

mengqiy commented May 26, 2017

@k8s-bot pull-kubernetes-node-e2e test this
@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 42256, 46479, 45436, 46440, 46417)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.