Skip to content

Commit 580c36f

Browse files
committedFeb 15, 2021
docs/design: Remove all references to the bundle alpha opm commands
Signed-off-by: timflannagan <[email protected]>
1 parent 12de30e commit 580c36f

File tree

1 file changed

+0
-165
lines changed

1 file changed

+0
-165
lines changed
 

‎docs/design/operator-bundle.md

-165
Original file line numberDiff line numberDiff line change
@@ -131,168 +131,3 @@ make build
131131
```
132132

133133
Now, a binary named `opm` is now built in current directory and ready to be used.
134-
135-
### Generating Bundle Annotations and DockerFile
136-
137-
*Notes:*
138-
139-
* If there are `annotations.yaml` and `Dockerfile` existing in the directory, they will be overwritten.
140-
141-
Using `opm` CLI, bundle annotations can be generated from provided operator manifests. The overall `bundle generate` command usage is:
142-
143-
```bash
144-
Usage:
145-
opm alpha bundle generate [flags]
146-
147-
Flags:
148-
-c, --channels string The list of channels that bundle image belongs to
149-
-e, --default string The default channel for the bundle image
150-
-d, --directory string The directory where bundle manifests for a specific version are located.
151-
-h, --help help for generate
152-
-u, --output-dir string Optional output directory for operator manifests
153-
-p, --package string The name of the package that bundle image belongs to
154-
155-
Note:
156-
* All manifests yaml must be in the same directory.
157-
```
158-
159-
The `--directory/-d`, `--channels/-c`, `--package/-p` are required flags while `--default/-e` and `--output-dir/-u` are optional.
160-
161-
The command for `generate` task is:
162-
163-
```bash
164-
$ ./opm alpha bundle generate --directory /test --package test-operator \
165-
--channels stable,beta --default stable
166-
```
167-
168-
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:
216-
217-
```bash
218-
docker build -f /path/to/Dockerfile -t quay.io/test/test-operator:latest /path/to/manifests/
219-
```
220-
221-
### Build Bundle Image
222-
223-
An operator bundle image can be built from the provided operator manifests using the `build` command (see *Notes* below).
224-
225-
The overall `bundle build` command usage is:
226-
227-
```bash
228-
Usage:
229-
opm alpha bundle build [flags]
230-
231-
Flags:
232-
-c, --channels string The list of channels that bundle image belongs to
233-
-e, --default string The default channel for the bundle image
234-
-d, --directory string The directory where bundle manifests for a specific version are located
235-
-h, --help help for build
236-
-b, --image-builder string Tool to build container images. One of: [docker, podman, buildah] (default "docker")
237-
-u, --output-dir string Optional output directory for operator manifests
238-
-0, --overwrite To overwrite annotations.yaml if existing
239-
-p, --package string The name of the package that bundle image belongs to
240-
-t, --tag string The name of the bundle image will be built
241-
242-
Note:
243-
* Bundle image is not runnable.
244-
* All manifests yaml must be in the same directory.
245-
```
246-
247-
The command for the `build` task is:
248-
249-
```bash
250-
$ ./opm alpha bundle build --directory /test --tag quay.io/coreos/test-operator.v0.1.0:latest \
251-
--package test-operator --channels stable,beta --default stable
252-
```
253-
254-
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:
257-
258-
```bash
259-
$ ./opm alpha bundle build --directory /test/0.1.0/ \
260-
--tag quay.io/coreos/test-operator.v0.1.0:latest \
261-
--image-builder podman --package test-operator \
262-
--channels stable,beta --default stable
263-
```
264-
265-
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")
283-
-h, --help help for build
284-
```
285-
286-
The command for `validate` task is:
287-
288-
```bash
289-
./opm alpha bundle validate --tag quay.io/coreos/test-operator.v0.1.0:latest --image-builder docker
290-
```
291-
292-
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

Comments
 (0)
Please sign in to comment.