Skip to content

Commit 922f52f

Browse files
author
Eric Stroczynski
authored
(c-r v0.2.0) *: update CRD manifest file names to <full group>_… (#1784)
* *: update CRD manifest file names to <full group>_<resource>_crd.yaml
1 parent d3abf04 commit 922f52f

37 files changed

+140
-121
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
// New
3030
err = r.client.List(context.TODO(), podList, client.UseListOptions(listOps))
3131
```
32+
- CRD file names were previously of the form `<group>_<version>_<kind>_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 `<full group>_<resource>_crd.yaml`. `<full group>` is the full group name of your CRD while `<group>` is the last subdomain of `<full group>`, ex. `foo.bar.com` vs `foo`. `<resource>` is the plural lower-case CRD Kind found at `spec.names.plural`.
3233

3334
### Deprecated
3435

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ $ kubectl create -f deploy/service_account.yaml
8888
$ kubectl create -f deploy/role.yaml
8989
$ kubectl create -f deploy/role_binding.yaml
9090
# Setup the CRD
91-
$ kubectl create -f deploy/crds/app_v1alpha1_appservice_crd.yaml
91+
$ kubectl create -f deploy/crds/app.example.com_appservices_crd.yaml
9292
# Deploy the app-operator
9393
$ kubectl create -f deploy/operator.yaml
9494

@@ -125,7 +125,7 @@ $ kubectl delete -f deploy/operator.yaml
125125
$ kubectl delete -f deploy/role.yaml
126126
$ kubectl delete -f deploy/role_binding.yaml
127127
$ kubectl delete -f deploy/service_account.yaml
128-
$ kubectl delete -f deploy/crds/app_v1alpha1_appservice_crd.yaml
128+
$ kubectl delete -f deploy/crds/app.example.com_appservices_crd.yaml
129129
```
130130
## Command Line Interface
131131

ci/tests/e2e-ansible.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ deploy_operator() {
3535
fi
3636
kubectl create -f "$OPERATORDIR/deploy/role.yaml"
3737
kubectl create -f "$OPERATORDIR/deploy/role_binding.yaml"
38-
kubectl create -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml"
39-
kubectl create -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_foo_crd.yaml"
38+
kubectl create -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml"
39+
kubectl create -f "$OPERATORDIR/deploy/crds/ansible.example.com_foos_crd.yaml"
4040
kubectl create -f "$OPERATORDIR/deploy/operator.yaml"
4141
}
4242

4343
remove_operator() {
4444
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/service_account.yaml"
4545
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role.yaml"
4646
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role_binding.yaml"
47-
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_memcached_crd.yaml"
48-
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible_v1alpha1_foo_crd.yaml"
47+
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible.example.com_memcacheds_crd.yaml"
48+
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/ansible.example.com_foos_crd.yaml"
4949
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/operator.yaml"
5050
}
5151

ci/tests/e2e-helm.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ deploy_operator() {
3232
kubectl create -f "$OPERATORDIR/deploy/service_account.yaml"
3333
kubectl create -f "$OPERATORDIR/deploy/role.yaml"
3434
kubectl create -f "$OPERATORDIR/deploy/role_binding.yaml"
35-
kubectl create -f "$OPERATORDIR/deploy/crds/helm_v1alpha1_nginx_crd.yaml"
35+
kubectl create -f "$OPERATORDIR/deploy/crds/helm.example.com_nginxes_crd.yaml"
3636
kubectl create -f "$OPERATORDIR/deploy/operator.yaml"
3737
}
3838

3939
remove_operator() {
4040
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/service_account.yaml"
4141
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role.yaml"
4242
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/role_binding.yaml"
43-
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/helm_v1alpha1_nginx_crd.yaml"
43+
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/crds/helm.example.com_nginxes_crd.yaml"
4444
kubectl delete --wait=true --ignore-not-found=true -f "$OPERATORDIR/deploy/operator.yaml"
4545
}
4646

cmd/operator-sdk/add/api.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This command runs Kubernetes deepcopy and OpenAPI V3 generators on tagged
4949
types in all paths under pkg/apis. Go code is generated under
5050
pkg/apis/<group>/<version>/zz_generated.{deepcopy,openapi}.go. CRD's are
5151
generated, or updated if they exist for a particular group + version + kind,
52-
under deploy/crds/<group>_<version>_<kind>_crd.yaml; OpenAPI V3 validation YAML
52+
under deploy/crds/<full group>_<resource>_crd.yaml; OpenAPI V3 validation YAML
5353
is generated as a 'validation' object.
5454
5555
Example:
@@ -67,7 +67,7 @@ Example:
6767
├── zz_generated.openapi.go
6868
$ tree deploy/crds
6969
├── deploy/crds/app_v1alpha1_appservice_cr.yaml
70-
├── deploy/crds/app_v1alpha1_appservice_crd.yaml
70+
├── deploy/crds/app.example.com_appservices_crd.yaml
7171
`,
7272
RunE: apiRun,
7373
}

