Skip to content

Commit 2b5404a

Browse files
committedNov 18, 2019
Clarify the directory requirement in docs and help menu
Signed-off-by: Vu Dinh <[email protected]>
1 parent 2b44913 commit 2b5404a

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed
 

‎cmd/opm/alpha/bundle/build.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func newBundleBuildCmd() *cobra.Command {
2323
Short: "Build operator bundle image",
2424
Long: `The "opm alpha bundle build" command will generate operator
2525
bundle metadata if needed and build bundle image with operator manifest
26-
and metadata.
26+
and metadata for a specific version.
2727
2828
For example: The command will generate annotations.yaml metadata plus
2929
Dockerfile for bundle image and then build a container image from
@@ -33,15 +33,17 @@ func newBundleBuildCmd() *cobra.Command {
3333
After the build process is completed, a container image would be built
3434
locally in docker and available to push to a container registry.
3535
36-
$ opm alpha bundle build --directory /test/ --tag quay.io/example/operator:v0.1.0 \
36+
$ opm alpha bundle build --directory /test/0.1.0/ --tag quay.io/example/operator:v0.1.0 \
3737
--package test-operator --channels stable,beta --default stable --overwrite
3838
39-
Note: Bundle image is not runnable.
39+
Note:
40+
* Bundle image is not runnable.
41+
* All manifests yaml must be in the same directory.
4042
`,
4143
RunE: buildFunc,
4244
}
4345

44-
bundleBuildCmd.Flags().StringVarP(&dirBuildArgs, "directory", "d", "", "The directory where bundle manifests and metadata are located")
46+
bundleBuildCmd.Flags().StringVarP(&dirBuildArgs, "directory", "d", "", "The directory where bundle manifests and metadata for a specific version are located")
4547
if err := bundleBuildCmd.MarkFlagRequired("directory"); err != nil {
4648
log.Fatalf("Failed to mark `directory` flag for `build` subcommand as required")
4749
}

‎cmd/opm/alpha/bundle/generate.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ func newBundleGenerateCmd() *cobra.Command {
1515
Long: `The "opm alpha bundle generate" command will generate operator
1616
bundle metadata if needed and a Dockerfile to build Operator bundle image.
1717
18-
$ opm alpha bundle generate --directory /test/ --package test-operator \
18+
$ opm alpha bundle generate --directory /test/0.1.0/ --package test-operator \
1919
--channels stable,beta --default stable
20+
21+
Note:
22+
* All manifests yaml must be in the same directory.
2023
`,
2124
RunE: generateFunc,
2225
}
2326

24-
bundleGenerateCmd.Flags().StringVarP(&dirBuildArgs, "directory", "d", "", "The directory where bundle manifests are located.")
27+
bundleGenerateCmd.Flags().StringVarP(&dirBuildArgs, "directory", "d", "", "The directory where bundle manifests for a specific version are located.")
2528
if err := bundleGenerateCmd.MarkFlagRequired("directory"); err != nil {
2629
log.Fatalf("Failed to mark `directory` flag for `generate` subcommand as required")
2730
}

‎docs/design/operator-bundle.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ Usage:
129129
Flags:
130130
-c, --channels string The list of channels that bundle image belongs to
131131
-e, --default string The default channel for the bundle image
132-
-d, --directory string The directory where bundle manifests are located.
132+
-d, --directory string The directory where bundle manifests for a specific version are located.
133133
-h, --help help for generate
134134
-p, --package string The name of the package that bundle image belongs to
135+
136+
Note:
137+
* All manifests yaml must be in the same directory.
135138
```
136139

137140
The `--directory/-d`, `--channels/-c`, `--package/-p` are required flags while `--default/-e` is optional.
@@ -175,12 +178,16 @@ Usage:
175178
Flags:
176179
-c, --channels string The list of channels that bundle image belongs to
177180
-e, --default string The default channel for the bundle image
178-
-d, --directory string The directory where bundle manifests are located
181+
-d, --directory string The directory where bundle manifests for a specific version are located
179182
-h, --help help for build
180183
-b, --image-builder string Tool to build container images. One of: [docker, podman, buildah] (default "docker")
181184
-0, --overwrite To overwrite annotations.yaml if existing
182185
-p, --package string The name of the package that bundle image belongs to
183186
-t, --tag string The name of the bundle image will be built
187+
188+
Note:
189+
* Bundle image is not runnable.
190+
* All manifests yaml must be in the same directory.
184191
```
185192
186193
The command for `build` task is:
@@ -189,7 +196,7 @@ $ ./operator-sdk bundle build --directory /test --tag quay.io/coreos/test-operat
189196
--package test-operator --channels stable,beta --default stable
190197
```
191198
192-
The `--directory` or `-d` specifies the directory where the operator manifests are located. 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.
199+
The `--directory` or `-d` specifies the directory where the operator manifests for a specific version are located. 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.
193200
194201
The default image builder is `Docker`. However, ` Buildah` and `Podman` are also supported. An image builder can specified via `--image-builder` or `-b` optional tag in `build` command. For example:
195202
```bash

0 commit comments

Comments
 (0)
Please sign in to comment.