You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `--directory` or `-d` specifies the directory where the operator manifests, including CSVs and CRDs, are located. For example:
169
-
170
-
```bash
171
-
$ tree test
172
-
test
173
-
├── etcdcluster.crd.yaml
174
-
└── etcdoperator.clusterserviceversion.yaml
175
-
```
176
-
177
-
The `--package` or `-p` is the name of package of the operator such as `etcd`, which maps `channels` to a particular application definition. `channels` allow package authors to write different upgrade paths for different users (e.g. `beta` vs. `stable`). The `channels` list is provided via the `--channels` or `-c` flag. Multiple `channels` are separated by a comma (`,`). The default channel is provided optionally via `--default` or `-e` flag. If the default channel is not provided, the first channel in the list of channels is selected as the default.
178
-
179
-
**Note**: All information specified in `annotations.yaml` must also exist in the `LABEL` section of a `Dockerfile`.
180
-
181
-
After the generate command is executed, the `Dockerfile` is generated in the same directory where the command was run. By default, the `annotations.yaml` file is located in a folder named `metadata` in the same root directory as the input directory containing manifests.
182
-
183
-
For example:
184
-
185
-
```bash
186
-
$ tree test
187
-
test
188
-
├── my-manifests
189
-
│ ├── etcdcluster.crd.yaml
190
-
│ └── etcdoperator.clusterserviceversion.yaml
191
-
├── metadata
192
-
│ └── annotations.yaml
193
-
└── Dockerfile
194
-
```
195
-
196
-
If the `--output-dir` parameter is specified, that directory becomes the parent for a new pair of folders `manifests/` and `metadata/`, where `manifests/` is a copy of the passed in directory of manifests and `metadata/` is the folder containing the `annotations.yaml` file:
197
-
198
-
```bash
199
-
$ tree test
200
-
test
201
-
├── my-manifests
202
-
│ ├── etcdcluster.crd.yaml
203
-
│ └── etcdoperator.clusterserviceversion.yaml
204
-
├── my-output-manifest-dir
205
-
│ ├── manifests
206
-
│ │ ├── etcdoperator.clusterserviceversion.yaml
207
-
│ │ └── etcdoperator.clusterserviceversion.yaml
208
-
│ └── metadata
209
-
│ └── annotations.yaml
210
-
└── Dockerfile
211
-
```
212
-
213
-
The `Dockerfile` can be used manually to build the bundle image using various container image tooling such as Docker, Podman or Buildah.
214
-
215
-
The following example uses `docker` to build the bundle image:
The `--directory` or `-d` specifies the directory location that contains the manifests for a specific version of an operator. The `--tag` or `-t` specifies the image tag that you want the operator bundle image to have. By using `build` command, the `annotations.yaml` and `Dockerfile` are automatically generated in the background.
255
-
256
-
The default image builder is `Docker`. However, `Buildah` and `Podman` are also supported. An image builder can be specified via `--image-builder` or the optional `-b` tag in the `build` command. For example:
The `--package` or `-p` is the name of the package for the operator such as `etcd`, which maps `channels` to a particular application definition. Here, `channels` allow package authors to write different upgrade paths for different users (e.g. `beta` vs. `stable`). The `channels` list is provided via `--channels` or `-c` flag. Multiple `channels` are separated by a comma (`,`). The default channel is provided optionally via `--default` or `-e` flag.
266
-
267
-
*Notes:*
268
-
269
-
* If there is `Dockerfile` existing in the directory, it will be overwritten.
270
-
* If there is an existing `annotations.yaml` in `/metadata` directory, the cli will attempt to validate it and returns any found errors. If the ``annotations.yaml`` is valid, it will be used as a part of build process. The optional boolean `--overwrite/-o` flag can be enabled (false by default) to allow cli to overwrite the `annotations.yaml` if existed.
271
-
272
-
### Validate Bundle Image
273
-
274
-
Operator bundle image can validate bundle image that is publicly available in an image registry using `validate` command (see *Notes* below). The overall `bundle validate` command usage is:
275
-
276
-
```bash
277
-
Usage:
278
-
opm alpha bundle validate [flags]
279
-
280
-
Flags:
281
-
-t, --tag string The name of the bundle image will be built
282
-
-b, --image-builder string Tool to extract container images. One of: [docker, podman] (default "docker")
The `validate` command will first extract the content of the bundle image into a temporary directory after it pulls the image from its image registry. Then, it will validate the format of bundle image to ensure manifests and metadata are located in their appropriate directories (`/manifests/` for bundle manifests files such as CSV and `/metadata/` for metadata files such as `annotations.yaml`). Also, it will validate the information in `annotations.yaml` to confirm that metadata is matching the provided data. For example, the provided media type in annotations.yaml just matches the actual media type is provided in the bundle image.
293
-
294
-
After the bundle image format is confirmed, the command will validate the bundle contents such as manifests and metadata files if the bundle format is `RegistryV1` or "Plain" type. "RegistryV1" format means it contains `ClusterServiceVersion` and its associated Kubernetes objects while `PlainType` means it contains all Kubernetes objects. The content validation process will ensure the individual file in the bundle image is valid and can be applied to an OLM-enabled cluster provided all necessary permissions and configurations are met.
295
-
296
-
*Notes:*
297
-
298
-
* The bundle content validation is best effort which means it will not guarantee 100% accuracy due to nature of Kubernetes objects may need certain permissions and configurations, which users may not have, in order to be applied successfully in a cluster.
0 commit comments