Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
f7abddb
WIP script to generate catalog-template.yaml
kurlov Jul 1, 2025
9077e29
Drop previous approach
kurlov Jul 7, 2025
7f45122
Remove redundant bash script
kurlov Jul 7, 2025
fb74d4e
Improve
kurlov Jul 8, 2025
67f98d8
Fix generation bugs
kurlov Jul 8, 2025
da2882f
Use latest yaml library
kurlov Jul 9, 2025
52ecdd5
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 9, 2025
cacdf62
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 9, 2025
742e929
Drop unused structs and rename existing
kurlov Jul 9, 2025
9f7710d
Simplify file writting
kurlov Jul 9, 2025
38543b2
use semver library instead
kurlov Jul 9, 2025
d8a4da6
Add tests
kurlov Jul 9, 2025
09226f7
Add additional comment and replace original catalog-temlate
kurlov Jul 10, 2025
f76395d
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 14, 2025
b057e1a
Move files and address review comments
kurlov Jul 15, 2025
9a6e92f
Use Parse for validating image reference
kurlov Jul 15, 2025
237dbe6
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 15, 2025
31a607a
Rollback catalog-template
kurlov Jul 22, 2025
a1e067b
Add 4.7.5
kurlov Jul 22, 2025
af2bfe4
Change adding skips, channel entries and refactor channel entry creation
kurlov Jul 22, 2025
2b59601
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 22, 2025
b918400
Update catalogs
kurlov Jul 22, 2025
d0e2db7
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 22, 2025
4f95a47
Update input format and use latest catalog teplate
kurlov Jul 29, 2025
2dc269d
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 29, 2025
01fb9df
Add vscode settings to gitignore
kurlov Jul 29, 2025
5433ddb
Use input for broken versions and bundle deprecations
kurlov Jul 29, 2025
5463281
Update catalogs
kurlov Jul 29, 2025
7e3075b
Fail if bundle images are not sorted in ascending order
kurlov Jul 29, 2025
91c80bd
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Jul 29, 2025
14143c7
Apply suggestions from code review
kurlov Jul 30, 2025
6aef397
Move types
kurlov Jul 31, 2025
2d03d0e
Fix go.mod structure
kurlov Jul 31, 2025
d8f5f8a
Add 4.6.8 version
kurlov Jul 31, 2025
38b5248
Update catalogs
kurlov Jul 31, 2025
f510eb5
Fix latest channel duplication
kurlov Jul 31, 2025
04dabf1
Update catalogs
kurlov Jul 31, 2025
4654434
Add command for running the script
kurlov Aug 4, 2025
37c5f66
Add CI checks
kurlov Aug 4, 2025
b73cd41
Update tests
kurlov Aug 4, 2025
3099d33
Review comments
kurlov Aug 4, 2025
7996361
Create channel for 3.63
kurlov Aug 4, 2025
68d7e59
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Aug 4, 2025
bae55c6
Update catalog-template.yaml perms
kurlov Aug 4, 2025
4306cef
Update catalogs
kurlov Aug 4, 2025
39fb840
Add CI catalog-tempalte.yaml permissions
kurlov Aug 4, 2025
dad7c44
Remove the out file to handle permission issues
kurlov Aug 4, 2025
e456fd1
Drop the output file before writting
kurlov Aug 4, 2025
52d7c72
Move catalog-template.yaml to folder
kurlov Aug 4, 2025
d1e10cb
Use another image
kurlov Aug 4, 2025
a33aae2
Use another image
kurlov Aug 4, 2025
c7d4021
Use another image
kurlov Aug 4, 2025
550db6b
use go-toolset image
kurlov Aug 4, 2025
9b027c6
Change workdir
kurlov Aug 4, 2025
482a2aa
Change workdir
kurlov Aug 4, 2025
149a3a3
Change workdir
kurlov Aug 4, 2025
2dbd845
Fix perms
kurlov Aug 4, 2025
06b92a8
move catalog-template to root
kurlov Aug 4, 2025
0335a94
Configre CI for unittests
kurlov Aug 4, 2025
238c4fc
Run push unit test only for master
kurlov Aug 4, 2025
66b89ed
Apply suggestions from code review
kurlov Aug 6, 2025
263f30c
Update cmd/generate-catalog/generate.go
kurlov Aug 6, 2025
4262df9
Fix
kurlov Aug 6, 2025
3bf1197
Merge branch 'akurlov/add-catalog-generation-from-folder-structure' o…
kurlov Aug 6, 2025
5658181
Review comments
kurlov Aug 6, 2025
0163cab
Update deprecation messages
kurlov Aug 6, 2025
b0b9d59
Add separte message for broken versions
kurlov Aug 6, 2025
5c8758c
Review comment
kurlov Aug 6, 2025
cf68c40
Change channel deprecation
kurlov Aug 6, 2025
a7021af
Apply suggestions from code review
kurlov Aug 6, 2025
c3cf3c2
Add constants for 3.62.0 and 4.0.0
kurlov Aug 6, 2025
0adc804
Update CI
kurlov Aug 6, 2025
b94b2bd
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Aug 6, 2025
931e23f
Move catalog-template generation to check files up-to-date
kurlov Aug 6, 2025
9c2178a
Add a separate step for checkking catalog-template
kurlov Aug 6, 2025
95500b4
Update catalogs and remove github actions
kurlov Aug 6, 2025
1fa69e6
Remove redundant pipelinerun
kurlov Aug 6, 2025
383e2e4
Update README.md
kurlov Aug 6, 2025
439b924
Update Makefile
kurlov Aug 7, 2025
38a53cc
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Aug 7, 2025
5d93cd5
Add .go files dependency to catalog-template.yaml command
kurlov Aug 7, 2025
ff0f25d
Move go unit tests to a separate task
kurlov Aug 7, 2025
efcf1a0
Add use-trusted-artifact
kurlov Aug 7, 2025
0d4605f
Fix CI
kurlov Aug 7, 2025
bd6fff8
Update cmd/generate-catalog/generate.go
kurlov Aug 7, 2025
e2c5449
Update CI
kurlov Aug 7, 2025
0eb9e54
Add variable for generate-catalog folder
kurlov Aug 7, 2025
f98da74
Add variable for generate-catalog folder
kurlov Aug 7, 2025
8be8c44
Update catalogs
kurlov Aug 7, 2025
9f2cb4c
Update deprecation messages
kurlov Aug 7, 2025
4455902
Apply suggestions from code review
kurlov Aug 8, 2025
b9b9f3c
Review comments
kurlov Aug 11, 2025
178bd76
Update docs for oldest supported version
kurlov Aug 12, 2025
211a321
Update catalogs
kurlov Aug 12, 2025
6239203
Add tests for reading input file
kurlov Aug 12, 2025
6dfcb9e
Rework channel generation
kurlov Aug 12, 2025
ca7b4bd
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Aug 12, 2025
bc87179
Apply suggestions from code review
kurlov Aug 18, 2025
9c152fb
Fix README
kurlov Aug 18, 2025
265043e
Change head comment
kurlov Aug 18, 2025
b7ad9b5
Add end line space
kurlov Aug 18, 2025
f9d49e7
Merge branch 'akurlov/add-catalog-generation-from-folder-structure' o…
kurlov Aug 18, 2025
4454f14
Review comments
kurlov Aug 18, 2025
08deccb
Apply suggestions from code review
kurlov Aug 19, 2025
259c9ce
Review comments
kurlov Aug 19, 2025
b9850bf
Use StrictNewVersion
kurlov Aug 19, 2025
87ba005
Drop redundant patch == 0
kurlov Aug 19, 2025
fbe2c74
Resolve conflicts
kurlov Aug 20, 2025
9930683
Review comments
kurlov Aug 21, 2025
44a2530
Add TODO
kurlov Aug 21, 2025
d5b08cb
Update catalogs
kurlov Aug 21, 2025
cc03d50
Add brokenVersionSkippingOffset constant
kurlov Aug 21, 2025
4ae9576
Apply suggestions from code review
kurlov Aug 21, 2025
5c47c24
Fix compiling
kurlov Aug 21, 2025
c7673cb
Review comments
kurlov Aug 21, 2025
aaa6b2f
Review comments
kurlov Aug 21, 2025
0aff37c
Fix newline
kurlov Aug 28, 2025
c1c9931
Add 4.8.3 and 4.8.4
kurlov Sep 16, 2025
70d38c4
Change image reference validation
kurlov Sep 17, 2025
99fbb14
Fix uunittest
kurlov Sep 17, 2025
7a32153
Resolve conflicts
kurlov Sep 17, 2025
aaea20f
Move getAllVersions
kurlov Nov 27, 2025
266d39b
Change module name
kurlov Nov 27, 2025
644700f
Use reference for image reference validation
kurlov Nov 27, 2025
4003579
Move consts
kurlov Nov 28, 2025
6d872ff
Add 4.7.7 4.7.8 versions
kurlov Nov 28, 2025
470cf26
Fix flack (map order checking)
kurlov Nov 30, 2025
b64c4bb
Add graph root structure
kurlov Nov 30, 2025
152ad5c
Simplify ChannelEntry generation and move logic to generation.go
kurlov Nov 30, 2025
a617e37
Drop BrokenVersions and Skips
kurlov Dec 1, 2025
aad2532
Update catalogs
kurlov Dec 1, 2025
e6bd657
Bump dep versions
kurlov Dec 2, 2025
fc1a42c
Renames
kurlov Dec 2, 2025
0959f92
Renames and fix image validation
kurlov Dec 2, 2025
b36fa99
Fix tests and add TestPopulateChannels for 5.x.x versions
kurlov Dec 2, 2025
bf5fbcd
Update go mod
kurlov Dec 2, 2025
e6bf9f7
Add 4.8.5 4.8.6 4.9.0 4.9.1 versions
kurlov Dec 2, 2025
c908659
Bump go-tool image
kurlov Dec 2, 2025
3341c8d
Rename to ChannelLineage and drop pointers
kurlov Dec 2, 2025
8b02a70
Move channel generation to a separate block and rename empty channel …
kurlov Dec 3, 2025
cd11803
Move Replace clearing for the first version to assignChannelEntries
kurlov Dec 3, 2025
b85cd53
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Dec 3, 2025
18fc851
Add 4.6.10 version
kurlov Dec 3, 2025
6c08665
Rename root comment with channel lineage
kurlov Dec 4, 2025
b154fe1
Add clearReplacesForStartingEntries func
kurlov Dec 4, 2025
2204f53
Simplify TestGenerateChannelEntries and TestGenerateDeprecations tests
kurlov Dec 4, 2025
a74717b
Suggest reorderings and comment improvements (#278)
msugakov Dec 4, 2025
1ff5e9c
Rename adjustStartingEntries
kurlov Dec 5, 2025
6a1209c
Improve tests
kurlov Dec 5, 2025
1f3b7ce
Apply suggestions from code review
kurlov Dec 5, 2025
ccf632e
Update expected changed files and rerun link
kurlov Dec 5, 2025
b801eb3
Set oldest support version to 4.7.0
kurlov Dec 5, 2025
fc2b940
Apply suggestions from code review
kurlov Dec 5, 2025
b840e67
Add test helper functions and simplify tests
kurlov Dec 5, 2025
8bf46e1
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Dec 5, 2025
133d893
Remove `t` arguments (#279)
msugakov Dec 5, 2025
5b1da7c
Update cmd/generate-catalog/generate_test.go
kurlov Dec 5, 2025
4fa1aac
Add regexp for channel ystream version check
kurlov Dec 5, 2025
881b4ce
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Dec 5, 2025
b08d244
Merge branch 'master' into akurlov/add-catalog-generation-from-folder…
kurlov Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Leftover staging directory for importing legacy catalog. Can be safely deleted
/catalog-migrate/

# Ignore VS code local settings
.vscode
8 changes: 3 additions & 5 deletions .tekton/check-generated-files-up-to-date-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ spec:
- use
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
- name: check-generated-files-up-to-date
image: registry.access.redhat.com/ubi9:latest@sha256:d4feb579a84ead49894ec71fe54f14300992e202f3491d9bb22b62cc57affd49
image: registry.redhat.io/ubi9/go-toolset@sha256:2e8adc5be8eba060e919a6f7309a7b5ef09dd72d3ae9e747b9eb02e96f35a0f5
workingDir: /var/workdir/source
securityContext:
runAsUser: 0
script: |
#!/usr/bin/env bash
set -euo pipefail
set -x

time dnf -y upgrade --nobest
# TODO: find an image with these preinstalled to reduce flakiness
time dnf -y install git make jq

time make clean
cmd="make valid-catalogs"
time $cmd
Expand Down
22 changes: 22 additions & 0 deletions .tekton/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,28 @@ spec:
- name: basic-auth
workspace: git-auth

- name: run-go-unit-tests
taskSpec:
metadata:
name: run-go-unit-tests
volumes:
- name: workdir
emptyDir: { }
stepTemplate:
volumeMounts:
- mountPath: /var/workdir
name: workdir
steps:
- name: use-trusted-artifact
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:9b180776a41d9a22a1c51539f1647c60defbbd55b44bbebdd4130e33512d8b0d
args:
- use
- $(tasks.clone-repository.results.SOURCE_ARTIFACT)=/var/workdir/source
- name: run-go-tests
image: registry.redhat.io/ubi9/go-toolset@sha256:3ce6311380d5180599a3016031a9112542d43715244816d1d0eabc937952667b
workingDir: /var/workdir/source
script: time make go-test

- name: check-generated-files-up-to-date
params:
- name: SOURCE_ARTIFACT
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ MAKEFLAGS += "-j 2"

OPM = .bin/opm-$(OPM_VERSION)

GO := go

GENERATE_SCRIPT_FOLDER = ./cmd/generate-catalog/

.PHONY: valid-catalogs
valid-catalogs: $(CATALOGS) $(OPM)
$(OPM) validate catalog-bundle-object
$(OPM) validate catalog-csv-metadata

.PHONY: clean
clean:
rm -f catalog-template.yaml
rm -f $(CATALOGS)
rm -rf $$(dirname $(OPM))

Expand All @@ -24,6 +29,13 @@ catalog-csv-metadata/rhacs-operator/catalog.json: catalog-template.yaml $(OPM)
mkdir -p "$$(dirname "$@")"
$(OPM) alpha render-template basic --migrate-level bundle-object-to-csv-metadata $< > $@

# update template/catalog-template.yaml based on bundles.yaml file.
catalog-template.yaml: bundles.yaml $(wildcard $(GENERATE_SCRIPT_FOLDER)/*.go)
@$(GO) run $(GENERATE_SCRIPT_FOLDER)

go-test:
@$(GO) test -cover -v ./cmd/...

$(OPM):
mkdir -p "$$(dirname $@)"
os_name="$$(uname | tr '[:upper:]' '[:lower:]')"; \
Expand Down
102 changes: 18 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,96 +9,30 @@ OperatorHub.
### Restarting Konflux pipeline

If some pipeline failed, you can restart it by commenting in the PR `/test <pipeline-name>` (e.g. `/test operator-index-ocp-v4-16-on-push`).
See more in [our docs](https://spaces.redhat.com/display/StackRox/How+to+everything+Konflux+for+RHACS#HowtoeverythingKonfluxforRHACS-Howtore-runpipelines).
See more in [our docs](https://spaces.redhat.com/spaces/StackRox/pages/702155579/How+to+re-run+Konflux+pipelines).

### <a name="add-bundle"></a> Adding new ACS operator version

Do the following changes in the `catalog-template.yaml` file.

1. Add bundle image.
1. Find entries with `schema: olm.bundle` towards the end of the file.
2. Add a new entry for your bundle image.\
It should look something like this:
```yaml
- schema: olm.bundle
# 4.7.9
image: quay.io/rhacs-eng/release-operator-bundle@sha256:c82e8330c257e56eb43cb5fa7b0c842a7f7f0414e32e26a792ef36817cb5ca02
```
* Note that the image must be referenced by digest, not by tag.
* Keep entries sorted according to version.
* Add a comment stating the version, see how it's done for other items there.
* You may add bundle images from `quay.io`, `brew.registry.redhat.io` and so on (provided they exist and are
pullable) during development and/or when preparing to release.\
Ultimately, all released bundle images must come from
`registry.redhat.io/advanced-cluster-security/rhacs-operator-bundle` repo because this is where customers expect
to find them. There's a CI check which prevents pushing to `master` if there's any bundle from
a different repo.
2. Add entry to the `stable` channel.
1. Find the `stable` channel block. It starts with:
```yaml
- schema: olm.channel
name: stable
```
2. Add a new item into its `entries` list.
* Entries must be sorted by version (e.g., you must insert `4.8.2` after `4.8.1` but before `4.9.0`).
* Ensure there are consistent blank lines between entries of different Y-streams.
* Entry format is
```yaml
- &bundle-4-Y-Z
name: rhacs-operator.v4.Y.Z
replaces: rhacs-operator.v4.PREVIOUS_Y.PREVIOUS_Z
skipRange: '>= 4.(Y-1).0 < 4.Y.Z'
```
Replace
* `Y` with minor version (e.g., `8` in `4.8.2`),
* `Z` with patch version (e.g., `2` in `4.8.2`),
* `PREVIOUS_Y` and `PREVIOUS_Z` with minor and patch versions of the previous item (e.g., when you add `4.8.2`
after `4.8.1`, that'd be `8` and `1`; when you add `4.9.0` after `4.8.3`, that'd be `8` and `3`),
* `(Y-1)` with the value of `Y` minus 1 (e.g., when you add `4.8.2`, that'd be `7`).
3. If the item you added is not the last one in the `entries` list, i.e., not the highest version, adjust the next
item in the `entries` list.\
Set its `replaces:` to be `rhacs-operator.v4.Y.Z`.\
For example:
```yaml
- &bundle-4-7-4 # <-------- this was already there
name: rhacs-operator.v4.7.4
replaces: rhacs-operator.v4.7.3
skipRange: '>= 4.6.0 < 4.7.4'
- &bundle-4-7-5 # <-------- this one I'm adding
name: rhacs-operator.v4.7.5
replaces: rhacs-operator.v4.7.4
skipRange: '>= 4.6.0 < 4.7.5'

- &bundle-4-8-0 # <-------- this was already there
name: rhacs-operator.v4.8.0
replaces: rhacs-operator.v4.7.4 # <-------- must change here to rhacs-operator.v4.7.5
skipRange: '>= 4.7.0 < 4.8.0'
```
3. Add entry to `rhacs-4.?` channels.
* For every `schema: olm.channel` with `name` like `rhacs-4.?` where `?` is >= `Y`,
* add `- *bundle-4-Y-Z` to the `entries:` list (replacing `Y` and `Z` with minor and patch versions).
* Maintain the entries sorted and with consistent linebreaks.
4. Add `rhacs-4.Y` channel. Skip this step if the channel already exists (i.e., when `Z` > `0`).
* Keep the channels sorted.
* In the `entries:`, reference all items from `4.0.0` up to (and including) `4.Y.Z`.

It should look something like this (replacing `Y`, `Z` as appropriate):
1. Open `bundles.yaml` file.
2. Add a new operator bundle image with version. It would look like this:
```yaml
- schema: olm.channel
name: rhacs-4.Y
package: rhacs-operator
entries:
- *bundle-4-0-0
- *bundle-4-0-1
# ... and so on ...

- *bundle-4-Y-Z
- image: quay.io/rhacs-eng/release-operator-bundle@sha256:c82e8330c257e56eb43cb5fa7b0c842a7f7f0414e32e26a792ef36817cb5ca02
version: 4.7.9
```
* Note that the image must be referenced by digest, not by tag.
* Keep entries sorted by version.
* You may add bundle images from `quay.io`, `brew.registry.redhat.io` and so on (provided they exist and are pullable) during development and/or when preparing to release.
Ultimately, all released bundle images must come from
`registry.redhat.io/advanced-cluster-security/rhacs-operator-bundle` repo because this is where customers expect
to find them. There's a CI check which should make it impossible to push to `master` if there's any bundle from
a different repo.
3. Update `oldest_supported_version` value:
* Check `Life Cycle Dates` table in [Red Hat Advanced Cluster Security for Kubernetes Support Policy](https://access.redhat.com/support/policy/updates/rhacs).
* Set `oldest_supported_version` to be the oldest Y-Stream version still in support according to that table, including Maintenance Support. Patch number should always be `.0`. For example, if 4.6 is the oldest in support (maintenance phase), set `oldest_supported_version: 4.6.0`.
4. Update catalogs (follow [updating catalogs steps](#updating-catalogs))
5. Open a PR with `Add 4.Y.Z version` title.

Once done with `catalog-template.yaml`:

1. Update catalogs (follow [updating catalogs](#updating-catalogs) steps below).
2. Open a PR with `Add 4.Y.Z version` title.

### Updating catalogs

Expand All @@ -108,7 +42,7 @@ make clean && make valid-catalogs
```
Note: this will take a while.

If a new bundle was added then you should see that `catalog-bundle-object/rhacs-operator/catalog.json` and `catalog-csv-metadata/rhacs-operator/catalog.json` files are changed.
If a new bundle was added then you should see that `catalog-template.yaml`, `catalog-bundle-object/rhacs-operator/catalog.json` and `catalog-csv-metadata/rhacs-operator/catalog.json` files are changed.

#### Historical note

Expand Down
Loading