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 calls to set annotation for kubectl apply #14626

Merged
merged 3 commits into from
Oct 8, 2015

Conversation

jackgr
Copy link
Contributor

@jackgr jackgr commented Sep 27, 2015

This pull request adds calls to create configuration annotations used by kubectl apply when configuration is updated through most code paths. The only configuration changes it does not capture are those made outside kubectl, and those made by kubectl patch, since the user does not supply the new configuration in its entirety for a patch.

This should be the final step in implementing #1702. Note that it depends on and by necessity includes #14621, which adds the method to create the three way merge patch used by kubectl apply. When #14621 is merged, the diff for this pull request will be significantly smaller.

cc @bgrant0607, @ghodss, @janetkuo, @mikedanese

@k8s-bot
Copy link

k8s-bot commented Sep 27, 2015

Unit, integration and GCE e2e build/test failed for commit 433fa5c1125e5df14bd7d656ddcaf7bf996d1d57.

@k8s-github-robot k8s-github-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 27, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/XXL

@bgrant0607
Copy link
Member

cc @kubernetes/kubectl

@bgrant0607 bgrant0607 assigned ghodss and unassigned smarterclayton Sep 27, 2015
@@ -64,6 +64,10 @@ func AddSourceToErr(verb string, source string, err error) error {

var fatalErrHandler = fatal

// ApplyAnnotation is the annotation used to store the previous configuration
// of a resource that can be used in a three way diff by UpdateApplyAnnotation.
const ApplyAnnotation = "k8s-kubectl-apply"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be "kubectl.kubernetes.io/apply" or similar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed per this comment, which identifies precedents.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in #14621 on which this PR depends and by necessity includes.

@jackgr jackgr force-pushed the apply_annotation branch 2 times, most recently from 74922bb to 2951168 Compare September 28, 2015 22:46
@jackgr
Copy link
Contributor Author

jackgr commented Sep 28, 2015

Rebased to #14621.

@k8s-bot
Copy link

k8s-bot commented Sep 28, 2015

Unit, integration and GCE e2e test build/test passed for commit 74922bb44d0293fad785772d3eb537d863a05822.

@k8s-bot
Copy link

k8s-bot commented Sep 28, 2015

Unit, integration and GCE e2e build/test failed for commit 2951168fe8be76f462c65edcf06fe90d617e71d7.

@k8s-bot
Copy link

k8s-bot commented Sep 29, 2015

Unit, integration and GCE e2e test build/test passed for commit 9304a28b86e55557500cbb0e83d2ab3a110de85e.

return err == ErrPreconditionFailed
}

var ErrPreconditionFailed = fmt.Errorf("a precondition failed")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you group all the error types in this file together? Also do we want them exported or not? Half of them are not, these are...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ones that are exported are the only ones that should be exported, and they are grouped together.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 30, 2015
@k8s-bot
Copy link

k8s-bot commented Oct 1, 2015

Unit, integration and GCE e2e test build/test passed for commit 1ccc37d8d16f26091e0082e9f648861b51e91c13.

@k8s-bot
Copy link

k8s-bot commented Oct 1, 2015

Unit, integration and GCE e2e test build/test passed for commit 53139ae1f4378a763d5ef884c6e473ff262cbd49.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 1, 2015
@jackgr
Copy link
Contributor Author

jackgr commented Oct 1, 2015

@bgrant0607, @ghodss Added e2e test. PTAL.

@jackgr jackgr force-pushed the apply_annotation branch 3 times, most recently from 160469b to d9c7063 Compare October 2, 2015 22:34
@k8s-bot
Copy link

k8s-bot commented Oct 2, 2015

Unit, integration and GCE e2e build/test failed for commit 34226019892de50339f92d2023875191316da22b.

@jackgr
Copy link
Contributor Author

jackgr commented Oct 2, 2015

@jlowdermilk Changes integrated and rebased. PTAL.

@k8s-bot
Copy link

k8s-bot commented Oct 2, 2015

Unit, integration and GCE e2e build/test failed for commit d9c706326adf834a4fdc839ac8c56e55ac07cd90.

@k8s-bot
Copy link

k8s-bot commented Oct 2, 2015

Unit, integration and GCE e2e test build/test passed for commit 160469bee4dde3e99b26344f911dd9d4be29f0e7.

@k8s-bot
Copy link

k8s-bot commented Oct 2, 2015

Unit, integration and GCE e2e test build/test passed for commit 5d15ba106fe8abbc74adc4c82a1451e366b4e04c.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 5, 2015
@k8s-bot
Copy link

k8s-bot commented Oct 7, 2015

GCE e2e test build/test passed for commit b10c9fe168ba12a3781b082340bd5a3d0450bbec.

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

k8s-bot commented Oct 7, 2015

GCE e2e test build/test passed for commit 2ae206f6fa2830141a01719c2f5b576ca43a54b7.

@j3ffml j3ffml assigned j3ffml and unassigned ghodss Oct 7, 2015
@k8s-bot
Copy link

k8s-bot commented Oct 8, 2015

GCE e2e test build/test passed for commit ef3f646.

@j3ffml
Copy link
Contributor

j3ffml commented Oct 8, 2015

lgtm

roberthbailey added a commit that referenced this pull request Oct 8, 2015
Add calls to set annotation for kubectl apply
@roberthbailey roberthbailey merged commit be3fc90 into kubernetes:master Oct 8, 2015
dchen1107 added a commit that referenced this pull request Oct 13, 2015
…14626-upstream-release-1.1

Automated cherry pick of #14626 upstream release 1.1
@jackgr jackgr deleted the apply_annotation branch October 26, 2015 20:54
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…-pick-of-#14626-upstream-release-1.1

Automated cherry pick of kubernetes#14626 upstream release 1.1
shouhong pushed a commit to shouhong/kubernetes that referenced this pull request Feb 14, 2017
…-pick-of-#14626-upstream-release-1.1

Automated cherry pick of kubernetes#14626 upstream release 1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants