-
Notifications
You must be signed in to change notification settings - Fork 6
HYPERFLEET-1615 - feat: First pass on catalog builds for operator #28
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Building stage | ||
| FROM registry.redhat.io/openshift4/ose-operator-registry-rhel9:v4.18 AS builder | ||
|
|
||
| WORKDIR /workspace | ||
|
|
||
| # COPY template file set as a build-arg | ||
| # Supports konflux + dev builds | ||
| ARG TEMPLATEFILE | ||
| COPY catalog/base-template.yaml ./ | ||
| COPY catalog/${TEMPLATEFILE} ./ | ||
|
|
||
| RUN cat base-template.yaml ${TEMPLATEFILE} > ./template.yaml | ||
|
|
||
| RUN /bin/opm alpha render-template basic \ | ||
| --migrate-level=bundle-object-to-csv-metadata \ | ||
| -o yaml ./template.yaml > catalog.yaml | ||
|
|
||
| # Final serving stage | ||
| FROM registry.redhat.io/openshift4/ose-operator-registry-rhel9:v4.18 AS serve | ||
|
|
||
| COPY --from=builder /workspace/catalog.yaml /configs/hyperfleet-operator/catalog.yaml | ||
|
|
||
| RUN ["/bin/opm", "serve", "/configs/hyperfleet-operator", "--cache-dir=/tmp/cache", "--cache-only"] | ||
|
|
||
| ENTRYPOINT ["/bin/opm"] | ||
| CMD ["serve", "/configs/hyperfleet-operator", "--cache-dir=/tmp/cache"] | ||
|
|
||
| ARG APP_VERSION="0.0.0-dev" | ||
| LABEL version="${APP_VERSION}" | ||
| LABEL operators.operatorframework.io.index.configs.v1=/configs | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add ARG APP_VERSION and LABEL version="${APP_VERSION}" the same way the bundle Dockerfile does. The RPA's default tag template is {{ labels.version }}; with the operator-registry base the catalog would inherit version=v4.18.x from the parent and get tagged as an OCP version. Same fix as the bundle needed in 1411. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| schema: olm.template.basic | ||
| entries: | ||
| - schema: olm.package | ||
| name: hyperfleet-operator | ||
| defaultChannel: stable | ||
| description: "HyperFleet Operator" | ||
| - schema: olm.channel | ||
| name: stable | ||
| package: hyperfleet-operator | ||
| entries: | ||
| - name: hyperfleet-operator.v0.0.1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eh, not asking for a change here: the nudge rewrites the digest of the same entry, so every catalog rebuild republishes hyperfleet-operator.v0.0.1 pointing at different content. OLM (both stacks) will not upgrade an installed v0.0.1 to another v0.0.1, so consumers only see new bundles on fresh install, and the N-1 to N upgrade e2e in HYPERFLEET-1413 has no edge to traverse. That is the versioning question HYPERFLEET-1617 owns. Suggest the docs/olm.md TODO says exactly that ("catalog has no upgrade graph until 1617 lands") instead of "assumption is we push all updates to the same tag", so 1413 does not start against this catalog. |
||
| skipRange: "<0.0.1" | ||
| # Dockerfile will concatenate the olm.bundle entry depending on the environment | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Modify this file to override the operator-bundle image used in your catalog testing | ||
| # For dev purposes when testing changes and using catalog installation | ||
| - schema: olm.bundle | ||
| image: OVERRIDE_DEV_BUNDLE_IMG |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # DO NOT MODIFY THIS FILE -- UPDATED by konflux build-nudges | ||
| # Used in KONFLUX builds only | ||
| # build-nudges-ref will update this image value | ||
| - schema: olm.bundle | ||
| image: quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-operator-bundle@sha256:f9ba788d8eac7b6a4fadb3043fa72e513aab8dcdd8d1c57725ee84d1e5463acd |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win
Injection
Reachability: External
Exploitability: Moderate
CWE: CWE-78 — Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Constrain
TEMPLATEFILEbefore this shell recipe.A caller can set
TEMPLATEFILEto shell syntax. Make expands it unquoted in this recipe. The same value reachescatalog.Dockerfileline 12. The file-exists check does not prevent command injection.Allow only
dev-template.yamlandkonflux-template.yaml. Quote all recipe expansions. ValidateBUNDLE_IMGbefore inserting it into thesedexpression.🤖 Prompt for AI Agents
Source: Path instructions
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Pass
APP_VERSIONtocatalog.Dockerfile.catalog-builddoes not pass the definedAPP_VERSION, socatalog.Dockerfileuses0.0.0-devfor the catalog image'sversionlabel. This produces incorrect metadata for non-development catalog builds. Add--build-arg APP_VERSION=$(APP_VERSION)to the build command.🤖 Prompt for AI Agents