|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * operators/olm_v1/olmv1-plain-bundles.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | + |
| 7 | +[id="olmv1-adding-plain-bundle-to-fbc_{context}"] |
| 8 | += Adding a plain bundle to a file-based catalog |
| 9 | + |
| 10 | +The `opm render` command does not support adding plain bundles to catalogs. You must manually add plain bundles to your file-based catalog, as shown in the following procedure. |
| 11 | + |
| 12 | +.Procedure |
| 13 | + |
| 14 | +. Verify that the `index.json` or `index.yaml` file for your catalog is similar to the following example: |
| 15 | ++ |
| 16 | +.Example `<catalog_dir>/index.json` file |
| 17 | +[source,json] |
| 18 | +---- |
| 19 | +{ |
| 20 | + { |
| 21 | + "schema": "olm.package", |
| 22 | + "name": "<extension_name>", |
| 23 | + "defaultChannel": "" |
| 24 | + } |
| 25 | +} |
| 26 | +---- |
| 27 | + |
| 28 | +. To create an `olm.bundle` blob, edit your `index.json` or `index.yaml` file, similar to the following example: |
| 29 | ++ |
| 30 | +.Example `<catalog_dir>/index.json` file with `olm.bundle` blob |
| 31 | +[source,json] |
| 32 | +---- |
| 33 | +{ |
| 34 | + "schema": "olm.bundle", |
| 35 | + "name": "<extension_name>.v<version>", |
| 36 | + "package": "<extension_name>", |
| 37 | + "image": "quay.io/<organization_name>/<repository_name>:<image_tag>", |
| 38 | + "properties": [ |
| 39 | + { |
| 40 | + "type": "olm.package", |
| 41 | + "value": { |
| 42 | + "packageName": "<extension_name>", |
| 43 | + "version": "<bundle_version>" |
| 44 | + } |
| 45 | + }, |
| 46 | + { |
| 47 | + "type": "olm.bundle.mediatype", |
| 48 | + "value": "plain+v0" |
| 49 | + } |
| 50 | + ] |
| 51 | +} |
| 52 | +---- |
| 53 | + |
| 54 | +. To create an `olm.channel` blob, edit your `index.json` or `index.yaml` file, similar to the following example: |
| 55 | ++ |
| 56 | +.Example `<catalog_dir>/index.json` file with `olm.channel` blob |
| 57 | +[source,json] |
| 58 | +---- |
| 59 | +{ |
| 60 | + "schema": "olm.channel", |
| 61 | + "name": "<desired_channel_name>", |
| 62 | + "package": "<extension_name>", |
| 63 | + "entries": [ |
| 64 | + { |
| 65 | + "name": "<extension_name>.v<version>" |
| 66 | + } |
| 67 | + ] |
| 68 | +} |
| 69 | +---- |
| 70 | + |
| 71 | +// Please refer to [channel naming conventions](https://olm.operatorframework.io/docs/best-practices/channel-naming/) for choosing the <desired_channel_name>. An example of the <desired_channel_name> is `candidate-v0`. |
| 72 | + |
| 73 | +.Verification |
| 74 | + |
| 75 | +. Open your `index.json` or `index.yaml` file and ensure it is similar to the following example: |
| 76 | ++ |
| 77 | +.Example `<catalog_dir>/index.json` file |
| 78 | +[source,json] |
| 79 | +---- |
| 80 | +{ |
| 81 | + "schema": "olm.package", |
| 82 | + "name": "example-extension", |
| 83 | + "defaultChannel": "preview" |
| 84 | +} |
| 85 | +{ |
| 86 | + "schema": "olm.bundle", |
| 87 | + "name": "example-extension.v0.0.1", |
| 88 | + "package": "example-extension", |
| 89 | + "image": "quay.io/example-org/example-extension-bundle:v0.0.1", |
| 90 | + "properties": [ |
| 91 | + { |
| 92 | + "type": "olm.package", |
| 93 | + "value": { |
| 94 | + "packageName": "example-extension", |
| 95 | + "version": "0.0.1" |
| 96 | + } |
| 97 | + }, |
| 98 | + { |
| 99 | + "type": "olm.bundle.mediatype", |
| 100 | + "value": "plain+v0" |
| 101 | + } |
| 102 | + ] |
| 103 | +} |
| 104 | +{ |
| 105 | + "schema": "olm.channel", |
| 106 | + "name": "preview", |
| 107 | + "package": "example-extension", |
| 108 | + "entries": [ |
| 109 | + { |
| 110 | + "name": "example-extension.v0.0.1" |
| 111 | + } |
| 112 | + ] |
| 113 | +} |
| 114 | +---- |
| 115 | + |
| 116 | +. Validate your catalog by running the following command: |
| 117 | ++ |
| 118 | +[source,terminal] |
| 119 | +---- |
| 120 | +$ opm validate <catalog_dir> |
| 121 | +---- |
0 commit comments