Finally! We can now stop editing manually our crds definition. Simply run `make crds-gen`. These two files: * `cluster/examples/kubernetes/ceph/crds.yaml` * `cluster/charts/rook-ceph/templates/resources.yaml` will be autogenerated for us. We rely on the controller-gen tool, it reads our API definitions from `pkg/apis/` and produces the CRD files accordingly. It uses "markers" to add extra yaml fields to the CRD, for instance we have a lot fields with: ``` nullable: true x-kubernetes-preserve-unknown-fields: true ``` The corresponding API type markers are: ``` // +kubebuilder:pruning:PreserveUnknownFields // +nullable ``` For more API convention see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required and for the markers see: https://book.kubebuilder.io/reference/markers/crd-validation.html Signed-off-by: Sébastien Han <seb@redhat.com>
Build Rook's CSV file
Just run make CSV_VERSION=1.0.0 csv-ceph like this:
make csv-ceph CSV_VERSION=1.0.1 CSV_PLATFORM=k8s ROOK_OP_VERSION=rook/ceph:v1.0.1
INFO[0000] Generating CSV manifest version 1.0.1 INFO[0000] Fill in the following required fields in file deploy/olm-catalog/ceph.csv.yaml: spec.keywords spec.maintainers spec.provider spec.labels INFO[0000] Create deploy/olm-catalog/ceph.csv.yaml INFO[0000] Create deploy/olm-catalog/_generated.concat_crd.yaml Congratulations! Your Rook CSV 1.0.1 file for k8s is ready at: cluster/olm/ceph/deploy/olm-catalog/rook-ceph.v1.0.1.clusterserviceversion.yaml Push it to https://github.com/operator-framework/community-operators as well as the CRDs files from cluster/olm/ceph/deploy/crds and the package file cluster/olm/ceph/assemble/rook-ceph.package.yaml.
Or for OpenShift use: make CSV_VERSION=1.0.0 CSV_PLATFORM=ocp csv-ceph.