-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Conversation
Unit, integration and GCE e2e build/test failed for commit 433fa5c1125e5df14bd7d656ddcaf7bf996d1d57. |
Labelling this PR as size/XXL |
cc @kubernetes/kubectl |
@@ -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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
74922bb
to
2951168
Compare
Rebased to #14621. |
Unit, integration and GCE e2e test build/test passed for commit 74922bb44d0293fad785772d3eb537d863a05822. |
2951168
to
9304a28
Compare
Unit, integration and GCE e2e build/test failed for commit 2951168fe8be76f462c65edcf06fe90d617e71d7. |
Unit, integration and GCE e2e test build/test passed for commit 9304a28b86e55557500cbb0e83d2ab3a110de85e. |
return err == ErrPreconditionFailed | ||
} | ||
|
||
var ErrPreconditionFailed = fmt.Errorf("a precondition failed") |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
9304a28
to
1ccc37d
Compare
Unit, integration and GCE e2e test build/test passed for commit 1ccc37d8d16f26091e0082e9f648861b51e91c13. |
1ccc37d
to
53139ae
Compare
Unit, integration and GCE e2e test build/test passed for commit 53139ae1f4378a763d5ef884c6e473ff262cbd49. |
@bgrant0607, @ghodss Added e2e test. PTAL. |
160469b
to
d9c7063
Compare
Unit, integration and GCE e2e build/test failed for commit 34226019892de50339f92d2023875191316da22b. |
d9c7063
to
5d15ba1
Compare
@jlowdermilk Changes integrated and rebased. PTAL. |
Unit, integration and GCE e2e build/test failed for commit d9c706326adf834a4fdc839ac8c56e55ac07cd90. |
Unit, integration and GCE e2e test build/test passed for commit 160469bee4dde3e99b26344f911dd9d4be29f0e7. |
Unit, integration and GCE e2e test build/test passed for commit 5d15ba106fe8abbc74adc4c82a1451e366b4e04c. |
5d15ba1
to
b10c9fe
Compare
GCE e2e test build/test passed for commit b10c9fe168ba12a3781b082340bd5a3d0450bbec. |
b10c9fe
to
2ae206f
Compare
GCE e2e test build/test passed for commit 2ae206f6fa2830141a01719c2f5b576ca43a54b7. |
2ae206f
to
ef3f646
Compare
GCE e2e test build/test passed for commit ef3f646. |
lgtm |
Add calls to set annotation for kubectl apply
…14626-upstream-release-1.1 Automated cherry pick of #14626 upstream release 1.1
…-pick-of-#14626-upstream-release-1.1 Automated cherry pick of kubernetes#14626 upstream release 1.1
…-pick-of-#14626-upstream-release-1.1 Automated cherry pick of kubernetes#14626 upstream release 1.1
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