-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doc: FBC one step process documentation
The documentation covers a process for releasing FBC bundles with single step. A couple of new files and modification of existing are now described in the doc that are required for the ones step. JIRA: ISV-5508 Signed-off-by: Ales Raszka <[email protected]>
- Loading branch information
Showing
9 changed files
with
172 additions
and
23 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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,69 @@ | ||
# File-Based Catalog - auto-release | ||
By the nature of the File-Based Catalog (FBC) mode, the release of operator is made of two steps. | ||
* The first step builds, test and release bundle image | ||
* The second step adds a bundle to OCP catalog and releases it | ||
|
||
The second step can be now automated and user is no longer required to manually create a | ||
second PR with catalog changes. The release pipeline will take care of it. | ||
|
||
The process will require an additional configuration in the `release-config.yaml` file. | ||
Once a PR with new bundle and `release-config.yaml` is merged, the release pipeline will | ||
open a new PR with catalog changes. | ||
|
||
Example of such PR can be found [here](https://github.com/Allda/community-operators-pipeline-preprod/pull/20). | ||
The second PR is linked with it original PR and looks like [this](https://github.com/Allda/community-operators-pipeline-preprod/pull/25): | ||
|
||
![Release info](../img/fbc-auto-release-pr.png) | ||
|
||
## release-config.yaml | ||
|
||
If you want your operators to be automatically released to the OCP catalogs in the FBC mode, | ||
you will need to configure the `release-config.yaml` file. The file should be placed | ||
into the bundle version directory, e.g. `operators/aqua/0.0.2/release-config.yaml`. | ||
|
||
``` | ||
tree operators/aqua | ||
. | ||
├── 0.0.2 | ||
│ ├── release-config.yaml # This is the file | ||
│ ├── manifests | ||
│ └── metadata | ||
├── catalog-templates | ||
├── ci.yaml | ||
└── Makefile | ||
``` | ||
Its content determines where exactly the bundle will be released in terms of | ||
the OCP version and the place in the update graph. | ||
|
||
### Example | ||
|
||
```yaml | ||
--- | ||
catalog_templates: | ||
- template_name: basic.yaml | ||
channels: [my-channel] | ||
replaces: aqua.0.0.1 | ||
- template_name: semver.yaml | ||
channels: [Fast, Stable] | ||
``` | ||
The example above shows a release configuration where operator bundle is going to be | ||
released to the `my-channel` channel in the `basic.yaml` catalog template and to the | ||
`Fast` and `Stable` channels in the `semver.yaml` catalog template. | ||
|
||
The `replaces` field is optional and it specifies the bundle that the new bundle | ||
replaces in the update graph. | ||
|
||
### File structure | ||
The schema of the file is available here: [release-config.yaml schema](https://github.com/redhat-openshift-ecosystem/operator-pipelines/blob/main/operator-pipeline-images/operatorcert/schemas/release-config-schema.json). | ||
The schema is validated automatically in the pipeline and the PR will fail with explanations if the file is not valid. | ||
|
||
Here is a summary of the file structure: | ||
|
||
* The top-level key is `catalog_templates` which is a list of objects. | ||
* Each object has the following keys: | ||
* `template_name` - the name of the catalog template file in the `catalog-templates` directory. | ||
* `channels` - a list of channels where the bundle should be released. | ||
* In case of using `SemVer` a user can pick from allowed values: `Fast`, `Stable` and `Candidate`. | ||
* `replaces` - the bundle that the new bundle replaces in the update graph. (**Optional**, only for the basic templates) | ||
* `skips` - a list of bundles that should be skipped in the update graph. (**Optional**, only for the basic templates) | ||
* `skipRange` - a range of bundles that should be skipped in the update graph. (**Optional**, only for the basic templates) |
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
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 |
---|---|---|
|
@@ -52,15 +52,15 @@ The test is based on `operator-sdk bundle validate` command with `name=operatorh | |
The test is based on `operator-sdk bundle validate` command with `suite=operatorframework` test suite [(link)](https://sdk.operatorframework.io/docs/cli/operator-sdk_bundle_validate/#operator-sdk-bundle-validate). | ||
|
||
#### check_required_fields | ||
| Field name | Validation | Description | | ||
|------------|------------|------| | ||
| `spec.displayName` | `.{3,50}` | A string with 3 - 50 characters | | ||
| `spec.description` | `.{20,}` | A bundle description with at least 20 characters | | ||
| `spec.icon` | `media` | A valid base64 content with a supported media type (`{"base64data": <b64 content>, "mediatype": enum["image/png", "image/jpeg", "image/gif", "image/svg+xml"]}`) | | ||
| `spec.version` | `SemVer` | Valid semantic version | | ||
| `spec.maintainers` | | At least 1 maintainer contacts. Example: `{"name": "User 123", "email": "[email protected]"}` | | ||
| `spec.provider.name` | `.{3,}` | A string with at least 3 characters | | ||
| `spec.links` | | At least 1 link. Example: `{"name": "Documentation", "url": "https://redhat.com"}` | | ||
| Field name | Validation | Description | | ||
| -------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `spec.displayName` | `.{3,50}` | A string with 3 - 50 characters | | ||
| `spec.description` | `.{20,}` | A bundle description with at least 20 characters | | ||
| `spec.icon` | `media` | A valid base64 content with a supported media type (`{"base64data": <b64 content>, "mediatype": enum["image/png", "image/jpeg", "image/gif", "image/svg+xml"]}`) | | ||
| `spec.version` | `SemVer` | Valid semantic version | | ||
| `spec.maintainers` | | At least 1 maintainer contacts. Example: `{"name": "User 123", "email": "[email protected]"}` | | ||
| `spec.provider.name` | `.{3,}` | A string with at least 3 characters | | ||
| `spec.links` | | At least 1 link. Example: `{"name": "Documentation", "url": "https://redhat.com"}` | | ||
|
||
#### check_dangling_bundles | ||
The test prevents from releasing an operator and keeping any previous bundle dangling. | ||
|
@@ -133,6 +133,10 @@ This check will ensure that all bundle images in the file based catalog for give | |
operator catalog(s) use allowed image registry. Allowed registries are configured | ||
in `(repo_root)/config.yaml` under the key `allowed_bundle_registries`. | ||
|
||
#### check_schema_bundle_release_config | ||
The test validates the `release-config.yaml` file against the schema. The schema | ||
the file including the schema is described [here](./fcb_autorelease.md#release-configyaml) | ||
|
||
## Running tests locally | ||
|
||
```bash | ||
|
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