-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow app.kubernetes.io/name to be set in the VerticaDB CR #394
Conversation
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.
Looks good. Lots of little changes, but it's all pretty straightforward.
api/v1beta1/labels.go
Outdated
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.
I understand why you have to move the labels out of the builder package. But, could we just put it in its own package rather than here? Maybe create a package named meta and put the constants for labels and annotations in it.
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.
Yes I think putting all labels/annotations code in its own package makes more sense.
api/v1beta1/verticadb_webhook.go
Outdated
invalidLabels := make([]string, len(ProtectedLabels)) | ||
copy(invalidLabels, ProtectedLabels) |
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.
Why do need to make a copy of ProtectedLabels? Could we just iterate over that one?
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.
Yes we don't need.
pkg/builder/labels_annotations.go
Outdated
OperatorVersion110 = "1.1.0" | ||
OperatorVersion120 = "1.2.0" | ||
OperatorVersion130 = "1.3.0" | ||
NameLabel = "app.kubernetes.io/name" |
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.
Any reason this wasn't move to the package with all of the label const?
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.
Because it is the only place it is used. I am going to create a new package for labels/annotations and move all const labels there.
We can now set the following label in the CR:
All k8s created object will have it. If it is not set in the CR, it will assume the default value which is
vertica
.A webhook has also been added to prevent other internally used labels to be overridden.
Closes #384