crossplane / oam-kubernetes-runtime

A set of libraries for building OAM runtimes
Apache License 2.0
277 stars 80 forks source link

[Feature] Add validation for Definition Object #247

Open wonderflow opened 4 years ago

wonderflow commented 4 years ago

For traitDefinition, the value of applyTo could have many formats:

We need to add validation for it and future needs.

LeoLiuYan commented 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

wonderflow commented 4 years ago

Yes, checking applyTo fields should also add to this validation. @LeoLiuYan

LeoLiuYan commented 4 years ago

Could this feature assign to me? @wonderflow

wonderflow commented 4 years ago

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