-
Notifications
You must be signed in to change notification settings - Fork 6
HYPERFLEET-1411 - refactor: Update konflux + dev bundles #29
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 |
|---|---|---|
|
|
@@ -278,7 +278,6 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi | |
|
|
||
| ##@ Bundles/Catalog | ||
|
|
||
|
|
||
| # Non-olm installs | ||
| # Generates dist/install.yaml | ||
| # Install resources | ||
|
|
@@ -349,24 +348,19 @@ ifneq ($(origin CATALOG_BASE_IMG), undefined) | |
| FROM_INDEX_OPT := --from-index $(CATALOG_BASE_IMG) | ||
| endif | ||
|
|
||
| .PHONY: bundle | ||
| bundle: manifests operator-sdk ## Generate bundle manifests and metadata, then validate generated files. | ||
| $(OPERATOR_SDK) generate kustomize manifests -q | ||
| $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) | ||
| $(OPERATOR_SDK) bundle validate ./bundle | ||
|
|
||
| .PHONY: bundle-override-img | ||
| bundle-override-img: manifests operator-sdk ## Generate bundle with IMG override, then restore kustomization.yaml | ||
| $(OPERATOR_SDK) generate kustomize manifests -q | ||
| cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) | ||
| $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) | ||
| $(OPERATOR_SDK) bundle validate ./bundle | ||
| @echo "Bundle generated with IMG=$(IMG)" | ||
| @echo "Note: config/manager/kustomization.yaml has been modified. Commit or reset as needed." | ||
| cd config/manager/dev && $(KUSTOMIZE) edit set image controller=$(IMG) | ||
|
|
||
| .PHONY: bundle-build | ||
| bundle-build: ## Build the bundle image. | ||
| $(CONTAINER_TOOL) build -f bundle.Dockerfile -t $(BUNDLE_IMG) . | ||
| bundle-build: ## Builds the bundle and bundle image. | ||
| $(CONTAINER_TOOL) build -f bundle.Dockerfile \ | ||
| --platform $(PLATFORM) \ | ||
| --build-arg VERSION=$(VERSION) \ | ||
| --build-arg CHANNEL=$(CHANNELS) \ | ||
|
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. the Dockerfile ARG is |
||
| --build-arg APP_VERSION=$(APP_VERSION) \ | ||
| -t $(BUNDLE_IMG) . | ||
|
|
||
| .PHONY: bundle-push | ||
| bundle-push: ## Push the bundle image. | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,23 @@ | ||
| FROM registry.k8s.io/kustomize/kustomize:v5.0.0 AS kustomize | ||
|
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.
|
||
|
|
||
| COPY config/ /workdir/config/ | ||
|
|
||
| # Override the base kustomization.yaml | ||
| ARG KUSTOMIZE_VARIANT=dev/kustomization.yaml | ||
| RUN cp /workdir/config/manager/${KUSTOMIZE_VARIANT} \ | ||
|
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. this won't build on Konflux. The tekton push passes ARG KUSTOMIZE_VARIANT=config/manager/dev/kustomization.yaml |
||
| /workdir/config/manager/kustomization.yaml && \ | ||
| kustomize build /workdir/config/manifests > /workdir/manifests.yaml | ||
|
|
||
| FROM quay.io/operator-framework/operator-sdk:v1.42.3 AS operator | ||
| COPY --from=kustomize /workdir/manifests.yaml /workdir/manifests.yaml | ||
| ARG CHANNELS=stable | ||
| ARG VERSION=0.0.1 | ||
| WORKDIR /workdir | ||
| RUN cat manifests.yaml | operator-sdk generate bundle -q --version ${VERSION} \ | ||
| --channels=${CHANNELS} --default-channel=stable \ | ||
| --package=hyperfleet-operator && \ | ||
| operator-sdk bundle validate ./bundle | ||
|
|
||
| FROM scratch | ||
|
|
||
| # Core bundle labels. | ||
|
|
@@ -15,7 +35,20 @@ LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 | |
| 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/ | ||
| # Copy patched manifests from builder, metadata and tests from source. | ||
| COPY --from=operator /workdir/bundle/manifests /manifests/ | ||
| COPY --from=operator /workdir/bundle/metadata /metadata/ | ||
| COPY --from=operator /workdir/bundle/tests/scorecard /tests/scorecard/ | ||
|
|
||
| ARG APP_VERSION="0.0.0-dev" | ||
| LABEL name="hyperfleet-operator-bundle" \ | ||
| vendor="Red Hat, Inc." \ | ||
| version="${APP_VERSION}" \ | ||
| summary="OLM bundle for the HyperFleet Operator" \ | ||
| description="OLM bundle for the HyperFleet Operator, which installs and manages HyperFleet." \ | ||
| com.redhat.component="hyperfleet-operator-bundle-container" \ | ||
| io.k8s.description="OLM bundle for the HyperFleet Operator, which installs and manages HyperFleet." \ | ||
| distribution-scope="public" \ | ||
| release="1" \ | ||
| url="https://github.com/openshift-hyperfleet/hyperfleet-operator" \ | ||
| maintainer="Red Hat HyperFleet Team" | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
The bundle content now comes from
config/, but this only fires onbundle.Dockerfile. So a nudge PR touchingconfig/manager/prod/kustomization.yamlnever rebuilds the bundle. Worse, it does match the operator push (it only excludes the bundle Dockerfile and this file), so the operator rebuilds, gets a new digest, opens another nudge, and we loop. Add"config/***".pathChanged()here, and exclude the prod kustomization in the operator push CEL