-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDCICD-1337: custom task to generate an olm bundle
Add a new custom task to generate the OLM bundle from the provided input directory. This generates the on-disk representation of an operator (a bundle) including the CSV, CRDs, manifests, additional metadata and the Dockerfile to be built. Once built, it can be submitted to a catalog and deployed to a cluster. ``` operator-sdk generate bundle \ --overwrite \ --version 4.16.265-f15333d \ --input-dir deploy/ \ --package osd-example-operator-bundle ``` This is different from the traditional flow of an operator where the bundle metadata and manifests are stored somewhere to be built from or actively generated on new versions. SRE-P operators do not actively version their operators or maintain an upgrade graph so this allows dynamically generating a bundle at build time based on the current state of the repository. Signed-off-by: Brady Pratt <[email protected]>
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# operator-sdk-generate-bundle task | ||
|
||
Generate an OLM bundle using the operator-sdk | ||
|
||
## Parameters | ||
|name|description|default value|required| | ||
|---|---|---|---| | ||
|input-dir|Directory to read cluster-ready operator manifests from|deploy|false| | ||
|channels|Comma-separated list of channels the bundle belongs to|alpha|false| | ||
|version|Semantic version of the operator in the generated bundle||true| | ||
|package-name|Bundle's package name||true| | ||
|
||
## Workspaces | ||
|name|description|optional| | ||
|---|---|---| | ||
|source|Workspace with the source code|false| |
37 changes: 37 additions & 0 deletions
37
task/operator-sdk-generate-bundle/0.1/operator-sdk-generate-bundle.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: operator-sdk-generate-bundle | ||
spec: | ||
description: Generate an OLM bundle using the operator-sdk | ||
params: | ||
- name: input-dir | ||
description: Directory to read cluster-ready operator manifests from | ||
default: deploy | ||
- name: channels | ||
description: Comma-separated list of channels the bundle belongs to | ||
default: alpha | ||
- name: version | ||
description: Semantic version of the operator in the generated bundle | ||
- name: package-name | ||
description: Bundle's package name | ||
workspaces: | ||
- name: source | ||
description: Workspace with the source code | ||
steps: | ||
- name: operator-sdk-generate-bundle | ||
image: "registry.redhat.io/openshift4/ose-operator-sdk-rhel9:v4.16" | ||
workingDir: $(workspaces.source.path)/source | ||
args: | ||
- generate | ||
- bundle | ||
- --overwrite | ||
- --channels | ||
- $(params.channels) | ||
- --input-dir | ||
- $(params.input-dir) | ||
- --version | ||
- $(params.version) | ||
- --package | ||
- $(params.package-name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
approvers: | ||
- jbpratt | ||
- gurnben | ||
reviewers: | ||
- jbpratt | ||
- gurnben |