This directory contains CRD test fixtures, mostly intended to be used with `envtest`. By storing the fixtures here, we remove the need for each test or controller to generate and maintain these. ## Generating CRDs ```sh # generate all of them just update-manifest-gen # generate a specific set just run test:$target_name just run test:gen_edge_crds just run test:gen_gcp_crds ``` To see all the CRD generation targets for test fixtures: ```sh bazel query //test/... ``` ## Adding a New CRD Generation Target In `test/BUILD.bazel`: ```python gen_manifests( # name you will use when `just run ...` name = "gen_my_crds", crd_out_path = "test/mine", # path to go package you are generating CRDs for, controller-gen # will recurse into subpackages, can be in project or external (i.e. alternatively pkg = "github.com/someproject/someapis") pkg = "pkg/mine/apis", # tells controller-gen script to use provided crd_out_path # as the full output path relative to root dir relative_out_path = False, ) # this filegroup allows you to reference all of your CRDs with one # label. this is useful for depending on these CRDs in a test filegroup( name = "mine", srcs = glob(["mine/*.yaml"]), ) ``` In `test/BUILD.bazel`: Add CRD Generation directory to `embedsrcs`: ```python go_library( name = "test", srcs = ["envtest.go"], embedsrcs = [ "//test:CRDDirectoryToAdd", ], ```