Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalog default channel #872

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion .github/workflows/build-images-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ on:
description: Bundle and catalog channels, comma separated
default: preview
type: string
defaultChannel:
description: Bundle default channel
default: preview
type: string
quayImageExpiry:
description: When to expire the built quay images. The time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively, from the time the image is built.
default: never
Expand Down Expand Up @@ -73,6 +77,10 @@ on:
description: Bundle and catalog channels, comma separated
default: preview
type: string
defaultChannel:
description: Bundle default channel
default: preview
type: string
quayImageExpiry:
description: When to expire the built quay images. The time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively, from the time the image is built.
default: never
Expand Down Expand Up @@ -148,6 +156,7 @@ jobs:
DNS_OPERATOR_VERSION=${{ inputs.dnsOperatorVersion }} \
WASM_SHIM_VERSION=${{ inputs.wasmShimVersion }} \
REPLACES_VERSION=${{ inputs.replacesVersion }} \
DEFAULT_CHANNEL=${{ inputs.defaultChannel }} \
CHANNELS=${{ inputs.channels }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -196,7 +205,7 @@ jobs:
DNS_OPERATOR_VERSION=${{ inputs.dnsOperatorVersion }} \
WASM_SHIM_VERSION=${{ inputs.wasmShimVersion }} \
REPLACES_VERSION=${{ inputs.replacesVersion }} \
CHANNELS=${{ inputs.channels }}
DEFAULT_CHANNEL=${{ inputs.defaultChannel }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to container registry
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ VERSION ?= 0.0.0
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable)
# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable")
ifneq ($(origin CHANNELS), undefined)

CHANNELS ?= alpha
BUNDLE_CHANNELS := --channels=$(CHANNELS)
endif

# DEFAULT_CHANNEL defines the default channel used in the bundle.
# Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable")
Expand Down
40 changes: 24 additions & 16 deletions doc/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ bundle and a custom catalog including the custom bundle.

The `make bundle` target accepts the following variables:

| **Makefile Variable** | **Description** | **Default value** | **Notes** |
|---------------------------------|-------------------------------|-----------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `IMG` | Kuadrant operator image URL | `quay.io/kuadrant/kuadrant-operator:latest` | `TAG` var could be use to build this URL, defaults to _latest_ if not provided |
| `VERSION` | Bundle version | `0.0.0` | |
| `LIMITADOR_OPERATOR_BUNDLE_IMG` | Limitador operator bundle URL | `quay.io/kuadrant/limitador-operator-bundle:latest` | `LIMITADOR_OPERATOR_VERSION` var could be used to build this, defaults to _latest_ if not provided |
| `AUTHORINO_OPERATOR_BUNDLE_IMG` | Authorino operator bundle URL | `quay.io/kuadrant/authorino-operator-bundle:latest` | `AUTHORINO_OPERATOR_VERSION` var could be used to build this, defaults to _latest_ if not provided |
| `DNS_OPERATOR_BUNDLE_IMG` | DNS operator bundle URL | `quay.io/kuadrant/dns-operator-bundle:latest` | `DNS_OPERATOR_BUNDLE_IMG` var could be used to build this, defaults to _latest_ if not provided |
| `RELATED_IMAGE_WASMSHIM` | WASM shim image URL | `oci://quay.io/kuadrant/wasm-shim:latest` | `WASM_SHIM_VERSION` var could be used to build this, defaults to _latest_ if not provided |
| **Makefile Variable** | **Description** | **Default value** | **Notes** |
|---------------------------------|------------------------------------------------------|-----------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `IMG` | Kuadrant operator image URL | `quay.io/kuadrant/kuadrant-operator:latest` | `TAG` var could be use to build this URL, defaults to _latest_ if not provided |
| `VERSION` | Bundle version | `0.0.0` | |
| `LIMITADOR_OPERATOR_BUNDLE_IMG` | Limitador operator bundle URL | `quay.io/kuadrant/limitador-operator-bundle:latest` | `LIMITADOR_OPERATOR_VERSION` var could be used to build this, defaults to _latest_ if not provided |
| `AUTHORINO_OPERATOR_BUNDLE_IMG` | Authorino operator bundle URL | `quay.io/kuadrant/authorino-operator-bundle:latest` | `AUTHORINO_OPERATOR_VERSION` var could be used to build this, defaults to _latest_ if not provided |
| `DNS_OPERATOR_BUNDLE_IMG` | DNS operator bundle URL | `quay.io/kuadrant/dns-operator-bundle:latest` | `DNS_OPERATOR_BUNDLE_IMG` var could be used to build this, defaults to _latest_ if not provided |
| `RELATED_IMAGE_WASMSHIM` | WASM shim image URL | `oci://quay.io/kuadrant/wasm-shim:latest` | `WASM_SHIM_VERSION` var could be used to build this, defaults to _latest_ if not provided |
| `CHANNELS` | Bundle channels used in the bundle, comma separated | `alpha` | |
| `DEFAULT_CHANNEL` | The default channel used in the bundle | `alpha` | |

* Build the bundle manifests

Expand All @@ -129,7 +131,9 @@ make bundle [IMG=quay.io/kuadrant/kuadrant-operator:latest] \
[LIMITADOR_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:latest] \
[AUTHORINO_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/authorino-operator-bundle:latest] \
[DNS_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/dns-operator-bundle:latest] \
[RELATED_IMAGE_WASMSHIM=oci://quay.io/kuadrant/wasm-shim:latest]
[RELATED_IMAGE_WASMSHIM=oci://quay.io/kuadrant/wasm-shim:latest] \
[CHANNELS=alpha] \
[DEFAULT_CHANNEL=alpha]
```

* Build the bundle image from the manifests
Expand Down Expand Up @@ -179,18 +183,22 @@ Make sure all the required bundles are pushed to the registry. It is required by

The `make catalog` target accepts the following variables:

| **Makefile Variable** | **Description** | **Default value** |
|---------------------------------|------------------------------------|-----------------------------------------------------|
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
| `LIMITADOR_OPERATOR_BUNDLE_IMG` | Limitador operator bundle URL | `quay.io/kuadrant/limitador-operator-bundle:latest` |
| `AUTHORINO_OPERATOR_BUNDLE_IMG` | Authorino operator bundle URL | `quay.io/kuadrant/authorino-operator-bundle:latest` |
| `DNS_OPERATOR_BUNDLE_IMG` | DNS operator bundle URL | `quay.io/kuadrant/dns-operator-bundle:latest` |
| **Makefile Variable** | **Description** | **Default value** |
|---------------------------------|--------------------------------------------------------|-----------------------------------------------------|
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
| `LIMITADOR_OPERATOR_BUNDLE_IMG` | Limitador operator bundle URL | `quay.io/kuadrant/limitador-operator-bundle:latest` |
| `AUTHORINO_OPERATOR_BUNDLE_IMG` | Authorino operator bundle URL | `quay.io/kuadrant/authorino-operator-bundle:latest` |
| `DNS_OPERATOR_BUNDLE_IMG` | DNS operator bundle URL | `quay.io/kuadrant/dns-operator-bundle:latest` |
| `CHANNELS` | Bundle channels used in the bundle, comma separated | `alpha` |
| `DEFAULT_CHANNEL` | Catalog default channel | `alpha` |

```sh
make catalog [BUNDLE_IMG=quay.io/kuadrant/kuadrant-operator-bundle:latest] \
[LIMITADOR_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:latest] \
[AUTHORINO_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/authorino-operator-bundle:latest] \
[DNS_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/dns-operator-bundle:latest]
[DNS_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/dns-operator-bundle:latest] \
[CHANNELS=alpha] \
[DEFAULT_CHANNEL=alpha]
```

* Build the catalog image from the manifests
Expand Down
18 changes: 8 additions & 10 deletions make/catalog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,23 @@ $(CATALOG_DOCKERFILE): $(OPM)
cd $(PROJECT_PATH)/catalog && $(OPM) generate dockerfile kuadrant-operator-catalog -l quay.expires-after=$(QUAY_IMAGE_EXPIRY)
catalog-dockerfile: $(CATALOG_DOCKERFILE) ## Generate catalog dockerfile.

CHANNELS ?= preview

$(CATALOG_FILE): $(OPM) $(YQ)
@echo "************************************************************"
@echo Build kuadrant operator catalog
@echo
@echo BUNDLE_IMG = $(BUNDLE_IMG)
@echo REPLACES_VERSION = $(REPLACES_VERSION)
@echo LIMITADOR_OPERATOR_BUNDLE_IMG = $(LIMITADOR_OPERATOR_BUNDLE_IMG)
@echo AUTHORINO_OPERATOR_BUNDLE_IMG = $(AUTHORINO_OPERATOR_BUNDLE_IMG)
@echo DNS_OPERATOR_BUNDLE_IMG = $(DNS_OPERATOR_BUNDLE_IMG)
@echo CHANNELS = $(CHANNELS)
@echo CATALOG_FILE = $@
@echo BUNDLE_IMG = $(BUNDLE_IMG)
@echo REPLACES_VERSION = $(REPLACES_VERSION)
@echo LIMITADOR_OPERATOR_BUNDLE_IMG = $(LIMITADOR_OPERATOR_BUNDLE_IMG)
@echo AUTHORINO_OPERATOR_BUNDLE_IMG = $(AUTHORINO_OPERATOR_BUNDLE_IMG)
@echo DNS_OPERATOR_BUNDLE_IMG = $(DNS_OPERATOR_BUNDLE_IMG)
@echo CHANNEL = $(DEFAULT_CHANNEL)
@echo CATALOG_FILE = $@
@echo "************************************************************"
@echo
@echo Please check this matches your expectations and override variables if needed.
@echo
$(PROJECT_PATH)/utils/generate-catalog.sh $(OPM) $(YQ) $(BUNDLE_IMG) $(REPLACES_VERSION)\
$(LIMITADOR_OPERATOR_BUNDLE_IMG) $(AUTHORINO_OPERATOR_BUNDLE_IMG) $(DNS_OPERATOR_BUNDLE_IMG) $(CHANNELS) $@
$(LIMITADOR_OPERATOR_BUNDLE_IMG) $(AUTHORINO_OPERATOR_BUNDLE_IMG) $(DNS_OPERATOR_BUNDLE_IMG) $(DEFAULT_CHANNEL) $@

.PHONY: catalog
catalog: $(OPM) ## Generate catalog content and validate.
Expand Down
26 changes: 13 additions & 13 deletions utils/generate-catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ REPLACES_VERSION="${4?:Error \$REPLACES_VERSION not set. Bye}"
LIMITADOR_OPERATOR_BUNDLE_IMG="${5?:Error \$LIMITADOR_OPERATOR_BUNDLE_IMG not set. Bye}"
AUTHORINO_OPERATOR_BUNDLE_IMG="${6?:Error \$AUTHORINO_OPERATOR_BUNDLE_IMG not set. Bye}"
DNS_OPERATOR_BUNDLE_IMG="${7?:Error \$DNS_OPERATOR_BUNDLE_IMG not set. Bye}"
CHANNELS="${8?:Error \$CHANNELS not set. Bye}"
CHANNEL="${8?:Error \$CHANNEL not set. Bye}"
CATALOG_FILE="${9?:Error \$CATALOG_FILE not set. Bye}"

CATALOG_FILE_BASEDIR="$( cd "$( dirname "$(realpath ${CATALOG_FILE})" )" && pwd )"
Expand Down Expand Up @@ -58,49 +58,49 @@ touch ${CATALOG_FILE}
# Limitador Operator
###
# Add the package
${OPM} init limitador-operator --default-channel=${CHANNELS} --output yaml >> ${CATALOG_FILE}
${OPM} init limitador-operator --default-channel=${CHANNEL} --output yaml >> ${CATALOG_FILE}
# Add a bundles to the Catalog
cat ${TMP_DIR}/limitador-operator-bundle.yaml >> ${CATALOG_FILE}
# Add a channel entry for the bundle
V=`${YQ} eval '.name' ${TMP_DIR}/limitador-operator-bundle.yaml` \
CHANNELS=${CHANNELS} \
${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNELS))' ${CATALOG_BASEDIR}/limitador-operator-channel-entry.yaml >> ${CATALOG_FILE}
CHANNEL=${CHANNEL} \
${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/limitador-operator-channel-entry.yaml >> ${CATALOG_FILE}

###
# Authorino Operator
###
# Add the package
${OPM} init authorino-operator --default-channel=${CHANNELS} --output yaml >> ${CATALOG_FILE}
${OPM} init authorino-operator --default-channel=${CHANNEL} --output yaml >> ${CATALOG_FILE}
# Add a bundles to the Catalog
cat ${TMP_DIR}/authorino-operator-bundle.yaml >> ${CATALOG_FILE}
# Add a channel entry for the bundle
V=`${YQ} eval '.name' ${TMP_DIR}/authorino-operator-bundle.yaml` \
CHANNELS=${CHANNELS} \
${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNELS))' ${CATALOG_BASEDIR}/authorino-operator-channel-entry.yaml >> ${CATALOG_FILE}
CHANNEL=${CHANNEL} \
${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/authorino-operator-channel-entry.yaml >> ${CATALOG_FILE}

###
# DNS Operator
###
# Add the package
${OPM} init dns-operator --default-channel=${CHANNELS} --output yaml >> ${CATALOG_FILE}
${OPM} init dns-operator --default-channel=${CHANNEL} --output yaml >> ${CATALOG_FILE}
# Add a bundles to the Catalog
cat ${TMP_DIR}/dns-operator-bundle.yaml >> ${CATALOG_FILE}
# Add a channel entry for the bundle
V=`${YQ} eval '.name' ${TMP_DIR}/dns-operator-bundle.yaml` \
CHANNELS=${CHANNELS} \
${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNELS))' ${CATALOG_BASEDIR}/dns-operator-channel-entry.yaml >> ${CATALOG_FILE}
CHANNEL=${CHANNEL} \
${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/dns-operator-channel-entry.yaml >> ${CATALOG_FILE}

###
# Kuadrant Operator
###
# Add the package
${OPM} init kuadrant-operator --default-channel=${CHANNELS} --output yaml >> ${CATALOG_FILE}
${OPM} init kuadrant-operator --default-channel=${CHANNEL} --output yaml >> ${CATALOG_FILE}
# Add a bundles to the Catalog
cat ${TMP_DIR}/kuadrant-operator-bundle.yaml >> ${CATALOG_FILE}
# Add a channel entry for the bundle
NAME=`${YQ} eval '.name' ${TMP_DIR}/kuadrant-operator-bundle.yaml` \
REPLACES=kuadrant-operator.v${REPLACES_VERSION} \
CHANNELS=${CHANNELS} \
${YQ} eval '(.entries[0].name = strenv(NAME)) | (.entries[0].replaces = strenv(REPLACES)) | (.name = strenv(CHANNELS))' ${CATALOG_BASEDIR}/kuadrant-operator-channel-entry.yaml >> ${CATALOG_FILE}
CHANNEL=${CHANNEL} \
${YQ} eval '(.entries[0].name = strenv(NAME)) | (.entries[0].replaces = strenv(REPLACES)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/kuadrant-operator-channel-entry.yaml >> ${CATALOG_FILE}

rm -rf $TMP_DIR
Loading