kubernetes-sigs / security-profiles-operator

The Kubernetes Security Profiles Operator
Apache License 2.0
699 stars 107 forks source link

Check if type-based validation is necessary when having a CRD #133

Closed saschagrunert closed 3 years ago

saschagrunert commented 4 years ago

With #125 we will have a CRD around seccomp profiles which give us a good API-level validation of the fields. We should check if this type-based validation is still necessary afterwards:

https://github.com/kubernetes-sigs/seccomp-operator/blob/b292dd72053e9868d39e6d2063dcfb1f4454e99a/internal/pkg/controllers/profile/profile.go#L216-L226

The check just unmarshals the JSON fields which gives us kind of a type safety.

saschagrunert commented 3 years ago

The CRD is totally fine for replacing the logic of the validation. Closing this one.