Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/build_image_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
run: echo "WF_RELIMG_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: build and save bundle image
run: OCI_BUILD_OPTS="--label quay.expires-after=2w" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.short_sha }} PLG_VERSION=${{ env.WF_RELIMG_VERSION }} FLP_VERSION=${{ env.WF_RELIMG_VERSION }} BPF_VERSION=${{ env.WF_RELIMG_VERSION }} BUNDLE_VERSION=0.0.0-sha-${{ env.short_sha }} CLEAN_BUILD=1 BUNDLE_SET_DATE=true make bundle bundle-tar
- name: build and save catalog image
run: IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=0.0.0-sha-${{ env.short_sha }} CLEAN_BUILD=1 make catalog-tar
- name: save PR number
run: |
echo ${{ github.event.number }} > ./out/pr-id
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/push_image_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ jobs:
run: |
docker load --input ./operator.tar
docker load --input ./bundle.tar
docker load --input ./catalog.tar
- name: docker login to quay.io
uses: docker/login-action@v2
with:
username: ${{ env.WF_REGISTRY_USER }}
password: ${{ secrets.QUAY_SECRET }}
registry: quay.io
- name: push operator and bundle
- name: push operator, bundle and catalog
run: |
DOCKER_BUILDKIT=1 docker push $(cat ./operator-name)
DOCKER_BUILDKIT=1 docker push $(cat ./bundle-name)
- name: build and push catalog
run: |
IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=0.0.0-sha-$(cat ./short-sha) make shortlived-catalog-build catalog-push
DOCKER_BUILDKIT=1 docker push $(cat ./catalog-name)
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -48,6 +47,7 @@ jobs:
var shortSha = String(fs.readFileSync('./short-sha')).trim();
var operatorImage = fs.readFileSync('./operator-name');
var bundleImage = fs.readFileSync('./bundle-name');
var catalogImage = fs.readFileSync('./catalog-name');
github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
Expand All @@ -56,7 +56,7 @@ jobs:
\`\`\`bash
${operatorImage}
${bundleImage}
quay.io/netobserv/network-observability-operator-catalog:v0.0.0-sha-${shortSha}
${catalogImage}
\`\`\`

They will expire in two weeks.
Expand All @@ -79,7 +79,7 @@ jobs:
namespace: openshift-marketplace
spec:
sourceType: grpc
image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-sha-${shortSha}
image: ${catalogImage}
displayName: NetObserv development catalog
publisher: Me
updateStrategy:
Expand Down
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,9 @@ endif
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
.PHONY: catalog-build
catalog-build: opm ## Build a catalog image.
OPM=$(OPM) BUNDLE_IMAGE=$(BUNDLE_IMAGE) BUNDLE_TAG="v$(BUNDLE_VERSION)" ./hack/update_fbc.sh
OPM=$(OPM) BUNDLE_TAG="v$(BUNDLE_VERSION)" ./hack/update_fbc.sh
$(OCI_BIN) build $(OCI_BUILD_OPTS) --build-arg CATALOG_PATH="catalog/out/v$(BUNDLE_VERSION)" -f catalog.Dockerfile -t $(CATALOG_IMAGE) .

shortlived-catalog-build: ## Build a temporary catalog image, expiring after 2 weeks on quay
$(MAKE) catalog-build CATALOG_IMAGE=temp-catalog
echo "FROM temp-catalog" | $(OCI_BIN) build --label quay.expires-after=2w -t $(CATALOG_IMAGE) -

# Push the catalog image.
.PHONY: catalog-push
catalog-push: ## Push a catalog image.
Expand All @@ -506,6 +502,14 @@ catalog-deploy: ## Deploy a catalog image.
catalog-undeploy: ## Undeploy a catalog image.
kubectl delete -f ./config/samples/catalog/catalog.yaml

.PHONY: catalog-tar
catalog-tar: ## Build catalog image and save as a tar
mkdir -p ./out
$(MAKE) catalog-build CATALOG_IMAGE=temp-catalog
echo "FROM temp-catalog" | $(OCI_BIN) build --label quay.expires-after=2w -t $(CATALOG_IMAGE) -
$(OCI_BIN) save -o out/catalog.tar $(CATALOG_IMAGE)
echo $(CATALOG_IMAGE) > ./out/catalog-name

##@ Misc

.PHONY: test-workflow
Expand Down
6 changes: 3 additions & 3 deletions hack/update_fbc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -z "${YQ}" ]; then
exit 1
fi

echo "Creating new bundle using image ${BUNDLE_IMAGE}..."
echo "Creating new catalog..."

dir_catalog="catalog/out/${BUNDLE_TAG}"
dir_catalog_legacy="catalog/out-legacy/${BUNDLE_TAG}"
Expand All @@ -32,8 +32,8 @@ mkdir -p "${dir_catalog_legacy}"
cp -f catalog/parts/other.yaml ${dir_catalog}
cp -f catalog/parts/other.yaml ${dir_catalog_legacy}

${OPM} render "${BUNDLE_IMAGE}" --output=yaml --migrate-level=bundle-object-to-csv-metadata > "${dir_catalog}/bundle.yaml"
${OPM} render "${BUNDLE_IMAGE}" --output=yaml > "${dir_catalog_legacy}/bundle.yaml"
${OPM} render ./bundle --output=yaml --migrate-level=bundle-object-to-csv-metadata > "${dir_catalog}/bundle.yaml"
${OPM} render ./bundle --output=yaml > "${dir_catalog_legacy}/bundle.yaml"

echo "Generating single index..."
cat <<EOF > "${dir_catalog}/index.yaml"
Expand Down