-
Notifications
You must be signed in to change notification settings - Fork 4
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
WIP: Introduce labels to stevedore context #28
base: master
Are you sure you want to change the base?
Conversation
Can we have labels section in context file which defines the label's weight?
|
What will be the weight if the label is not defined? I can think of two possible solution
we will be end up adding more code to support this feature. to solve the problem simply why no throw some kind of warning when condition multiple matches |
I feel alphabetical sorting of labels does not fulfil the consumer need, it might cause more confusions I agree with @dineshba. Adding labels section defined in stevedore config helps to avoid confusions. If we feel this might take lot of effort and time, we can do first release with alphabetical sorting of labels and will create an issue to implement labels section with weights in stevedore config |
Another thought: environment should be mandatory in stevedore context, it should not be optional in labels If there is no different env, no need of going for stevedore. helm is enough |
Stevedore prefers configuration over conventions upto some extend. So I feel So first version: Can we go ahead with just three dimensions ? Logically, weight will be environmentType < environment < context Also, I assume code change will be minimal. |
8c98601
to
eb38c31
Compare
Agree with @dineshba on going ahead with only three dimensions initially. Also for flexible dimensions, how about just specifying the list of labels and weight will be assigned using our existing implementation: stevedore/pkg/stevedore/conditions.go Line 32 in b28eb1a
stevedore/pkg/stevedore/weights.go Line 25 in b28eb1a
Example:
|
Looks good to me @arunvelsriram @dineshba, will go ahead and implement it |
I have rebased with latest master @jskswamy ... I can pick up some tasks if there is some in this PR |
6a41a03
to
3f1df60
Compare
remove the type, environmentType, environment from context and make it flexible to specify whatever label consumer wants to specify inorder to control manifest, override and envs
3f1df60
to
835df6f
Compare
Currently stevedore only supports predefined labels type, environmentType and environment, some of the labels like, environment, environmentType causes confusion to the consumer.
To avoid these confusion, this PR which fixes #1 as well proposes a changes which removes these predefined labels and add them as flexible labels which user themself can define when adding stevedore context, rest of the matches everything works the same way.
current
proposed
The only feature which this feature couldn't match with the original implementation is the predefined weight assigned to the labels since label is a map[string]string, each and every time the label is read, order could be very different and result in non consistent value getting applied.
To avoid this I'm thinking of sorting the labels in alphabetical order all the time, if we do this we will have the feature parity with the current way of working.
Let me know your thoughts before making such changes.