-
Notifications
You must be signed in to change notification settings - Fork 8
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
Adding custom labels #53
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! I wonder if we shouldn't namespace the label like juju is doing, though that is just food for thought.
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 still don't see an upgrade test, maybe I missed it?
Since we are making a change to the behaviour (a label is now a different value), an upgrade test from a version of the charm that used to old label to the new label would help us ensure that we don't cause any issues for any users that upgrade. What do you think? |
Yeah, I kind of agree that the label just being
Based on this I'd go with |
Regarding the new and old labels, the old label (app.juju.is/created-by=) is still there, since it is created on Juju's side and not by the charm. That means we now have two labels, the juju label and our new custom label. So, is it really necessary to have an upgrade test since the old label hasn't been removed? The ingress and service definition/update takes place only when the config or relations are changed, not in an upgrade event. I tested an upgrade and the ingress worked just fine. |
I liked this but I think it might conflict here:
I'm considering the idea of using the same label "app.juju.is/created-by". So will be applied even if is not done by Juju. |
I was more thinking that during an upgrade the new custom label may not be present when the charm code assumes it is there - hence the upgrade test. It would be good to see the test methodology and the outcome just to see if anyone has any feedback |
I think this is a great idea. And thanks for finding the issue with my other suggestion. I'd switch my vote to this approach. |
Another approach is to create a new label prefix for the Nginx ingress integrator charm. The advantage of this option is that we can create as many labels as we want without having to worry about conflicts. For example:
|
I'm afraid that in this case would be redundant (and pretty close to the limit of label size) |
The limit of 63 characters only applies to the name segment i.e. the segment after And yes, we can change the prefix to |
I think if we choose the customized prefix solution here, we will create a new pattern / convention. Other charm that manages the Kubernetes resources can all have similar label names like this: |
There have been a number of comments about this on the discourse thread, but let's go ahead with |
Test coverage for e912e7e
Static code analysis report
|
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.
LGTM, thx
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.
Nice :)
This PR focuses on the creation of a custom label for both services and ingresses, to not be dependant on the
app.juju.is/created-by=
label.