diff --git a/CHANGELOG.md b/CHANGELOG.md index 16740689da..4c87a93769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ // New err = r.client.List(context.TODO(), podList, client.UseListOptions(listOps)) ``` +- CRD file names were previously of the form `___crd.yaml`. Now that CRD manifest `spec.version` is deprecated in favor of `spec.versions`, i.e. multiple versions can be specified in one CRD, CRD file names have the form `__crd.yaml`. `` is the full group name of your CRD while `` is the last subdomain of ``, ex. `foo.bar.com` vs `foo`. `` is the plural lower-case CRD Kind found at `spec.names.plural`. ### Deprecated diff --git a/README.md b/README.md index 4be765aac8..15ef6cfb36 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ $ kubectl create -f deploy/service_account.yaml $ kubectl create -f deploy/role.yaml $ kubectl create -f deploy/role_binding.yaml # Setup the CRD -$ kubectl create -f deploy/crds/app_v1alpha1_appservice_crd.yaml +$ kubectl create -f deploy/crds/app.example.com_appservices_crd.yaml # Deploy the app-operator $ kubectl create -f deploy/operator.yaml @@ -125,7 +125,7 @@ $ kubectl delete -f deploy/operator.yaml $ kubectl delete -f deploy/role.yaml $ kubectl delete -f deploy/role_binding.yaml $ kubectl delete -f deploy/service_account.yaml -$ kubectl delete -f deploy/crds/app_v1alpha1_appservice_crd.yaml +$ kubectl delete -f deploy/crds/app.example.com_appservices_crd.yaml ``` ## Command Line Interface diff --git a/ci/tests/e2e-ansible.sh b/ci/tests/e2e-ansible.sh index 7e57731758..368148d8b5 100755 --- a/ci/tests/e2e-ansible.sh +++ b/ci/tests/e2e-ansible.sh @@ -35,8 +35,8 @@ deploy_operator() { fi kubectl create -f "$OPERATORDIR/deploy/role.yaml" kubectl create -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl create -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml" - kubectl create -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_foo_crd.yaml" + kubectl create -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml" + kubectl create -f "$OPERATORDIR/deploy/crds/ansible.example.com_foos_crd.yaml" kubectl create -f "$OPERATORDIR/deploy/operator.yaml" } @@ -44,8 +44,8 @@ remove_operator() { kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/service_account.yaml" kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role.yaml" kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml" - kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_foo_crd.yaml" + kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml" + kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible.example.com_foos_crd.yaml" kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/operator.yaml" } diff --git a/ci/tests/e2e-helm.sh b/ci/tests/e2e-helm.sh index b0ca8020e4..466b7bcfe2 100755 --- a/ci/tests/e2e-helm.sh +++ b/ci/tests/e2e-helm.sh @@ -32,7 +32,7 @@ deploy_operator() { kubectl create -f "$OPERATORDIR/deploy/service_account.yaml" kubectl create -f "$OPERATORDIR/deploy/role.yaml" kubectl create -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl create -f "$OPERATORDIR/deploy/crds/helm_v1alpha1_nginx_crd.yaml" + kubectl create -f "$OPERATORDIR/deploy/crds/helm.example.com_nginxes_crd.yaml" kubectl create -f "$OPERATORDIR/deploy/operator.yaml" } @@ -40,7 +40,7 @@ remove_operator() { kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/service_account.yaml" kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role.yaml" kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/helm_v1alpha1_nginx_crd.yaml" + kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/helm.example.com_nginxes_crd.yaml" kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/operator.yaml" } diff --git a/cmd/operator-sdk/add/api.go b/cmd/operator-sdk/add/api.go index d9b4aa290a..762c7127c8 100644 --- a/cmd/operator-sdk/add/api.go +++ b/cmd/operator-sdk/add/api.go @@ -49,7 +49,7 @@ This command runs Kubernetes deepcopy and OpenAPI V3 generators on tagged types in all paths under pkg/apis. Go code is generated under pkg/apis///zz_generated.{deepcopy,openapi}.go. CRD's are generated, or updated if they exist for a particular group + version + kind, -under deploy/crds/___crd.yaml; OpenAPI V3 validation YAML +under deploy/crds/__crd.yaml; OpenAPI V3 validation YAML is generated as a 'validation' object. Example: @@ -67,7 +67,7 @@ Example: ├── zz_generated.openapi.go $ tree deploy/crds ├── deploy/crds/app_v1alpha1_appservice_cr.yaml - ├── deploy/crds/app_v1alpha1_appservice_crd.yaml + ├── deploy/crds/app.example.com_appservices_crd.yaml `, RunE: apiRun, } diff --git a/cmd/operator-sdk/add/crd.go b/cmd/operator-sdk/add/crd.go index 771fb016f3..62d6627b74 100644 --- a/cmd/operator-sdk/add/crd.go +++ b/cmd/operator-sdk/add/crd.go @@ -35,7 +35,7 @@ func newAddCRDCmd() *cobra.Command { Short: "Adds a Custom Resource Definition (CRD) and the Custom Resource (CR) files", Long: `The operator-sdk add crd command will create a Custom Resource Definition (CRD) and the Custom Resource (CR) files for the specified api-version and kind. -Generated CRD filename: /deploy/crds/___crd.yaml +Generated CRD filename: /deploy/crds/__crd.yaml Generated CR filename: /deploy/crds/___cr.yaml /deploy path must already exist diff --git a/cmd/operator-sdk/generate/openapi.go b/cmd/operator-sdk/generate/openapi.go index 639d540931..84e5f402a1 100644 --- a/cmd/operator-sdk/generate/openapi.go +++ b/cmd/operator-sdk/generate/openapi.go @@ -29,7 +29,7 @@ func newGenerateOpenAPICmd() *cobra.Command { in all pkg/apis// directories. Go code is generated under pkg/apis///zz_generated.openapi.go. CRD's are generated, or updated if they exist for a particular group + version + kind, under -deploy/crds/___crd.yaml; OpenAPI V3 validation YAML +deploy/crds/__crd.yaml; OpenAPI V3 validation YAML is generated as a 'validation' object. Example: @@ -41,7 +41,7 @@ Example: ├── zz_generated.openapi.go $ tree deploy/crds ├── deploy/crds/app_v1alpha1_appservice_cr.yaml - ├── deploy/crds/app_v1alpha1_appservice_crd.yaml + ├── deploy/crds/app.example.com_appservices_crd.yaml `, RunE: openAPIFunc, } diff --git a/cmd/operator-sdk/scorecard/cmd.go b/cmd/operator-sdk/scorecard/cmd.go index 7513f79712..59281a6416 100644 --- a/cmd/operator-sdk/scorecard/cmd.go +++ b/cmd/operator-sdk/scorecard/cmd.go @@ -50,7 +50,7 @@ func NewCmd() *cobra.Command { scorecardCmd.Flags().StringSlice(scplugins.CRManifestOpt, nil, "Path to manifest for Custom Resource (required) (specify flag multiple times for multiple CRs)") scorecardCmd.Flags().String(scplugins.ProxyImageOpt, fmt.Sprintf("quay.io/operator-framework/scorecard-proxy:%s", strings.TrimSuffix(version.Version, "+git")), "Image name for scorecard proxy") scorecardCmd.Flags().String(scplugins.ProxyPullPolicyOpt, "Always", "Pull policy for scorecard proxy image") - scorecardCmd.Flags().String(scplugins.CRDsDirOpt, scaffold.CRDsDir, "Directory containing CRDs (all CRD manifest filenames must have the suffix 'crd.yaml')") + scorecardCmd.Flags().String(scplugins.CRDsDirOpt, scaffold.CRDsDir, "Directory containing CRD manifests") scorecardCmd.Flags().StringP(scorecard.OutputFormatOpt, "o", scorecard.HumanReadableOutputFormat, fmt.Sprintf("Output format for results. Valid values: %s, %s", scorecard.HumanReadableOutputFormat, scorecard.JSONOutputFormat)) scorecardCmd.Flags().String(scorecard.PluginDirOpt, "scorecard", "Scorecard plugin directory (plugin exectuables must be in a \"bin\" subdirectory") diff --git a/doc/ansible/dev/developer_guide.md b/doc/ansible/dev/developer_guide.md index a18a49bea9..45465fd970 100644 --- a/doc/ansible/dev/developer_guide.md +++ b/doc/ansible/dev/developer_guide.md @@ -211,7 +211,7 @@ Create a Custom Resource Definition (CRD) and proper Role-Based Access Control (RBAC) definitions for resource Foo. `operator-sdk` auto-generates these files inside of the `deploy` folder: ```bash -$ kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml +$ kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml $ kubectl create -f deploy/service_account.yaml $ kubectl create -f deploy/role.yaml $ kubectl create -f deploy/role_binding.yaml @@ -306,7 +306,7 @@ $ sed -i "" 's|REPLACE_IMAGE|quay.io/example/foo-operator:v0.0.1|g' deploy/opera Deploy the foo-operator: ```sh -$ kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml # if CRD doesn't exist already +$ kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml # if CRD doesn't exist already $ kubectl create -f deploy/service_account.yaml $ kubectl create -f deploy/role.yaml $ kubectl create -f deploy/role_binding.yaml diff --git a/doc/ansible/user-guide.md b/doc/ansible/user-guide.md index 28b530aace..aaa6e4391e 100644 --- a/doc/ansible/user-guide.md +++ b/doc/ansible/user-guide.md @@ -217,7 +217,7 @@ resource definition the operator will be watching. Deploy the CRD: ```sh -$ kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml +$ kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml ``` Once this is done, there are two ways to run the operator: @@ -400,7 +400,7 @@ $ kubectl delete -f deploy/operator.yaml $ kubectl delete -f deploy/role_binding.yaml $ kubectl delete -f deploy/role.yaml $ kubectl delete -f deploy/service_account.yaml -$ kubectl delete -f deploy/crds/cache_v1alpha1_memcached_crd.yaml +$ kubectl delete -f deploy/crds/cache.example.com_memcacheds_crd.yaml ``` [operator-scope]:./../operator-scope.md diff --git a/doc/helm/dev/developer_guide.md b/doc/helm/dev/developer_guide.md index 4a9d6c4587..883967fb11 100644 --- a/doc/helm/dev/developer_guide.md +++ b/doc/helm/dev/developer_guide.md @@ -37,11 +37,11 @@ INFO[0000] Created deploy/service_account.yaml INFO[0000] Created deploy/role.yaml INFO[0000] Created deploy/role_binding.yaml INFO[0000] Created deploy/operator.yaml -INFO[0000] Created deploy/crds/foo_v1alpha1_foo_crd.yaml +INFO[0000] Created deploy/crds/foo.example.com_foos_crd.yaml INFO[0000] Created deploy/crds/foo_v1alpha1_foo_cr.yaml INFO[0000] Created helm-charts/foo/ INFO[0000] Run git init ... -Initialized empty Git repository in /home/joe/go/src/github.com/operator-framework/foo-operator/.git/ +Initialized empty Git repository in /home/user/go/src/github.com/operator-framework/foo-operator/.git/ INFO[0000] Run git init done INFO[0000] Project creation complete. @@ -283,7 +283,7 @@ Create a Custom Resource Definition (CRD) for resource Foo. `operator-sdk` autog inside of the `deploy` folder: ```sh -kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml +kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml ``` **NOTE:** When running the Helm operator locally, the `up local` command will default to using the kubeconfig file specified by `$KUBECONFIG` with a fallback to `$HOME/.kube/config` if not set. In this case, the autogenerated RBAC definitions do not need to be applied to the cluster. @@ -407,7 +407,7 @@ sed -i "" 's|REPLACE_IMAGE|quay.io/example/foo-operator:v0.0.1|g' deploy/operato Deploy the foo-operator: ```sh -kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml # if CRD doesn't exist already +kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml # if CRD doesn't exist already kubectl create -f deploy/service_account.yaml kubectl create -f deploy/role.yaml kubectl create -f deploy/role_binding.yaml diff --git a/doc/helm/user-guide.md b/doc/helm/user-guide.md index 66e7ae10dd..3c018583e2 100644 --- a/doc/helm/user-guide.md +++ b/doc/helm/user-guide.md @@ -28,7 +28,7 @@ cd nginx-operator ``` This creates the nginx-operator project specifically for watching the -Nginx resource with APIVersion `example.com/v1alpha1` and Kind +Nginx resource with APIVersion `helm.example.com/v1alpha1` and Kind `Nginx`. For Helm-based projects, `operator-sdk new` also generates the RBAC rules @@ -87,7 +87,7 @@ in `watches.yaml` and executes Helm releases using the specified chart: ```yaml --- - version: v1alpha1 - group: example.com + group: helm.example.com kind: Nginx chart: /opt/helm/helm-charts/nginx ``` @@ -118,10 +118,10 @@ value called `replicaCount` and it is set to `1` by default. If we want to have 2 nginx instances in our deployment, we would need to make sure our CR spec contained `replicaCount: 2`. -Update `deploy/crds/example_v1alpha1_nginx_cr.yaml` to look like the following: +Update `deploy/crds/helm_v1alpha1_nginx_cr.yaml` to look like the following: ```yaml -apiVersion: example.com/v1alpha1 +apiVersion: helm.example.com/v1alpha1 kind: Nginx metadata: name: example-nginx @@ -130,11 +130,11 @@ spec: ``` Similarly, we see that the default service port is set to `80`, but we would -like to use `8080`, so we'll again update `deploy/crds/example_v1alpha1_nginx_cr.yaml` +like to use `8080`, so we'll again update `deploy/crds/helm_v1alpha1_nginx_cr.yaml` by adding the service port override: ```yaml -apiVersion: example.com/v1alpha1 +apiVersion: helm.example.com/v1alpha1 kind: Nginx metadata: name: example-nginx @@ -156,7 +156,7 @@ resource definition the operator will be watching. Deploy the CRD: ```sh -kubectl create -f deploy/crds/example_v1alpha1_nginx_crd.yaml +kubectl create -f deploy/crds/helm.example.com_nginxes_crd.yaml ``` Once this is done, there are two ways to run the operator: @@ -247,7 +247,7 @@ INFO[0000] operator-sdk Version: v0.2.0+git Apply the nginx CR that we modified earlier: ```sh -kubectl apply -f deploy/crds/example_v1alpha1_nginx_cr.yaml +kubectl apply -f deploy/crds/helm_v1alpha1_nginx_cr.yaml ``` Ensure that the nginx-operator creates the deployment for the CR: @@ -281,15 +281,15 @@ Change the `spec.replicaCount` field from 2 to 3, remove the `spec.service` field, and apply the change: ```sh -$ cat deploy/crds/example_v1alpha1_nginx_cr.yaml -apiVersion: "example.com/v1alpha1" +$ cat deploy/crds/helm_v1alpha1_nginx_cr.yaml +apiVersion: "helm.example.com/v1alpha1" kind: "Nginx" metadata: name: "example-nginx" spec: replicaCount: 3 -$ kubectl apply -f deploy/crds/example_v1alpha1_nginx_cr.yaml +$ kubectl apply -f deploy/crds/helm_v1alpha1_nginx_cr.yaml ``` Confirm that the operator changes the deployment size: @@ -313,12 +313,12 @@ example-nginx-b9phnoz9spckcrua7ihrbkrt1 ClusterIP 10.96.26.3 Clean up the resources: ```sh -kubectl delete -f deploy/crds/example_v1alpha1_nginx_cr.yaml +kubectl delete -f deploy/crds/helm_v1alpha1_nginx_cr.yaml kubectl delete -f deploy/operator.yaml kubectl delete -f deploy/role_binding.yaml kubectl delete -f deploy/role.yaml kubectl delete -f deploy/service_account.yaml -kubectl delete -f deploy/crds/example_v1alpha1_nginx_crd.yaml +kubectl delete -f deploy/crds/helm.example.com_nginxes_crd.yaml ``` [operator-scope]:./../operator-scope.md diff --git a/doc/operator-scope.md b/doc/operator-scope.md index 6c3c1949e4..bbce4626e4 100644 --- a/doc/operator-scope.md +++ b/doc/operator-scope.md @@ -23,7 +23,7 @@ Additionally the CustomResourceDefinition (CRD) scope can also be changed for cl For each CRD that needs to be cluster-scoped, update its manifest to be cluster-scoped. -* `deploy/crds/___crd.yaml` +* `deploy/crds/__crd.yaml` * Set `spec.scope: Cluster` To ensure that the CRD is always generated with `scope: Cluster`, add the tag `// +genclient:nonNamespaced` above the CRD's Go type defintion in `pkg/apis///_types.go`. @@ -61,7 +61,7 @@ With the above changes the specified manifests should look as follows: ... ``` * `deploy/role_binding.yaml`: - ```YAML + ```YAML kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -75,7 +75,7 @@ With the above changes the specified manifests should look as follows: name: memcached-operator apiGroup: rbac.authorization.k8s.io ``` -* `deploy/crds/cache_v1alpha1_memcached_crd.yaml` +* `deploy/crds/cache.example.com_memcacheds_crd.yaml` ```YAML apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition diff --git a/doc/proposals/helm-operator.md b/doc/proposals/helm-operator.md index 0d29338ba3..04dff78ac6 100644 --- a/doc/proposals/helm-operator.md +++ b/doc/proposals/helm-operator.md @@ -87,7 +87,7 @@ The resulting structure will be: | | service_account.yaml | | | |-- crds -| | _crd.yaml +| | __crd.yaml | | _cr.yaml ``` diff --git a/doc/sdk-cli-reference.md b/doc/sdk-cli-reference.md index 13ed56be38..d086c9defd 100644 --- a/doc/sdk-cli-reference.md +++ b/doc/sdk-cli-reference.md @@ -175,7 +175,7 @@ pkg/apis/app/v1alpha1/ $ operator-sdk generate openapi INFO[0000] Running OpenAPI code-generation for Custom Resource group versions: [app:[v1alpha1], ] -INFO[0001] Created deploy/crds/app_v1alpha1_appservice_crd.yaml +INFO[0001] Created deploy/crds/app.example.com_appservices_crd.yaml INFO[0001] Code-generation complete. $ tree pkg/apis/app/v1alpha1/ @@ -345,11 +345,11 @@ INFO[0000] Created pkg/apis/addtoscheme_app_v1alpha1.go INFO[0000] Created pkg/apis/app/v1alpha1/register.go INFO[0000] Created pkg/apis/app/v1alpha1/doc.go INFO[0000] Created deploy/crds/app_v1alpha1_appservice_cr.yaml -INFO[0000] Created deploy/crds/app_v1alpha1_appservice_crd.yaml +INFO[0000] Created deploy/crds/app.example.com_appservices_crd.yaml INFO[0001] Running deepcopy code-generation for Custom Resource group versions: [app:[v1alpha1], ] INFO[0002] Code-generation complete. INFO[0002] Running OpenAPI code-generation for Custom Resource group versions: [app:[v1alpha1], ] -INFO[0004] Created deploy/crds/app_v1alpha1_appservice_crd.yaml +INFO[0004] Created deploy/crds/app.example.com_appservices_crd.yaml INFO[0004] Code-generation complete. INFO[0004] API generation complete. ``` @@ -386,7 +386,7 @@ Generates the CRD and the CR files for the specified api-version and kind. ```console $ operator-sdk add crd --api-version app.example.com/v1alpha1 --kind AppService Generating custom resource definition (CRD) files -Created deploy/crds/app_v1alpha1_appservice_crd.yaml +Created deploy/crds/app.example.com_appservices_crd.yaml Created deploy/crds/app_v1alpha1_appservice_cr.yaml ``` @@ -435,7 +435,7 @@ Run scorecard tests on an operator * `basic-tests` - Enable basic operator checks (default true) * `config` string - config file (default is '/.osdk-scorecard'; the config file's extension and format can be .yaml, .json, or .toml) * `cr-manifest` string - (required) Path to manifest for Custom Resource -* `crds-dir` string - Directory containing CRDs (all CRD manifest filenames must have the suffix 'crd.yaml') (default "deploy/crds") +* `crds-dir` string - Directory containing CRD manifests (default "deploy/crds") * `csv-path` string - (required if `olm-tests` is set) Path to CSV being tested * `global-manifest` string - Path to manifest for Global resources (e.g. CRD manifests) * `init-timeout` int - Timeout for status block on CR to be created, in seconds (default 10) diff --git a/doc/test-framework/writing-e2e-tests.md b/doc/test-framework/writing-e2e-tests.md index e0f7a95194..dfb6a3a51c 100644 --- a/doc/test-framework/writing-e2e-tests.md +++ b/doc/test-framework/writing-e2e-tests.md @@ -263,7 +263,7 @@ $ operator-sdk test local ./test/e2e --namespace operator-test --up-local If you would prefer to create the resources yourself and skip resource creation, you can use the `--no-setup` flag: ```shell $ kubectl create namespace operator-test -$ kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml +$ kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml $ kubectl create -f deploy/service_account.yaml --namespace operator-test $ kubectl create -f deploy/role.yaml --namespace operator-test $ kubectl create -f deploy/role_binding.yaml --namespace operator-test @@ -289,7 +289,7 @@ $ cat deploy/role_binding.yaml >> deploy/namespace-init.yaml $ echo -e "\n---\n" >> deploy/namespace-init.yaml $ cat deploy/operator.yaml >> deploy/namespace-init.yaml # Run tests -$ go test ./test/e2e/... -root=$(pwd) -kubeconfig=$HOME/.kube/config -globalMan deploy/crds/example_v1alpha1_app_crd.yaml -namespacedMan deploy/namespace-init.yaml -v -parallel=2 +$ go test ./test/e2e/... -root=$(pwd) -kubeconfig=$HOME/.kube/config -globalMan deploy/crds/cache.example.com_apps_crd.yaml -namespacedMan deploy/namespace-init.yaml -v -parallel=2 ``` ## Manual Cleanup @@ -323,7 +323,7 @@ $ kubectl delete namespace main-153428703 Since the CRD is not namespaced, it must be deleted separately. Clean up the CRD created by the tests using the CRD manifest `deploy/crd.yaml`: ```shell -$ kubectl delete -f deploy/crds/cache_v1alpha1_memcached_crd.yaml +$ kubectl delete -f deploy/crds/cache.example.com_memcacheds_crd.yaml ``` [memcached-sample]:https://github.com/operator-framework/operator-sdk-samples/tree/master/memcached-operator diff --git a/doc/user-guide.md b/doc/user-guide.md index c3c7ac18bb..bb664cc90d 100644 --- a/doc/user-guide.md +++ b/doc/user-guide.md @@ -102,7 +102,7 @@ $ operator-sdk generate k8s ``` ### OpenAPI validation -To update the OpenAPI validation section in the CRD `deploy/crds/cache_v1alpha1_memcached_crd.yaml`, run the following command. +To update the OpenAPI validation section in the CRD `deploy/crds/cache.example.com_memcacheds_crd.yaml`, run the following command. ```console $ operator-sdk generate openapi @@ -208,7 +208,7 @@ For a guide on Reconcilers, Clients, and interacting with resource Events, see t Before running the operator, the CRD must be registered with the Kubernetes apiserver: ```sh -$ kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml +$ kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml ``` Once this is done, there are two ways to run the operator: diff --git a/doc/user/olm-catalog/generating-a-csv.md b/doc/user/olm-catalog/generating-a-csv.md index 01add1447e..a877f95de8 100644 --- a/doc/user/olm-catalog/generating-a-csv.md +++ b/doc/user/olm-catalog/generating-a-csv.md @@ -13,7 +13,7 @@ Operator SDK projects have an expected [project layout][doc-project-layout]. In * Roles: `role.yaml` * Deployments: `operator.yaml` * Custom Resources (CR's): `crds/___cr.yaml` -* Custom Resource Definitions (CRD's): `crds/___crd.yaml`. +* Custom Resource Definitions (CRD's): `crds/__crd.yaml`. `gen-csv` reads these files and adds their data to a CSV in an alternate form. @@ -71,7 +71,7 @@ A note on `specDescriptors` and `statusDescriptors` fields in `spec.customresour ## Updating your CSV -Let's say you added a new CRD `deploy/crds/group_v1beta1_yourkind_crd.yaml` to your Operator project, and added a port to your Deployment manifest `operator.yaml`. Assuming you're using the same version as above, updating your CSV is as simple as running `operator-sdk olm-catalog gen-csv --csv-version 0.0.1`. `gen-csv` will append your new CRD to `spec.customresourcedefinitions.owned`, replace the old data at `spec.install.spec.deployments` with your updated Deployment, and write an updated CSV to the same location. +Let's say you added a new CRD `deploy/crds/group.domain.com_resource_crd.yaml` to your Operator project, and added a port to your Deployment manifest `operator.yaml`. Assuming you're using the same version as above, updating your CSV is as simple as running `operator-sdk olm-catalog gen-csv --csv-version 0.0.1`. `gen-csv` will append your new CRD to `spec.customresourcedefinitions.owned`, replace the old data at `spec.install.spec.deployments` with your updated Deployment, and write an updated CSV to the same location. The SDK will not overwrite user-defined fields like `spec.maintainers` or descriptions of CSV elements, with the exception of `specDescriptors[].displayName` and `statusDescriptors[].displayName` in `spec.customresourcedefinitions.owned`, as mentioned [above](#first-generation). diff --git a/hack/tests/e2e-ansible-molecule.sh b/hack/tests/e2e-ansible-molecule.sh index 048fe33cb7..3f4fdba5f6 100755 --- a/hack/tests/e2e-ansible-molecule.sh +++ b/hack/tests/e2e-ansible-molecule.sh @@ -16,14 +16,14 @@ deploy_prereqs() { oc adm policy add-cluster-role-to-user cluster-admin -z memcached-operator || : kubectl create -f "$OPERATORDIR/deploy/role.yaml" kubectl create -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl create -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml" + kubectl create -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml" } remove_prereqs() { kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/service_account.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/role.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml" + kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml" } pushd "$GOTMP" diff --git a/hack/tests/e2e-ansible.sh b/hack/tests/e2e-ansible.sh index 8c7dfc2c51..70174fbc21 100755 --- a/hack/tests/e2e-ansible.sh +++ b/hack/tests/e2e-ansible.sh @@ -17,8 +17,8 @@ deploy_operator() { oc adm policy add-cluster-role-to-user cluster-admin -z memcached-operator || : kubectl create -f "$OPERATORDIR/deploy/role.yaml" kubectl create -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl create -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml" - kubectl create -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_foo_crd.yaml" + kubectl create -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml" + kubectl create -f "$OPERATORDIR/deploy/crds/ansible.example.com_foos_crd.yaml" kubectl create -f "$OPERATORDIR/deploy/operator.yaml" } @@ -26,8 +26,8 @@ remove_operator() { kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/service_account.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/role.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml" - kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_foo_crd.yaml" + kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml" + kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible.example.com_foos_crd.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/operator.yaml" } diff --git a/hack/tests/e2e-helm.sh b/hack/tests/e2e-helm.sh index adb97f9b26..e07794c641 100755 --- a/hack/tests/e2e-helm.sh +++ b/hack/tests/e2e-helm.sh @@ -13,7 +13,7 @@ deploy_operator() { kubectl create -f "$OPERATORDIR/deploy/service_account.yaml" kubectl create -f "$OPERATORDIR/deploy/role.yaml" kubectl create -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl create -f "$OPERATORDIR/deploy/crds/helm_v1alpha1_nginx_crd.yaml" + kubectl create -f "$OPERATORDIR/deploy/crds/helm.example.com_nginxes_crd.yaml" kubectl create -f "$OPERATORDIR/deploy/operator.yaml" } @@ -21,7 +21,7 @@ remove_operator() { kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/service_account.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/role.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/role_binding.yaml" - kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/helm_v1alpha1_nginx_crd.yaml" + kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/helm.example.com_nginxes_crd.yaml" kubectl delete --ignore-not-found=true -f "$OPERATORDIR/deploy/operator.yaml" } diff --git a/hack/tests/test-subcommand.sh b/hack/tests/test-subcommand.sh index 8067630574..f0587b5b21 100755 --- a/hack/tests/test-subcommand.sh +++ b/hack/tests/test-subcommand.sh @@ -12,7 +12,7 @@ pushd test/test-framework operator-sdk test local ./test/e2e # test operator-sdk test flags -operator-sdk test local ./test/e2e --global-manifest deploy/crds/cache_v1alpha1_memcached_crd.yaml --namespaced-manifest deploy/namespace-init.yaml --go-test-flags "-parallel 1" --kubeconfig $KUBECONFIG --image=quay.io/coreos/operator-sdk-dev:test-framework-operator-runtime +operator-sdk test local ./test/e2e --global-manifest deploy/crds/cache.example.com_memcacheds_crd.yaml --namespaced-manifest deploy/namespace-init.yaml --go-test-flags "-parallel 1" --kubeconfig $KUBECONFIG --image=quay.io/coreos/operator-sdk-dev:test-framework-operator-runtime # we use the test-memcached namespace for all future tests, so we only need to set this trap once kubectl create namespace test-memcached @@ -32,12 +32,12 @@ kubectl delete namespace test-memcached # test operator in no-setup mode kubectl create namespace test-memcached -kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml +kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml # this runs after the popd at the end, so it needs the path from the project root -trap_add 'kubectl delete -f test/test-framework/deploy/crds/cache_v1alpha1_memcached_crd.yaml' EXIT -kubectl create -f deploy/crds/cache_v1alpha1_memcachedrs_crd.yaml +trap_add 'kubectl delete -f test/test-framework/deploy/crds/cache.example.com_memcacheds_crd.yaml' EXIT +kubectl create -f deploy/crds/cache.example.com_memcachedrs_crd.yaml # this runs after the popd at the end, so it needs the path from the project root -trap_add 'kubectl delete -f test/test-framework/deploy/crds/cache_v1alpha1_memcachedrs_crd.yaml' EXIT +trap_add 'kubectl delete -f test/test-framework/deploy/crds/cache.example.com_memcachedrs_crd.yaml' EXIT kubectl create -f deploy/service_account.yaml --namespace test-memcached kubectl create -f deploy/role.yaml --namespace test-memcached kubectl create -f deploy/role_binding.yaml --namespace test-memcached diff --git a/internal/pkg/scaffold/ansible/molecule_test_local_prepare.go b/internal/pkg/scaffold/ansible/molecule_test_local_prepare.go index 3c0a8ccfa5..27f47c96af 100644 --- a/internal/pkg/scaffold/ansible/molecule_test_local_prepare.go +++ b/internal/pkg/scaffold/ansible/molecule_test_local_prepare.go @@ -51,7 +51,7 @@ const moleculeTestLocalPrepareAnsibleTmpl = `--- tasks: - name: Create Custom Resource Definition k8s: - definition: "{{ lookup('file', '/'.join([deploy_dir, 'crds/[[.Resource.Group]]_[[.Resource.Version]]_[[.Resource.LowerKind]]_crd.yaml'])) }}" + definition: "{{ lookup('file', '/'.join([deploy_dir, 'crds/[[.Resource.FullGroup]]_[[.Resource.Resource]]_crd.yaml'])) }}" - name: Ensure specified namespace is present k8s: diff --git a/internal/pkg/scaffold/crd.go b/internal/pkg/scaffold/crd.go index 9481bd56dd..8a30c265d8 100644 --- a/internal/pkg/scaffold/crd.go +++ b/internal/pkg/scaffold/crd.go @@ -31,7 +31,7 @@ import ( crdgenerator "sigs.k8s.io/controller-tools/pkg/crd/generator" ) -// CRD is the input needed to generate a deploy/crds/___crd.yaml file +// CRD is the input needed to generate a deploy/crds/__crd.yaml file type CRD struct { input.Input @@ -58,25 +58,21 @@ func (s *CRD) getFS() afero.Fs { func (s *CRD) GetInput() (input.Input, error) { if s.Path == "" { - fileName := fmt.Sprintf("%s_%s_%s_crd.yaml", - s.Resource.GoImportGroup, - strings.ToLower(s.Resource.Version), - s.Resource.LowerKind) - s.Path = filepath.Join(CRDsDir, fileName) + s.Path = crdPathForResource(CRDsDir, s.Resource) } return s.Input, nil } +func crdPathForResource(dir string, r *Resource) string { + file := fmt.Sprintf("%s_%s_crd.yaml", r.FullGroup, r.Resource) + return filepath.Join(dir, file) +} + var _ CustomRenderer = &CRD{} func (s *CRD) SetFS(fs afero.Fs) { s.initFS(fs) } func (s *CRD) CustomRender() ([]byte, error) { - i, err := s.GetInput() - if err != nil { - return nil, err - } - crd := &apiextv1beta1.CustomResourceDefinition{} if s.IsOperatorGo { // This sets domain as empty string when we can't extract it from FullGroup. @@ -105,8 +101,12 @@ func (s *CRD) CustomRender() ([]byte, error) { // controller-tools generates crd file names with no _crd.yaml suffix: // __.yaml. - path := strings.Replace(filepath.Base(i.Path), "_crd.yaml", ".yaml", 1) - b, err := afero.ReadFile(fs, path) + genPath := fmt.Sprintf("%s_%s_%s.yaml", + s.Resource.GoImportGroup, + s.Resource.Version, + s.Resource.LowerKind, + ) + b, err := afero.ReadFile(fs, genPath) if err != nil { if os.IsNotExist(err) { return nil, fmt.Errorf("no API exists for Group %s Version %s Kind %s", @@ -125,8 +125,8 @@ func (s *CRD) CustomRender() ([]byte, error) { // There are currently no commands to update CRD manifests for non-Go // operators, so if a CRD manifests already exists for this gvk, this // scaffold is a no-op. - path := filepath.Join(s.AbsProjectPath, i.Path) - if _, err = s.getFS().Stat(path); err == nil { + path := crdPathForResource(filepath.Join(s.AbsProjectPath, CRDsDir), s.Resource) + if _, err := s.getFS().Stat(path); err == nil { b, err := afero.ReadFile(s.getFS(), path) if err != nil { return nil, err diff --git a/internal/pkg/scaffold/olm-catalog/config_test.go b/internal/pkg/scaffold/olm-catalog/config_test.go index d882e6af19..88ead210cf 100644 --- a/internal/pkg/scaffold/olm-catalog/config_test.go +++ b/internal/pkg/scaffold/olm-catalog/config_test.go @@ -17,6 +17,7 @@ package catalog import ( "path/filepath" "reflect" + "sort" "testing" "github.com/operator-framework/operator-sdk/internal/pkg/scaffold" @@ -36,16 +37,18 @@ func TestConfig(t *testing.T) { } cfg = &CSVConfig{ - CRDCRPaths: []string{crdsDir, filepath.Join(crdsDir, "app_v1alpha1_app_crd.yaml")}, + CRDCRPaths: []string{crdsDir, filepath.Join(crdsDir, "app.example.com_appservices_crd.yaml")}, } if err := cfg.setFields(); err != nil { t.Errorf("Set fields crd-cr paths dir file mix: (%v)", err) } want := []string{ - filepath.Join(crdsDir, "app_v1alpha1_app_cr.yaml"), - filepath.Join(crdsDir, "app_v1alpha1_app_crd.yaml"), - filepath.Join(crdsDir, "app_v1alpha2_app_crd.yaml"), + filepath.Join(crdsDir, "app_v1alpha1_appservice_cr.yaml"), + filepath.Join(crdsDir, "app.example.com_appservices_crd.yaml"), + filepath.Join(crdsDir, "app.example.com_appservices2_crd.yaml"), } + sort.Strings(want) + sort.Strings(cfg.CRDCRPaths) if !reflect.DeepEqual(want, cfg.CRDCRPaths) { t.Errorf("Wanted crd/cr files %v, got %v", want, cfg.CRDCRPaths) } diff --git a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app.example.com_appservices2_crd.yaml b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app.example.com_appservices2_crd.yaml new file mode 100644 index 0000000000..ec85002404 --- /dev/null +++ b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app.example.com_appservices2_crd.yaml @@ -0,0 +1,17 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: appservice2.example.com +spec: + group: app.example.com + names: + kind: AppService2 + listKind: AppService2List + plural: appservices2 + singular: appservice2 + scope: Namespaced + version: v1alpha2 + versions: + - name: v1alpha2 + served: true + storage: true diff --git a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app.example.com_appservices_crd.yaml b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app.example.com_appservices_crd.yaml new file mode 100644 index 0000000000..3f52bf07d9 --- /dev/null +++ b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app.example.com_appservices_crd.yaml @@ -0,0 +1,17 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: appservice.example.com +spec: + group: app.example.com + names: + kind: AppService + listKind: AppServiceList + plural: appservices + singular: appservice + scope: Namespaced + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true diff --git a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_app_crd.yaml b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_app_crd.yaml deleted file mode 100644 index 60501aad78..0000000000 --- a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_app_crd.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: apps1.example.com -spec: - group: app.example.com - names: - kind: App - listKind: AppList - plural: apps - singular: app - scope: Namespaced - version: v1alpha1 diff --git a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_app_cr.yaml b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_appservice_cr.yaml similarity index 85% rename from internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_app_cr.yaml rename to internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_appservice_cr.yaml index cf49c99cfb..1076adecba 100644 --- a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_app_cr.yaml +++ b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha1_appservice_cr.yaml @@ -1,5 +1,5 @@ apiVersion: app.example.com/v1alpha1 -kind: App +kind: AppService metadata: name: example-app spec: diff --git a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha2_app_crd.yaml b/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha2_app_crd.yaml deleted file mode 100644 index 79d87d38a3..0000000000 --- a/internal/pkg/scaffold/olm-catalog/testdata/deploy/crds/app_v1alpha2_app_crd.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: apps2.example.com -spec: - group: app.example.com - names: - kind: App - listKind: AppList - plural: apps - singular: app - scope: Namespaced - version: v1alpha2 diff --git a/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/app-operator/0.1.0/app-operator.v0.1.0.clusterserviceversion.yaml b/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/app-operator/0.1.0/app-operator.v0.1.0.clusterserviceversion.yaml index 9206edb94d..ac28655f3c 100644 --- a/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/app-operator/0.1.0/app-operator.v0.1.0.clusterserviceversion.yaml +++ b/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/app-operator/0.1.0/app-operator.v0.1.0.clusterserviceversion.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: annotations: - alm-examples: '[{"apiVersion":"app.example.com/v1alpha1","kind":"App","metadata":{"name":"example-app"},"spec":{"size":3}}]' + alm-examples: '[{"apiVersion":"app.example.com/v1alpha1","kind":"AppService","metadata":{"name":"example-app"},"spec":{"size":3}}]' capabilities: Basic Install name: app-operator.v0.1.0 namespace: placeholder @@ -11,13 +11,13 @@ spec: customresourcedefinitions: owned: - displayName: some display name - kind: App - name: apps1.example.com - version: v1alpha1 - - description: some description - kind: App - name: apps2.example.com + kind: AppService2 + name: appservice2.example.com version: v1alpha2 + - description: some description + kind: AppService + name: appservice.example.com + version: v1alpha1 required: - description: Represents a cluster of etcd nodes. displayName: etcd Cluster diff --git a/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/csv-config.yaml b/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/csv-config.yaml index fe48237316..c8281c290d 100644 --- a/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/csv-config.yaml +++ b/internal/pkg/scaffold/olm-catalog/testdata/deploy/olm-catalog/csv-config.yaml @@ -1,6 +1,6 @@ operator-path: "testdata/deploy/operator.yaml" crd-cr-paths: - "testdata/deploy/crds" - - "testdata/deploy/crds/app_v1alpha2_app_crd.yaml" + - "testdata/deploy/crds/app.example.com_appservices2_crd.yaml" role-paths: - "testdata/deploy/role.yaml" diff --git a/internal/pkg/scaffold/resource.go b/internal/pkg/scaffold/resource.go index 08ac9d104d..d2d556051c 100644 --- a/internal/pkg/scaffold/resource.go +++ b/internal/pkg/scaffold/resource.go @@ -23,7 +23,6 @@ import ( "strings" "github.com/markbates/inflect" - "k8s.io/apimachinery/pkg/util/validation" ) diff --git a/test/ansible-inventory/deploy/crds/inventory_v1alpha1_inventory_crd.yaml b/test/ansible-inventory/deploy/crds/inventory.apps.fabianism.us_inventorys_crd.yaml similarity index 84% rename from test/ansible-inventory/deploy/crds/inventory_v1alpha1_inventory_crd.yaml rename to test/ansible-inventory/deploy/crds/inventory.apps.fabianism.us_inventorys_crd.yaml index a276e1e793..c97532fd3e 100644 --- a/test/ansible-inventory/deploy/crds/inventory_v1alpha1_inventory_crd.yaml +++ b/test/ansible-inventory/deploy/crds/inventory.apps.fabianism.us_inventorys_crd.yaml @@ -11,5 +11,9 @@ spec: singular: inventory scope: Namespaced version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true subresources: status: {} diff --git a/test/ansible-inventory/molecule/test-local/prepare.yml b/test/ansible-inventory/molecule/test-local/prepare.yml index 7c12521a97..1a3b20f107 100644 --- a/test/ansible-inventory/molecule/test-local/prepare.yml +++ b/test/ansible-inventory/molecule/test-local/prepare.yml @@ -43,7 +43,7 @@ tasks: - name: Create Custom Resource Definition k8s: - definition: "{{ lookup('file', '/'.join([deploy_dir, 'crds/inventory_v1alpha1_inventory_crd.yaml'])) }}" + definition: "{{ lookup('file', '/'.join([deploy_dir, 'crds/inventory.apps.fabianism.us_inventorys_crd.yaml'])) }}" - name: Ensure specified namespace is present k8s: diff --git a/test/test-framework/deploy/crds/cache_v1alpha1_memcachedrs_crd.yaml b/test/test-framework/deploy/crds/cache.example.com_memcachedrs_crd.yaml similarity index 100% rename from test/test-framework/deploy/crds/cache_v1alpha1_memcachedrs_crd.yaml rename to test/test-framework/deploy/crds/cache.example.com_memcachedrs_crd.yaml diff --git a/test/test-framework/deploy/crds/cache_v1alpha1_memcached_crd.yaml b/test/test-framework/deploy/crds/cache.example.com_memcacheds_crd.yaml similarity index 93% rename from test/test-framework/deploy/crds/cache_v1alpha1_memcached_crd.yaml rename to test/test-framework/deploy/crds/cache.example.com_memcacheds_crd.yaml index 4c15262bf0..53bf81fab7 100644 --- a/test/test-framework/deploy/crds/cache_v1alpha1_memcached_crd.yaml +++ b/test/test-framework/deploy/crds/cache.example.com_memcacheds_crd.yaml @@ -39,5 +39,9 @@ spec: - nodes type: object version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true subresources: status: {}