Skip to content

Commit 1e1a6b1

Browse files
authored
Update documentation for generating manifests (#6053)
1 parent 0f81c62 commit 1e1a6b1

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

website/content/en/docs/olm-integration/generation.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ See this [CLI overview][cli-overview] for details on each command.
2323
### Kustomize files
2424

2525
`operator-sdk generate kustomize manifests` generates a CSV kustomize base
26-
`config/manifests/bases/<project-name>.clusterserviceversion.yaml` and a `config/manifests/bases/kustomization.yaml`
26+
`config/manifests/bases/<project-name>.clusterserviceversion.yaml` and a `config/manifests/kustomization.yaml`
2727
by default. These files are required as `kustomize build` input in downstream commands.
2828

2929
By default, the command starts an interactive prompt if a CSV base in `config/manifests/bases` is not present
30-
to collect [UI metadata](#csv-fields). You can disable the interactive prompt by passing `--kustomize=false`.
30+
to collect [UI metadata](#csv-fields). You can disable the interactive prompt by passing `--interactive=false`.
3131

3232
```console
3333
$ operator-sdk generate kustomize manifests
@@ -47,7 +47,25 @@ These values will persist when generating a bundle, so make necessary metadata c
4747
**For Go Operators only:** the command parses [CSV markers][csv-markers] from Go API type definitions, located
4848
in `./api` for single group projects and `./apis` for multigroup projects, to populate certain CSV fields.
4949
You can set an alternative path to the API types root directory with `--apis-dir`. These markers are not available
50-
to Ansible or Helm project types.
50+
to Ansible or Helm project types.
51+
52+
The command attempts to process the local types defined in your API.
53+
If you import a package that uses the same name as a local type, running the command causes an infinite loop. For example:
54+
```go
55+
type PodStatus struct {
56+
SomeField string
57+
// imported type with the same name will infinitely trigger
58+
// the parser to process the local PodStatus type
59+
Status v1.PodStatus
60+
}
61+
```
62+
To prevent an infinite loop, edit the local type definition to use a different name. For example:
63+
```go
64+
type PodStatusWrapper struct {
65+
SomeField string
66+
Status v1.PodStatus
67+
}
68+
```
5169

5270
### ClusterServiceVersion manifests
5371

@@ -57,7 +75,7 @@ themselves; this version is present in both their `metadata.name` and `spec.vers
5775
by `generate <bundle|packagemanifests>` requires certain input manifests to construct a CSV manifest; all inputs
5876
are read when either command is invoked, along with a CSV's [base](#kustomize-files), to idempotently regenerate a CSV.
5977

60-
The following resource kinds are typically included in a CSV, which are addressed by `config/manifests/bases/kustomization.yaml`:
78+
The following resource kinds are typically included in a CSV, which are addressed by `config/manifests/kustomization.yaml`:
6179
- `Role`: define Operator permissions within a namespace.
6280
- `ClusterRole`: define cluster-wide Operator permissions.
6381
- `Deployment`: define how the Operator's operand is run in pods.

0 commit comments

Comments
 (0)