cmd/operator-sdk/add/crd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func newAddCRDCmd() *cobra.Command {
3535
Short: "Adds a Custom Resource Definition (CRD) and the Custom Resource (CR) files",
3636
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.
3737
38-
Generated CRD filename: <project-name>/deploy/crds/<group>_<version>_<kind>_crd.yaml
38+
Generated CRD filename: <project-name>/deploy/crds/<full group>_<resource>_crd.yaml
3939
Generated CR filename: <project-name>/deploy/crds/<group>_<version>_<kind>_cr.yaml
4040
4141
<project-name>/deploy path must already exist

cmd/operator-sdk/generate/openapi.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func newGenerateOpenAPICmd() *cobra.Command {
2929
in all pkg/apis/<group>/<version> directories. Go code is generated under
3030
pkg/apis/<group>/<version>/zz_generated.openapi.go. CRD's are generated, or
3131
updated if they exist for a particular group + version + kind, under
32-
deploy/crds/<group>_<version>_<kind>_crd.yaml; OpenAPI V3 validation YAML
32+
deploy/crds/<full group>_<resource>_crd.yaml; OpenAPI V3 validation YAML
3333
is generated as a 'validation' object.
3434
3535
Example:
@@ -41,7 +41,7 @@ Example:
4141
├── zz_generated.openapi.go
4242
$ tree deploy/crds
4343
├── deploy/crds/app_v1alpha1_appservice_cr.yaml
44-
├── deploy/crds/app_v1alpha1_appservice_crd.yaml
44+
├── deploy/crds/app.example.com_appservices_crd.yaml
4545
`,
4646
RunE: openAPIFunc,
4747
}

cmd/operator-sdk/scorecard/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func NewCmd() *cobra.Command {
5050
scorecardCmd.Flags().StringSlice(scplugins.CRManifestOpt, nil, "Path to manifest for Custom Resource (required) (specify flag multiple times for multiple CRs)")
5151
scorecardCmd.Flags().String(scplugins.ProxyImageOpt, fmt.Sprintf("quay.io/operator-framework/scorecard-proxy:%s", strings.TrimSuffix(version.Version, "+git")), "Image name for scorecard proxy")
5252
scorecardCmd.Flags().String(scplugins.ProxyPullPolicyOpt, "Always", "Pull policy for scorecard proxy image")
53-
scorecardCmd.Flags().String(scplugins.CRDsDirOpt, scaffold.CRDsDir, "Directory containing CRDs (all CRD manifest filenames must have the suffix 'crd.yaml')")
53+
scorecardCmd.Flags().String(scplugins.CRDsDirOpt, scaffold.CRDsDir, "Directory containing CRD manifests")
5454
scorecardCmd.Flags().StringP(scorecard.OutputFormatOpt, "o", scorecard.HumanReadableOutputFormat, fmt.Sprintf("Output format for results. Valid values: %s, %s", scorecard.HumanReadableOutputFormat, scorecard.JSONOutputFormat))
5555
scorecardCmd.Flags().String(scorecard.PluginDirOpt, "scorecard", "Scorecard plugin directory (plugin exectuables must be in a \"bin\" subdirectory")
5656

doc/ansible/dev/developer_guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Create a Custom Resource Definition (CRD) and proper Role-Based Access Control
211211
(RBAC) definitions for resource Foo. `operator-sdk` auto-generates these files
212212
inside of the `deploy` folder:
213213
```bash
214-
$ kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml
214+
$ kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml
215215
$ kubectl create -f deploy/service_account.yaml
216216
$ kubectl create -f deploy/role.yaml
217217
$ 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
306306
Deploy the foo-operator:
307307

308308
```sh
309-
$ kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml # if CRD doesn't exist already
309+
$ kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml # if CRD doesn't exist already
310310
$ kubectl create -f deploy/service_account.yaml
311311
$ kubectl create -f deploy/role.yaml
312312
$ kubectl create -f deploy/role_binding.yaml

doc/ansible/user-guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ resource definition the operator will be watching.
217217
Deploy the CRD:
218218

219219
```sh
220-
$ kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml
220+
$ kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml
221221
```
222222

223223
Once this is done, there are two ways to run the operator:
@@ -400,7 +400,7 @@ $ kubectl delete -f deploy/operator.yaml
400400
$ kubectl delete -f deploy/role_binding.yaml
401401
$ kubectl delete -f deploy/role.yaml
402402
$ kubectl delete -f deploy/service_account.yaml
403-
$ kubectl delete -f deploy/crds/cache_v1alpha1_memcached_crd.yaml
403+
$ kubectl delete -f deploy/crds/cache.example.com_memcacheds_crd.yaml
404404
```
405405

406406
[operator-scope]:./../operator-scope.md

doc/helm/dev/developer_guide.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ INFO[0000] Created deploy/service_account.yaml
3737
INFO[0000] Created deploy/role.yaml
3838
INFO[0000] Created deploy/role_binding.yaml
3939
INFO[0000] Created deploy/operator.yaml
40-
INFO[0000] Created deploy/crds/foo_v1alpha1_foo_crd.yaml
40+
INFO[0000] Created deploy/crds/foo.example.com_foos_crd.yaml
4141
INFO[0000] Created deploy/crds/foo_v1alpha1_foo_cr.yaml
4242
INFO[0000] Created helm-charts/foo/
4343
INFO[0000] Run git init ...
44-
Initialized empty Git repository in /home/joe/go/src/github.com/operator-framework/foo-operator/.git/
44+
Initialized empty Git repository in /home/user/go/src/github.com/operator-framework/foo-operator/.git/
4545
INFO[0000] Run git init done
4646
INFO[0000] Project creation complete.
4747

@@ -283,7 +283,7 @@ Create a Custom Resource Definition (CRD) for resource Foo. `operator-sdk` autog
283283
inside of the `deploy` folder:
284284

285285
```sh
286-
kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml
286+
kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml
287287
```
288288

289289
**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
407407
Deploy the foo-operator:
408408

409409
```sh
410-
kubectl create -f deploy/crds/foo_v1alpha1_foo_crd.yaml # if CRD doesn't exist already
410+
kubectl create -f deploy/crds/foo.example.com_foos_crd.yaml # if CRD doesn't exist already
411411
kubectl create -f deploy/service_account.yaml
412412
kubectl create -f deploy/role.yaml
413413
kubectl create -f deploy/role_binding.yaml

doc/helm/user-guide.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cd nginx-operator
2828
```
2929

3030
This creates the nginx-operator project specifically for watching the
31-
Nginx resource with APIVersion `example.com/v1alpha1` and Kind
31+
Nginx resource with APIVersion `helm.example.com/v1alpha1` and Kind
3232
`Nginx`.
3333

3434
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:
8787
```yaml
8888
---
8989
- version: v1alpha1
90-
group: example.com
90+
group: helm.example.com
9191
kind: Nginx
9292
chart: /opt/helm/helm-charts/nginx
9393
```
@@ -118,10 +118,10 @@ value called `replicaCount` and it is set to `1` by default. If we want to have
118118
2 nginx instances in our deployment, we would need to make sure our CR spec
119119
contained `replicaCount: 2`.
120120

121-
Update `deploy/crds/example_v1alpha1_nginx_cr.yaml` to look like the following:
121+
Update `deploy/crds/helm_v1alpha1_nginx_cr.yaml` to look like the following:
122122

123123
```yaml
124-
apiVersion: example.com/v1alpha1
124+
apiVersion: helm.example.com/v1alpha1
125125
kind: Nginx
126126
metadata:
127127
name: example-nginx
@@ -130,11 +130,11 @@ spec:
130130
```
131131

132132
Similarly, we see that the default service port is set to `80`, but we would
133-
like to use `8080`, so we'll again update `deploy/crds/example_v1alpha1_nginx_cr.yaml`
133+
like to use `8080`, so we'll again update `deploy/crds/helm_v1alpha1_nginx_cr.yaml`
134134
by adding the service port override:
135135

136136
```yaml
137-
apiVersion: example.com/v1alpha1
137+
apiVersion: helm.example.com/v1alpha1
138138
kind: Nginx
139139
metadata:
140140
name: example-nginx
@@ -156,7 +156,7 @@ resource definition the operator will be watching.
156156
Deploy the CRD:
157157

158158
```sh
159-
kubectl create -f deploy/crds/example_v1alpha1_nginx_crd.yaml
159+
kubectl create -f deploy/crds/helm.example.com_nginxes_crd.yaml
160160
```
161161

162162
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
247247
Apply the nginx CR that we modified earlier:
248248

249249
```sh
250-
kubectl apply -f deploy/crds/example_v1alpha1_nginx_cr.yaml
250+
kubectl apply -f deploy/crds/helm_v1alpha1_nginx_cr.yaml
251251
```
252252

253253
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`
281281
field, and apply the change:
282282

283283
```sh
284-
$ cat deploy/crds/example_v1alpha1_nginx_cr.yaml
285-
apiVersion: "example.com/v1alpha1"
284+
$ cat deploy/crds/helm_v1alpha1_nginx_cr.yaml
285+
apiVersion: "helm.example.com/v1alpha1"
286286
kind: "Nginx"
287287
metadata:
288288
name: "example-nginx"
289289
spec:
290290
replicaCount: 3
291291
292-
$ kubectl apply -f deploy/crds/example_v1alpha1_nginx_cr.yaml
292+
$ kubectl apply -f deploy/crds/helm_v1alpha1_nginx_cr.yaml
293293
```
294294

295295
Confirm that the operator changes the deployment size:
@@ -313,12 +313,12 @@ example-nginx-b9phnoz9spckcrua7ihrbkrt1 ClusterIP 10.96.26.3 <none>
313313
Clean up the resources:
314314

315315
```sh
316-
kubectl delete -f deploy/crds/example_v1alpha1_nginx_cr.yaml
316+
kubectl delete -f deploy/crds/helm_v1alpha1_nginx_cr.yaml
317317
kubectl delete -f deploy/operator.yaml
318318
kubectl delete -f deploy/role_binding.yaml
319319
kubectl delete -f deploy/role.yaml
320320
kubectl delete -f deploy/service_account.yaml
321-
kubectl delete -f deploy/crds/example_v1alpha1_nginx_crd.yaml
321+
kubectl delete -f deploy/crds/helm.example.com_nginxes_crd.yaml
322322
```
323323

324324
[operator-scope]:./../operator-scope.md

doc/operator-scope.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Additionally the CustomResourceDefinition (CRD) scope can also be changed for cl
2323
2424
For each CRD that needs to be cluster-scoped, update its manifest to be cluster-scoped.
2525

26-
* `deploy/crds/<group>_<version>_<kind>_crd.yaml`
26+
* `deploy/crds/<full group>_<resource>_crd.yaml`
2727
* Set `spec.scope: Cluster`
2828

2929
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/<group>/<version>/<kind>_types.go`.
@@ -61,7 +61,7 @@ With the above changes the specified manifests should look as follows:
6161
...
6262
```
6363
* `deploy/role_binding.yaml`:
64-
```YAML
64+
```YAML
6565
kind: ClusterRoleBinding
6666
apiVersion: rbac.authorization.k8s.io/v1
6767
metadata:
@@ -75,7 +75,7 @@ With the above changes the specified manifests should look as follows:
7575
name: memcached-operator
7676
apiGroup: rbac.authorization.k8s.io
7777
```
78-
* `deploy/crds/cache_v1alpha1_memcached_crd.yaml`
78+
* `deploy/crds/cache.example.com_memcacheds_crd.yaml`
7979
```YAML
8080
apiVersion: apiextensions.k8s.io/v1beta1
8181
kind: CustomResourceDefinition

doc/proposals/helm-operator.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The resulting structure will be:
8787
| | service_account.yaml
8888
| |
8989
| |-- crds
90-
| | <gvk>_crd.yaml
90+
| | <full group>_<resource>_crd.yaml
9191
| | <gvk>_cr.yaml
9292
```
9393

doc/sdk-cli-reference.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pkg/apis/app/v1alpha1/
175175

176176
$ operator-sdk generate openapi
177177
INFO[0000] Running OpenAPI code-generation for Custom Resource group versions: [app:[v1alpha1], ]
178-
INFO[0001] Created deploy/crds/app_v1alpha1_appservice_crd.yaml
178+
INFO[0001] Created deploy/crds/app.example.com_appservices_crd.yaml
179179
INFO[0001] Code-generation complete.
180180

181181
$ tree pkg/apis/app/v1alpha1/
@@ -345,11 +345,11 @@ INFO[0000] Created pkg/apis/addtoscheme_app_v1alpha1.go
345345
INFO[0000] Created pkg/apis/app/v1alpha1/register.go
346346
INFO[0000] Created pkg/apis/app/v1alpha1/doc.go
347347
INFO[0000] Created deploy/crds/app_v1alpha1_appservice_cr.yaml
348-
INFO[0000] Created deploy/crds/app_v1alpha1_appservice_crd.yaml
348+
INFO[0000] Created deploy/crds/app.example.com_appservices_crd.yaml
349349
INFO[0001] Running deepcopy code-generation for Custom Resource group versions: [app:[v1alpha1], ]
350350
INFO[0002] Code-generation complete.
351351
INFO[0002] Running OpenAPI code-generation for Custom Resource group versions: [app:[v1alpha1], ]
352-
INFO[0004] Created deploy/crds/app_v1alpha1_appservice_crd.yaml
352+
INFO[0004] Created deploy/crds/app.example.com_appservices_crd.yaml
353353
INFO[0004] Code-generation complete.
354354
INFO[0004] API generation complete.
355355
```
@@ -386,7 +386,7 @@ Generates the CRD and the CR files for the specified api-version and kind.
386386
```console
387387
$ operator-sdk add crd --api-version app.example.com/v1alpha1 --kind AppService
388388
Generating custom resource definition (CRD) files
389-
Created deploy/crds/app_v1alpha1_appservice_crd.yaml
389+
Created deploy/crds/app.example.com_appservices_crd.yaml
390390
Created deploy/crds/app_v1alpha1_appservice_cr.yaml
391391
```
392392

@@ -435,7 +435,7 @@ Run scorecard tests on an operator
435435
* `basic-tests` - Enable basic operator checks (default true)
436436
* `config` string - config file (default is '<project_dir>/.osdk-scorecard'; the config file's extension and format can be .yaml, .json, or .toml)
437437
* `cr-manifest` string - (required) Path to manifest for Custom Resource
438-
* `crds-dir` string - Directory containing CRDs (all CRD manifest filenames must have the suffix 'crd.yaml') (default "deploy/crds")
438+
* `crds-dir` string - Directory containing CRD manifests (default "deploy/crds")
439439
* `csv-path` string - (required if `olm-tests` is set) Path to CSV being tested
440440
* `global-manifest` string - Path to manifest for Global resources (e.g. CRD manifests)
441441
* `init-timeout` int - Timeout for status block on CR to be created, in seconds (default 10)

doc/test-framework/writing-e2e-tests.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ $ operator-sdk test local ./test/e2e --namespace operator-test --up-local
263263
If you would prefer to create the resources yourself and skip resource creation, you can use the `--no-setup` flag:
264264
```shell
265265
$ kubectl create namespace operator-test
266-
$ kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml
266+
$ kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml
267267
$ kubectl create -f deploy/service_account.yaml --namespace operator-test
268268
$ kubectl create -f deploy/role.yaml --namespace operator-test
269269
$ kubectl create -f deploy/role_binding.yaml --namespace operator-test
@@ -289,7 +289,7 @@ $ cat deploy/role_binding.yaml >> deploy/namespace-init.yaml
289289
$ echo -e "\n---\n" >> deploy/namespace-init.yaml
290290
$ cat deploy/operator.yaml >> deploy/namespace-init.yaml
291291
# Run tests
292-
$ 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
292+
$ 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
293293
```
294294

295295
## Manual Cleanup
@@ -323,7 +323,7 @@ $ kubectl delete namespace main-153428703
323323
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`:
324324

325325
```shell
326-
$ kubectl delete -f deploy/crds/cache_v1alpha1_memcached_crd.yaml
326+
$ kubectl delete -f deploy/crds/cache.example.com_memcacheds_crd.yaml
327327
```
328328

329329
[memcached-sample]:https://github.com/operator-framework/operator-sdk-samples/tree/master/memcached-operator

0 commit comments

Comments
 (0)