-
Notifications
You must be signed in to change notification settings - Fork 80
using trait type instead of hardcode word 'trait' to create trait CR #305
Conversation
185794f
to
d1f023d
Compare
I also use replace in KubeVela to manually test vela trait attach, the generated trait name
|
d1f023d
to
e0feda6
Compare
Fix crossplane#294 Signed-off-by: zzxwill <[email protected]>
e0feda6
to
4f2eebf
Compare
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 make sure this is a compatible upgrade, which means, if user has already created a trait with the old naming rule and the spec didn't change , we should use the old name. Only the newly created trait will have the new name.
I didn't see any compatibility in this PR.
@@ -654,7 +654,7 @@ func getTraitName(ac *v1alpha2.ApplicationConfiguration, componentName string, | |||
} | |||
|
|||
if len(traitName) == 0 { | |||
traitName = util.GenTraitName(componentName, ct.DeepCopy()) | |||
traitName = util.GenTraitName(componentName, ct.DeepCopy(), kind) |
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 use kind? shouldn't we use traitdefinition 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.
In pure OAM Kubernetes Runtime, the traitdefinition name is normally very long, like autoscalers.standard.oam.dev
, but for both runtime and KubeVela, the Kind is short and can stand for the traitdefinition name.
How about I cutting the first part split by .
as the trait type in runtime? In Kubevela the name is short and clear.
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.
cutting the first part to be the name is fine for me.
Please make sure the naming rule is clearly documented somewhere.
d8bfd25
to
92cb4a0
Compare
Add the design docs for OAM Kubernetes Runtime PR crossplane/oam-kubernetes-runtime#305
Signed-off-by: zzxwill <[email protected]>
92cb4a0
to
bbbea43
Compare
Signed-off-by: zzxwill <[email protected]>
b5f7872
to
1c4c37f
Compare
Add the design docs for OAM Kubernetes Runtime PR crossplane/oam-kubernetes-runtime#305 Co-authored-by: Jianbo Sun <[email protected]>
* Componenttrait composing and trait CR naming design Add the design docs for OAM Kubernetes Runtime PR crossplane/oam-kubernetes-runtime#305 Co-authored-by: Jianbo Sun <[email protected]> * Update design/vela-core/componenttrait-composing-and-trait-CR-naming.md * Update design/vela-core/componenttrait-composing-and-trait-CR-naming.md * Update design/vela-core/componenttrait-composing-and-trait-CR-naming.md Co-authored-by: Jianbo Sun <[email protected]>
Fix #294