-
Notifications
You must be signed in to change notification settings - Fork 6
HYPERFLEET-1411 - feat: Add hyperfleet-operator image and bundle components #7
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 |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| *.so | ||
| *.dylib | ||
| bin/* | ||
| dist/ | ||
| _output/ | ||
| Dockerfile.cross | ||
|
|
||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Konflux nudges update these variables with the latest digest-pinned pullspecs. | ||
|
|
||
| HYPERFLEET_OPERATOR_IMAGE_PULLSPEC="${HYPERFLEET_OPERATOR_IMAGE_PULLSPEC:-quay.io/openshift-hyperfleet/hyperfleet-operator:v0.0.1}" | ||
|
|
||
| CSV_FILE="${CSV_FILE:-/manifests/hyperfleet-operator.clusterserviceversion.yaml}" | ||
|
|
||
| # Update operator deployment image | ||
| yq eval ".spec.install.spec.deployments[].spec.template.spec.containers[] |= ( | ||
| select(.name == \"manager\") | | ||
| .image = \"${HYPERFLEET_OPERATOR_IMAGE_PULLSPEC}\" | ||
| )" -i "${CSV_FILE}" | ||
|
|
||
|
|
||
| # Update containerImage annotation | ||
| yq eval ".metadata.annotations.containerImage = \"${HYPERFLEET_OPERATOR_IMAGE_PULLSPEC}\"" -i "${CSV_FILE}" | ||
|
|
||
| # Update relatedImages | ||
|
|
||
| cat "${CSV_FILE}" | ||
|
Comment on lines
+20
to
+22
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. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win No build step maintains the digest-pinned image references in the bundle. The operator image never reaches
As per path instructions: "Environment variable overrides documented" and "TODOs and FIXMEs must reference a ticket ID." 📍 Affects 3 files
🤖 Prompt for AI AgentsSource: Path instructions |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| FROM scratch | ||
|
|
||
| # Core bundle labels. | ||
| LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 | ||
| LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ | ||
| LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ | ||
| LABEL operators.operatorframework.io.bundle.package.v1=hyperfleet-operator | ||
| LABEL operators.operatorframework.io.bundle.channels.v1=stable | ||
| LABEL operators.operatorframework.io.bundle.channel.default.v1=stable | ||
| LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.42.3 | ||
| LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 | ||
| LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 | ||
|
|
||
| # Labels for testing. | ||
| LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 | ||
| LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ | ||
|
|
||
| # Copy files to locations specified by labels. | ||
| COPY bundle/manifests /manifests/ | ||
| COPY bundle/metadata /metadata/ | ||
| COPY bundle/tests/scorecard /tests/scorecard/ |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||
| # Konflux bundle image build. Unlike the auto-generated bundle.Dockerfile (used | ||||||
| # for local dev with operator-sdk), this runs bundle-hack/update_bundle.sh to | ||||||
| # patch digest-pinned image references into the CSV at build time. | ||||||
| FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS builder-runner | ||||||
| RUN microdnf install -y tar gzip && \ | ||||||
| curl -sL https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64.tar.gz | tar xz && \ | ||||||
| mv yq_linux_amd64 /usr/bin/yq | ||||||
|
ma-hill marked this conversation as resolved.
|
||||||
|
|
||||||
| FROM builder-runner AS builder | ||||||
| # Hack to set the operator container image in the deployment | ||||||
|
Member
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. Tip nit — non-blocking suggestion Category: Pattern Since you mentioned this is a hack you'll clean up in a follow-up PR, it'd be worth referencing that ticket here so it doesn't get forgotten:
Suggested change
|
||||||
| COPY bundle-hack . | ||||||
| COPY bundle/manifests /manifests/ | ||||||
|
|
||||||
| RUN ./update_bundle.sh | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
Comment on lines
+9
to
+14
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. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 4 \
'HYPERFLEET_OPERATOR_IMAGE_PULLSPEC|bundle\.konflux\.Dockerfile|--build-arg' \
Makefile bundle-hack bundle.konflux.DockerfileRepository: openshift-hyperfleet/hyperfleet-operator Length of output: 2059 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- bundle.konflux.Dockerfile ---'
cat -n bundle.konflux.Dockerfile
printf '%s\n' '--- bundle-hack/update_bundle.sh ---'
cat -n bundle-hack/update_bundle.sh
printf '%s\n' '--- Konflux/build configuration references ---'
rg -n -C 3 \
'bundle\.konflux\.Dockerfile|HYPERFLEET_OPERATOR_IMAGE_PULLSPEC|build-arg|konflux|digest-pinned|pullspec' \
.github .tekton .konflux config deploy bundle Makefile 2>/dev/null || trueRepository: openshift-hyperfleet/hyperfleet-operator Length of output: 3471 🌐 Web query:
💡 Result: In Docker, the Citations:
Fail closed when the digest-pinned operator pullspec is unavailable. When Konflux supplies 🤖 Prompt for AI AgentsSource: Path instructions
Collaborator
Author
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. This is a hack right now, will clean it up in next pr 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.
Do you want a GitHub issue for the follow-up pull request? You are interacting with an AI system. |
||||||
|
|
||||||
| FROM scratch | ||||||
|
|
||||||
| # Core bundle labels. | ||||||
| LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 | ||||||
| LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ | ||||||
| LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ | ||||||
| LABEL operators.operatorframework.io.bundle.package.v1=hyperfleet-operator | ||||||
| LABEL operators.operatorframework.io.bundle.channels.v1=stable | ||||||
| LABEL operators.operatorframework.io.bundle.channel.default.v1=stable | ||||||
| LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.42.3 | ||||||
| LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 | ||||||
| LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 | ||||||
|
|
||||||
| # Labels for testing. | ||||||
| LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 | ||||||
| LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ | ||||||
|
|
||||||
| # Copy patched manifests from builder, metadata and tests from source. | ||||||
| COPY --from=builder /manifests /manifests/ | ||||||
| COPY bundle/metadata /metadata/ | ||||||
| COPY bundle/tests/scorecard /tests/scorecard/ | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: hyperfleet-operator | ||
| control-plane: controller-manager | ||
| name: hyperfleet-operator-controller-manager-metrics-service | ||
| spec: | ||
| ports: | ||
| - name: https | ||
| port: 8443 | ||
| protocol: TCP | ||
| targetPort: 8443 | ||
| selector: | ||
| app.kubernetes.io/name: hyperfleet-operator | ||
| control-plane: controller-manager | ||
| status: | ||
| loadBalancer: {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: hyperfleet-operator | ||
| name: hyperfleet-operator-hyperfleetconfig-admin-role | ||
| rules: | ||
| - apiGroups: | ||
| - hyperfleet.redhat.com | ||
| resources: | ||
| - hyperfleetconfigs | ||
| verbs: | ||
| - '*' | ||
| - apiGroups: | ||
| - hyperfleet.redhat.com | ||
| resources: | ||
| - hyperfleetconfigs/status | ||
| verbs: | ||
| - get |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: hyperfleet-operator | ||
| name: hyperfleet-operator-hyperfleetconfig-editor-role | ||
| rules: | ||
| - apiGroups: | ||
| - hyperfleet.redhat.com | ||
| resources: | ||
| - hyperfleetconfigs | ||
| verbs: | ||
| - create | ||
| - delete | ||
| - get | ||
| - list | ||
| - patch | ||
| - update | ||
| - watch | ||
| - apiGroups: | ||
| - hyperfleet.redhat.com | ||
| resources: | ||
| - hyperfleetconfigs/status | ||
| verbs: | ||
| - get |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: hyperfleet-operator | ||
| name: hyperfleet-operator-hyperfleetconfig-viewer-role | ||
| rules: | ||
| - apiGroups: | ||
| - hyperfleet.redhat.com | ||
| resources: | ||
| - hyperfleetconfigs | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - hyperfleet.redhat.com | ||
| resources: | ||
| - hyperfleetconfigs/status | ||
| verbs: | ||
| - get |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app.kubernetes.io/managed-by: kustomize | ||
| app.kubernetes.io/name: hyperfleet-operator | ||
| name: hyperfleet-operator-metrics-reader | ||
| rules: | ||
| - nonResourceURLs: | ||
| - /metrics | ||
| verbs: | ||
| - get |
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.
Tip
nit — non-blocking suggestion
Category: Security
HYPERFLEET_OPERATOR_IMAGE_PULLSPECis interpolated directly into the yq expression string here (and again on line 18 for the annotation). Since the value can come from an external nudge payload, it's safer to bind it as a variable instead of splicing it into the expression text:Same idea applies to line 18 (
.metadata.annotations.containerImage = strenv(HYPERFLEET_OPERATOR_IMAGE_PULLSPEC)).