-
Notifications
You must be signed in to change notification settings - Fork 38
feat: Annotation size limit #355
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
Conversation
zhiying-lin
left a comment
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.
- please add e2e tests to cover create/update the large secret.
- please update your PR description to indicate how/why your PR fixes the bug.
17b3b12 to
956f1b4
Compare
|
Putting the PR as draft to work on E2E |
59176d9 to
bd6e3c9
Compare
|
Instead of removing the last applied config annotation I'm currently setting the annotation to "". This is done because of the scenario described below.
|
bd6e3c9 to
c541e01
Compare
98a178b to
9999305
Compare
zhiying-lin
left a comment
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.
one minor comment, others LGTM
9e7aecc to
e0b4eee
Compare
bd71313 to
5f8ddf0
Compare
| for testName, testCase := range tests { | ||
| t.Run(testName, func(t *testing.T) { | ||
| gotBool, gotErr := setModifiedConfigurationAnnotation(testCase.obj) | ||
| assert.Equalf(t, testCase.wantBool, gotBool, "got bool not matching for Testcase %s", testName) |
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 we try to avoid the Assert libraries in the UT?
"Avoid the use of 'assert' libraries to help your tests. "
https://github.com/golang/go/wiki/TestComments#assert-libraries
Signed-off-by: Zhiying Lin <zhiyingl456@gmail.com>
Description of your changes
The changes in the PR validates the annotation size of the last modified config annotation on the manifest and if it crosses the annotation size threshold it removes the annotation and creates/updates the object on the cluster using server side apply instead of using three way merge.
This ensures that when large objects are propagated we don't fail to apply the object
Fixes #295
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Unit tests
Special notes for your reviewer
Redis guide: https://techcommunity.microsoft.com/t5/apps-on-azure-blog/run-scalable-and-resilient-redis-with-kubernetes-and-azure/ba-p/3247956
Propagated redis helm secret to member cluster
https://blog.atomist.com/kubernetes-apply-replace-patch/
https://stackoverflow.com/questions/28459418/use-of-put-vs-patch-methods-in-rest-api-real-life-scenarios/39338329#39338329