diff --git a/Dockerfile b/Dockerfile index 73af856ca..12de7f9d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ #@follow_tag(registry.redhat.io/rhel9/go-toolset:latest) # https://registry.access.redhat.com/ubi9/go-toolset -FROM registry.access.redhat.com/ubi9/go-toolset:9.7-1763038106@sha256:380d6de9bbc5a42ca13d425be99958fb397317664bb8a00e49d464e62cc8566c AS builder +FROM registry.access.redhat.com/ubi9/go-toolset:9.6-1760420453 AS builder ARG TARGETOS ARG TARGETARCH # hadolint ignore=DL3002 @@ -38,7 +38,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o ma # Install openssl for FIPS support #@follow_tag(registry.redhat.io/ubi9/ubi-minimal:latest) # https://registry.access.redhat.com/ubi9/ubi-minimal -FROM registry.access.redhat.com/ubi9-minimal:9.6-1760515502@sha256:d1bad2a2790eac1651e57e78159a81b72ddfa7b836936b26cf51e09744bf1c2d AS runtime +FROM registry.access.redhat.com/ubi9-minimal:9.6-1760515502@sha256:34880b64c07f28f64d95737f82f891516de9a3b43583f39970f7bf8e4cfa48b7 AS runtime # Downstream uncomment # RUN cat /cachi2/cachi2.env #/ Downstream uncomment diff --git a/Makefile b/Makefile index 70b5ac464..18eb12ece 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,10 @@ else BUNDLE_METADATA_PACKAGE_NAME ?= backstage-operator endif +# SED_I is used for in-place sed command compatibility between GNU and BSD (macOS) sed versions +# Check is based on the fact that GNU sed supports --version; BSD/macOS sed does not. +SED_I := $(shell if sed --version >/dev/null 2>&1; then printf '%s' "-i"; else printf '%s' "-i ''"; fi) + # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") # To re-generate a bundle for other specific channels without changing the standard setup, you can: @@ -301,9 +305,9 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada cd config/profile/$(PROFILE) && $(KUSTOMIZE) edit set image controller=$(IMG) $(KUSTOMIZE) build config/manifests/$(PROFILE) | $(OPERATOR_SDK) generate bundle --kustomize-dir config/manifests/$(PROFILE) $(BUNDLE_GEN_FLAGS) @mv -f bundle.Dockerfile ./bundle/$(PROFILE)/bundle.Dockerfile - @sed -i 's/backstage-operator.v$(VERSION)/$(PROFILE_SHORT)-operator.v$(VERSION)/g' ./bundle/$(PROFILE)/manifests/backstage-operator.clusterserviceversion.yaml - @sed -i 's/backstage-operator/$(BUNDLE_METADATA_PACKAGE_NAME)/g' ./bundle/$(PROFILE)/metadata/annotations.yaml - @sed -i 's/backstage-operator/$(BUNDLE_METADATA_PACKAGE_NAME)/g' ./bundle/$(PROFILE)/bundle.Dockerfile + @sed $(SED_I) 's/backstage-operator.v$(VERSION)/$(PROFILE_SHORT)-operator.v$(VERSION)/g' ./bundle/$(PROFILE)/manifests/backstage-operator.clusterserviceversion.yaml + @sed $(SED_I) 's/backstage-operator/$(BUNDLE_METADATA_PACKAGE_NAME)/g' ./bundle/$(PROFILE)/metadata/annotations.yaml + @sed $(SED_I) 's/backstage-operator/$(BUNDLE_METADATA_PACKAGE_NAME)/g' ./bundle/$(PROFILE)/bundle.Dockerfile $(OPERATOR_SDK) bundle validate ./bundle/$(PROFILE) ## to update the CSV with a new tagged version of the operator: diff --git a/bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml b/bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml index caa9fefdd..f7a7ff913 100644 --- a/bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml +++ b/bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml @@ -45,7 +45,7 @@ metadata: } } ] - createdAt: "2025-10-14T17:57:09Z" + createdAt: "2025-11-06T13:20:41Z" description: Backstage Operator operators.operatorframework.io/builder: operator-sdk-v1.37.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 @@ -239,10 +239,6 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - key: kubernetes.io/os operator: In values: diff --git a/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml b/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml index d1a00c6b0..dfa183aa2 100644 --- a/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml +++ b/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml @@ -49,7 +49,7 @@ metadata: categories: Developer Tools certified: "true" containerImage: registry.redhat.io/rhdh/rhdh-rhel9-operator:1.9 - createdAt: "2025-10-14T17:57:10Z" + createdAt: "2025-11-06T13:20:43Z" description: Red Hat Developer Hub is a Red Hat supported version of Backstage. It comes with pre-built plug-ins and configuration settings, supports use of an external database, and can help streamline the process of setting up a self-managed @@ -73,6 +73,7 @@ metadata: support: Red Hat labels: operatorframework.io/arch.amd64: supported + operatorframework.io/arch.arm64: supported name: rhdh-operator.v1.9.0 namespace: placeholder spec: @@ -330,10 +331,6 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - key: kubernetes.io/os operator: In values: @@ -357,7 +354,7 @@ spec: - name: RELATED_IMAGE_postgresql value: quay.io/fedora/postgresql-15:latest - name: RELATED_IMAGE_backstage - value: quay.io/rhdh/rhdh-hub-rhel9:next + value: quay.io/rhdh-community/rhdh:next image: quay.io/rhdh/rhdh-rhel9-operator:1.9 livenessProbe: httpGet: @@ -477,7 +474,7 @@ spec: relatedImages: - image: quay.io/fedora/postgresql-15:latest name: postgresql - - image: quay.io/rhdh/rhdh-hub-rhel9:next + - image: quay.io/rhdh-community/rhdh:next name: backstage replaces: rhdh-operator.v1.8.0 version: 1.9.0 diff --git a/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml b/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml index 2114fb0e3..f184b8b88 100644 --- a/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml +++ b/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml @@ -220,7 +220,7 @@ data: - ./install-dynamic-plugins.sh - /dynamic-plugins-root # image will be replaced by the value of the `RELATED_IMAGE_backstage` env var, if set - image: quay.io/rhdh/rhdh-hub-rhel9:next + image: quay.io/rhdh-community/rhdh:next imagePullPolicy: IfNotPresent securityContext: readOnlyRootFilesystem: true @@ -259,7 +259,7 @@ data: containers: - name: backstage-backend # image will be replaced by the value of the `RELATED_IMAGE_backstage` env var, if set - image: quay.io/rhdh/rhdh-hub-rhel9:next + image: quay.io/rhdh-community/rhdh:next imagePullPolicy: IfNotPresent args: - "--config" diff --git a/bundle/rhdh/manifests/rhdh-plugin-deps_v1_configmap.yaml b/bundle/rhdh/manifests/rhdh-plugin-deps_v1_configmap.yaml index a17cc100e..71f269e33 100644 --- a/bundle/rhdh/manifests/rhdh-plugin-deps_v1_configmap.yaml +++ b/bundle/rhdh/manifests/rhdh-plugin-deps_v1_configmap.yaml @@ -167,7 +167,7 @@ data: tekton.dev/categories: Git tekton.dev/tags: git tekton.dev/displayName: "git cli" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le" + tekton.dev/platforms: "linux/amd64,linux/arm64,linux/s390x,linux/ppc64le" spec: description: >- This task can be used to perform git operations. diff --git a/config/manager/deployment.yaml b/config/manager/deployment.yaml index d64eeaea3..85ec0ec4f 100644 --- a/config/manager/deployment.yaml +++ b/config/manager/deployment.yaml @@ -34,13 +34,6 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - # - arm64 - # - ppc64le - # - s390x - key: kubernetes.io/os operator: In values: diff --git a/config/manifests/rhdh/bases/backstage-operator.clusterserviceversion.yaml b/config/manifests/rhdh/bases/backstage-operator.clusterserviceversion.yaml index 7104d07d6..eb3a357ee 100644 --- a/config/manifests/rhdh/bases/backstage-operator.clusterserviceversion.yaml +++ b/config/manifests/rhdh/bases/backstage-operator.clusterserviceversion.yaml @@ -27,6 +27,7 @@ metadata: support: Red Hat labels: operatorframework.io/arch.amd64: supported + operatorframework.io/arch.arm64: supported name: backstage-operator.v0.0.0 namespace: placeholder spec: diff --git a/config/profile/rhdh/default-config/deployment.yaml b/config/profile/rhdh/default-config/deployment.yaml index 36462d3d7..74ba450fd 100644 --- a/config/profile/rhdh/default-config/deployment.yaml +++ b/config/profile/rhdh/default-config/deployment.yaml @@ -44,7 +44,7 @@ spec: - ./install-dynamic-plugins.sh - /dynamic-plugins-root # image will be replaced by the value of the `RELATED_IMAGE_backstage` env var, if set - image: quay.io/rhdh/rhdh-hub-rhel9:next + image: quay.io/rhdh-community/rhdh:next imagePullPolicy: IfNotPresent securityContext: readOnlyRootFilesystem: true @@ -83,7 +83,7 @@ spec: containers: - name: backstage-backend # image will be replaced by the value of the `RELATED_IMAGE_backstage` env var, if set - image: quay.io/rhdh/rhdh-hub-rhel9:next + image: quay.io/rhdh-community/rhdh:next imagePullPolicy: IfNotPresent args: - "--config" diff --git a/config/profile/rhdh/patches/deployment-patch.yaml b/config/profile/rhdh/patches/deployment-patch.yaml index 83e3382b4..62daa5a21 100644 --- a/config/profile/rhdh/patches/deployment-patch.yaml +++ b/config/profile/rhdh/patches/deployment-patch.yaml @@ -27,5 +27,5 @@ spec: - name: RELATED_IMAGE_postgresql value: quay.io/fedora/postgresql-15:latest - name: RELATED_IMAGE_backstage - value: quay.io/rhdh/rhdh-hub-rhel9:next + value: quay.io/rhdh-community/rhdh:next diff --git a/config/profile/rhdh/plugin-deps/tekton.yaml b/config/profile/rhdh/plugin-deps/tekton.yaml index 7864d12a3..48c03186f 100644 --- a/config/profile/rhdh/plugin-deps/tekton.yaml +++ b/config/profile/rhdh/plugin-deps/tekton.yaml @@ -11,7 +11,7 @@ metadata: tekton.dev/categories: Git tekton.dev/tags: git tekton.dev/displayName: "git cli" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le" + tekton.dev/platforms: "linux/amd64,linux/arm64,linux/s390x,linux/ppc64le" spec: description: >- This task can be used to perform git operations. diff --git a/dist/backstage.io/install.yaml b/dist/backstage.io/install.yaml index 492f9c1eb..c008c2a65 100644 --- a/dist/backstage.io/install.yaml +++ b/dist/backstage.io/install.yaml @@ -2311,10 +2311,6 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - key: kubernetes.io/os operator: In values: diff --git a/dist/rhdh/install.yaml b/dist/rhdh/install.yaml index 0ee6ccf43..c5c9ed5e7 100644 --- a/dist/rhdh/install.yaml +++ b/dist/rhdh/install.yaml @@ -2336,7 +2336,7 @@ data: - ./install-dynamic-plugins.sh - /dynamic-plugins-root # image will be replaced by the value of the `RELATED_IMAGE_backstage` env var, if set - image: quay.io/rhdh/rhdh-hub-rhel9:next + image: quay.io/rhdh-community/rhdh:next imagePullPolicy: IfNotPresent securityContext: readOnlyRootFilesystem: true @@ -2375,7 +2375,7 @@ data: containers: - name: backstage-backend # image will be replaced by the value of the `RELATED_IMAGE_backstage` env var, if set - image: quay.io/rhdh/rhdh-hub-rhel9:next + image: quay.io/rhdh-community/rhdh:next imagePullPolicy: IfNotPresent args: - "--config" @@ -2732,7 +2732,7 @@ data: tekton.dev/categories: Git tekton.dev/tags: git tekton.dev/displayName: "git cli" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le" + tekton.dev/platforms: "linux/amd64,linux/arm64,linux/s390x,linux/ppc64le" spec: description: >- This task can be used to perform git operations. @@ -3188,10 +3188,6 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - key: kubernetes.io/os operator: In values: @@ -3215,7 +3211,7 @@ spec: - name: RELATED_IMAGE_postgresql value: quay.io/fedora/postgresql-15:latest - name: RELATED_IMAGE_backstage - value: quay.io/rhdh/rhdh-hub-rhel9:next + value: quay.io/rhdh-community/rhdh:next image: quay.io/rhdh/rhdh-rhel9-operator:1.9 livenessProbe: httpGet: diff --git a/docs/developer.md b/docs/developer.md index b6a535a79..e05f58730 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -33,9 +33,9 @@ It only takes a few seconds to run, but covers quite a lot of functionality. For For testing, you will need a Kubernetes cluster, either remote (with sufficient admin rights) or local, such as [minikube](https://kubernetes.io/docs/tasks/tools/#minikube) or [kind](https://kubernetes.io/docs/tasks/tools/#kind) -- Build and push your image to the location specified by `IMG`: +- Build and push your image to the location specified by `IMG`. If your laptop architecture is not the default (linux/amd64), you may need to specify [PLATFORM](#tested-platforms) as well: ```sh -make image-build image-push IMG=/backstage-operator:tag +make [PLATFORM=] image-build image-push IMG=/backstage-operator:tag ``` **NOTE:** This image ought to be published in the personal registry you specified. @@ -53,6 +53,10 @@ make install make uninstall ``` +#### Tested platforms: +- linux/amd64 - default +- linux/arm64 + ### Run the controller standalone You can run your controller standalone (this will run in the foreground, so switch to a new terminal if you want to leave it running) @@ -126,9 +130,9 @@ Also note that the [`pr-bundle-diff-checks.yaml`](https://github.com/redhat-deve #### Build and push images There are a bunch of commands to build and push to the registry necessary images. -For development purpose, most probably, you will need to specify the image you build and push with IMAGE_TAG_BASE env variable: +For development purpose, you might need to specify the image you build and push with IMAGE_TAG_BASE env variable, if you test on a laptop with non default **linux/amd64** architecture you may need to specify **[PLATFORM](#tested-platforms)** as well: -* `[IMAGE_TAG_BASE=/backstage-operator] make image-build` builds operator manager image (**backstage-operator**) +* `[PLATFORM=] [IMAGE_TAG_BASE=/backstage-operator] make image-build` builds operator manager image (**backstage-operator**) * `[IMAGE_TAG_BASE=/backstage-operator] make image-push` pushes operator manager image to **your-registry** * `[IMAGE_TAG_BASE=/backstage-operator] make bundle-build` builds operator manager image (**backstage-operator-bundle**) * `[IMAGE_TAG_BASE=/backstage-operator] make bundle-push` pushes bundle image to **your-registry** @@ -148,7 +152,7 @@ You can do it all together using: You can point the namespace where OLM installed. By default, in a vanilla Kubernetes, OLM os deployed on 'olm' namespace. In Openshift you have to explicitly point it to **openshift-marketplace** namespace. #### Deploy the Operator with OLM -Default namespace to deploy the Operator is called **backstage-system** , this name fits one defined in [kustomization.yaml](../config/default/kustomization.yaml). So, if you consider changing it you have to change it in this file and define **OPERATOR_NAMESPACE** environment variable. +Default namespace to deploy the Operator is called **rhdh-operator** for RHDH profile and **backstage-system** otherwise, if you, by some reason, consider changing it you have to change it in this file and define **OPERATOR_NAMESPACE** environment variable. Following command creates OperatorGroup and Subscription on Operator namespace ```sh [OPERATOR_NAMESPACE=] make deploy-olm diff --git a/examples/rhdh-cr.yaml b/examples/rhdh-cr.yaml index ed677539b..616095ff3 100644 --- a/examples/rhdh-cr.yaml +++ b/examples/rhdh-cr.yaml @@ -83,7 +83,7 @@ spec: spec: containers: - name: backstage-backend - image: quay.io/rhdh/rhdh-hub-rhel9:latest + image: quay.io/rhdh-community/rhdh:next application: appConfig: configMaps: