Open wonderflow opened 4 years ago
Now, when apply traits, the workloads does not add to traitDefinition's AppliesToWorkloads field like the scopes apply do. So, the applyTo field maybe not use in this moment.
The associated code maybe here: https://github.com/crossplane/oam-kubernetes-runtime/blob/master/pkg/controller/v1alpha2/applicationconfiguration/apply.go#L104 https://github.com/crossplane/oam-kubernetes-runtime/blob/master/pkg/controller/v1alpha2/applicationconfiguration/apply.go#L121
Yes, checking applyTo fields should also add to this validation. @LeoLiuYan
Could this feature assign to me? @wonderflow
Sure, we have already setup validation webhook framework https://github.com/crossplane/oam-kubernetes-runtime/tree/master/pkg/webhook/v1alpha2
You could add it there. @LeoLiuYan
For traitDefinition, the value of applyTo could have many formats:
group/version.Kind
=> core.oam.dev/v1alpha2.PodspecWorkloadworkloadDefinition Name
=> webserviceCRD name
=> deployments.appsgroup name
to represent apply to the whole group =>core.oam.dev
We need to add validation for it and future needs.