diff --git a/Dockerfile b/Dockerfile index 0d751edf..a636d35c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:latest ARG USER_ID=65532 ARG GROUP_ID=65532 -ARG VERSION_LABEL=1.3.1 +ARG VERSION_LABEL=1.3.2 ARG RELEASE_LABEL=XX ARG VCS_REF=0123456789012345678901234567890123456789 ARG VCS_URL="https://github.com/application-stacks/runtime-component-operator" diff --git a/Makefile b/Makefile index fcb014e2..ec7bfad8 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 1.3.1 +VERSION ?= 1.3.2 OPERATOR_SDK_RELEASE_VERSION ?= v1.27.0 # CHANNELS define the bundle channels used in the bundle. diff --git a/bundle/manifests/runtime-component.clusterserviceversion.yaml b/bundle/manifests/runtime-component.clusterserviceversion.yaml index 19b07a6d..0a9cae7b 100644 --- a/bundle/manifests/runtime-component.clusterserviceversion.yaml +++ b/bundle/manifests/runtime-component.clusterserviceversion.yaml @@ -11,7 +11,7 @@ metadata: "name": "runtimecomponent-sample" }, "spec": { - "applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f", + "applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac", "expose": true, "manageTLS": true, "replicas": 1, @@ -44,7 +44,7 @@ metadata: "name": "runtimecomponent-sample" }, "spec": { - "applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f", + "applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac", "expose": true, "replicas": 1, "service": { @@ -71,9 +71,9 @@ metadata: categories: Application Runtime certified: "true" containerImage: icr.io/appcafe/runtime-component-operator:daily - createdAt: "2024-05-01T19:22:43Z" + createdAt: "2024-05-07T20:25:49Z" description: Deploys any runtime component with dynamic and auto-tuning configuration - olm.skipRange: '>=0.8.0 <1.3.1' + olm.skipRange: '>=0.8.0 <1.3.2' operators.openshift.io/infrastructure-features: '["disconnected"]' operators.operatorframework.io/builder: operator-sdk-v1.27.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 @@ -84,7 +84,7 @@ metadata: operatorframework.io/arch.ppc64le: supported operatorframework.io/arch.s390x: supported operatorframework.io/os.linux: supported - name: runtime-component.v1.3.1 + name: runtime-component.v1.3.2 namespace: placeholder spec: apiservicedefinitions: {} @@ -1006,7 +1006,7 @@ spec: fieldRef: fieldPath: metadata.annotations['olm.targetNamespaces'] - name: RELATED_IMAGE_LIBERTY_SAMPLE_APP - value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f + value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac - name: RELATED_IMAGE_RUNTIME_COMPONENT_OPERATOR value: icr.io/appcafe/runtime-component-operator:daily image: icr.io/appcafe/runtime-component-operator:daily @@ -1289,8 +1289,8 @@ spec: provider: name: Community relatedImages: - - image: icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f + - image: icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac name: liberty-sample-app - image: icr.io/appcafe/runtime-component-operator:daily name: runtime-component-operator - version: 1.3.1 + version: 1.3.2 diff --git a/catalog.Dockerfile b/catalog.Dockerfile index 355c3f5d..1158d281 100644 --- a/catalog.Dockerfile +++ b/catalog.Dockerfile @@ -2,7 +2,7 @@ FROM registry.redhat.io/openshift4/ose-operator-registry:v4.14 AS builder FROM registry.redhat.io/ubi8/ubi-minimal # Add label for location of Declarative Config root directory & required OpenShift labels -ARG VERSION_LABEL=1.3.1 +ARG VERSION_LABEL=1.3.2 ARG RELEASE_LABEL=XX ARG VCS_REF=0123456789012345678901234567890123456789 ARG VCS_URL="https://github.com/application-stacks/runtime-component-operator" diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 814fb59b..65dcbbcb 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -67,7 +67,7 @@ spec: fieldRef: fieldPath: metadata.annotations['olm.targetNamespaces'] - name: RELATED_IMAGE_LIBERTY_SAMPLE_APP - value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f + value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac - name: RELATED_IMAGE_RUNTIME_COMPONENT_OPERATOR value: OPERATOR_IMAGE securityContext: diff --git a/config/manifests/bases/runtime-component.clusterserviceversion.yaml b/config/manifests/bases/runtime-component.clusterserviceversion.yaml index e6351cca..b837ca53 100644 --- a/config/manifests/bases/runtime-component.clusterserviceversion.yaml +++ b/config/manifests/bases/runtime-component.clusterserviceversion.yaml @@ -9,7 +9,7 @@ metadata: containerImage: icr.io/appcafe/runtime-component-operator:daily createdAt: "2022-02-25T09:00:00Z" description: Deploys any runtime component with dynamic and auto-tuning configuration - olm.skipRange: '>=0.8.0 <1.3.1' + olm.skipRange: '>=0.8.0 <1.3.2' operators.openshift.io/infrastructure-features: '["disconnected"]' repository: https://github.com/application-stacks/runtime-component-operator support: Community diff --git a/config/samples/rc.app.stacks_v1_runtimecomponent.yaml b/config/samples/rc.app.stacks_v1_runtimecomponent.yaml index 8157f0c6..8f960af0 100644 --- a/config/samples/rc.app.stacks_v1_runtimecomponent.yaml +++ b/config/samples/rc.app.stacks_v1_runtimecomponent.yaml @@ -3,7 +3,7 @@ kind: RuntimeComponent metadata: name: runtimecomponent-sample spec: - applicationImage: icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f + applicationImage: icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac expose: true manageTLS: true replicas: 1 diff --git a/config/samples/rc.app.stacks_v1beta2_runtimecomponent.yaml b/config/samples/rc.app.stacks_v1beta2_runtimecomponent.yaml index f3c69d15..6fd94149 100644 --- a/config/samples/rc.app.stacks_v1beta2_runtimecomponent.yaml +++ b/config/samples/rc.app.stacks_v1beta2_runtimecomponent.yaml @@ -4,7 +4,7 @@ metadata: name: runtimecomponent-sample spec: # Add fields here - applicationImage: icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f + applicationImage: icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac expose: true replicas: 1 service: diff --git a/controllers/runtimecomponent_controller.go b/controllers/runtimecomponent_controller.go index dc3e3f9c..f13222d6 100644 --- a/controllers/runtimecomponent_controller.go +++ b/controllers/runtimecomponent_controller.go @@ -205,22 +205,25 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req } } - if appstacksutils.GetServiceAccountName(instance) == "" { - serviceAccount := &corev1.ServiceAccount{ObjectMeta: defaultMeta} - err = r.CreateOrUpdate(serviceAccount, instance, func() error { - return appstacksutils.CustomizeServiceAccount(serviceAccount, instance, r.GetClient()) - }) - if err != nil { - reqLogger.Error(err, "Failed to reconcile ServiceAccount") - return r.ManageError(err, common.StatusConditionTypeReconciled, instance) - } - } else { - // delete our SA, as one has been specified - serviceAccount := &corev1.ServiceAccount{ObjectMeta: defaultMeta} - err = r.DeleteResource(serviceAccount) - if err != nil { - reqLogger.Error(err, "Failed to delete ServiceAccount") - return r.ManageError(err, common.StatusConditionTypeReconciled, instance) + serviceAccountName := appstacksutils.GetServiceAccountName(instance) + if serviceAccountName != defaultMeta.Name { + if serviceAccountName == "" { + serviceAccount := &corev1.ServiceAccount{ObjectMeta: defaultMeta} + err = r.CreateOrUpdate(serviceAccount, instance, func() error { + return appstacksutils.CustomizeServiceAccount(serviceAccount, instance, r.GetClient()) + }) + if err != nil { + reqLogger.Error(err, "Failed to reconcile ServiceAccount") + return r.ManageError(err, common.StatusConditionTypeReconciled, instance) + } + } else { + // delete our SA, as one has been specified + serviceAccount := &corev1.ServiceAccount{ObjectMeta: defaultMeta} + err = r.DeleteResource(serviceAccount) + if err != nil { + reqLogger.Error(err, "Failed to delete ServiceAccount") + return r.ManageError(err, common.StatusConditionTypeReconciled, instance) + } } } diff --git a/internal/deploy/kubectl/runtime-component-operator.yaml b/internal/deploy/kubectl/runtime-component-operator.yaml index 20047248..6c721be6 100644 --- a/internal/deploy/kubectl/runtime-component-operator.yaml +++ b/internal/deploy/kubectl/runtime-component-operator.yaml @@ -302,7 +302,7 @@ spec: - name: WATCH_NAMESPACE value: RUNTIME_COMPONENT_WATCH_NAMESPACE - name: RELATED_IMAGE_LIBERTY_SAMPLE_APP - value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f + value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac - name: RELATED_IMAGE_RUNTIME_COMPONENT_OPERATOR value: icr.io/appcafe/runtime-component-operator:daily image: icr.io/appcafe/runtime-component-operator:daily diff --git a/internal/deploy/kustomize/daily/base/runtime-component-operator.yaml b/internal/deploy/kustomize/daily/base/runtime-component-operator.yaml index d8df75be..907bbd02 100644 --- a/internal/deploy/kustomize/daily/base/runtime-component-operator.yaml +++ b/internal/deploy/kustomize/daily/base/runtime-component-operator.yaml @@ -50,7 +50,7 @@ spec: fieldRef: fieldPath: metadata.namespace - name: RELATED_IMAGE_LIBERTY_SAMPLE_APP - value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:cd4a9cc586dc371c34df44853abd3301bfd9bfde14efa01170625342a070d14f + value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:b99e5af298a800a7d53217be7b33797cedb1eeadc4d5cd14c0c3aafccf21f1ac - name: RELATED_IMAGE_RUNTIME_COMPONENT_OPERATOR value: icr.io/appcafe/runtime-component-operator:daily image: icr.io/appcafe/runtime-component-operator:daily diff --git a/utils/utils.go b/utils/utils.go index 7d2bf1ca..ebe216b6 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -41,7 +41,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" ) -const RCOOperandVersion = "1.3.1" +const RCOOperandVersion = "1.3.2" var APIVersionNotFoundError = errors.New("APIVersion is not available")