apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

Use controller-gen to generate CRDs instead of writing them by hand

Open tokers opened this issue 3 years ago • 5 comments

Currently, we write CRDs by ourselves, it's tedious and error-prone. We should use tools like controller-gen to generate them so that we can focus on the changes of go data structures, and let it do the rest jobs.

tokers avatar May 28 '21 07:05 tokers

@gxthrj @tao12345666333 @lingsamuel

tokers avatar May 28 '21 07:05 tokers

To do so, we need to remove usage of: any type (interface{}), float64 (or enable allowDangerousTypes=true flag).

And add markers like this.

lingsamuel avatar May 28 '21 08:05 lingsamuel

To do so, we need to remove usage of: any type (interface{}), float64 (or enable allowDangerousTypes=true flag).

And add markers like this.

Got it.

tokers avatar May 28 '21 10:05 tokers

xref: https://github.com/apache/apisix-ingress-controller/pull/689#issuecomment-927212290

lingsamuel avatar Sep 26 '21 01:09 lingsamuel

If any CRD validation rules cannot be represented by markers, we should ensure that they are migrated to our code.

lingsamuel avatar Sep 02 '22 09:09 lingsamuel