Commit 31204bc
Aaron Eaton
Prevent generated types from colliding with Resources (#236)
Signed-off-by: Aaron Eaton <aaron@upbound.io>
Issue #, if available: crossplane-contrib/provider-aws#876
Description of changes:
It is possible to have a name collision between a Crossplane Managed Resource and a generated type based on a resource's fields. A good example of this is the SecurityGroup type, which is both a [Managed Resource](https://github.com/crossplane/provider-aws/blob/fd376a39bfebaef2fcc5d1c8fb9177f7e4652bd8/apis/ec2/v1beta1/securitygroup_types.go#L240) and a [generated type](https://github.com/crossplane/provider-aws/blob/76bc036fa0b1cfc5438777cf324922b3634b05e1/apis/ec2/v1alpha1/zz_types.go#L2428).
Whichever type is declared in the highest apiVersion will become the "storage version" for the given type.
For SecurityGroup, this has no impact, because the Managed Resource is version `v1beta1` and the generated type is only in lower versions.
But for the proposed [Route](crossplane-contrib/provider-aws#859) resource, the Managed Resources is `v1alpha1` and a generated type exists in `v1beta1`, resulting in `v1beta1` becoming the storage version. Because the storage version is generated, it lacks crossplane required fields `status` and `synced`.
Marking all generated types with `// +kubebuilder:skipversion` will prevent them from becoming the storage version for a Managed Resource of the same name.1 parent 6ce1a67 commit 31204bc
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
0 commit comments