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 generic function for updating the annotations only #1351

Merged
merged 1 commit into from
Jan 13, 2021

Conversation

Liujingfang1
Copy link
Contributor

Add a function to update the annotation of an object. Here is how it should be used.

obj := client.Get()

var newAnnotations map[string]string
// get the new annotations that obj should have
// not including the last-applied-config annotation

UpdateAnnotation(obj, newAnnotations)

client.Update(obj)

Also add unit tests for the new function.

@Liujingfang1
Copy link
Contributor Author

/assign @seans3

Copy link
Contributor

@seans3 seans3 left a comment

Choose a reason for hiding this comment

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

Small nitpicks.

pkg/client/client.go Outdated Show resolved Hide resolved
pkg/client/client.go Show resolved Hide resolved
Copy link
Contributor

@seans3 seans3 left a comment

Choose a reason for hiding this comment

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

/lgtm

@seans3 seans3 merged commit cb91d2e into kptdev:master Jan 13, 2021
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.

None yet

2 participants