Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bundle-manifests: clis
$(YQ) eval -i '.spec.webhookdefinitions[0].deploymentName = "ibm-common-service-operator" | .spec.webhookdefinitions[1].deploymentName = "ibm-common-service-operator"' ${CSV_PATH}
$(YQ) eval-all -i '.spec.relatedImages = load("config/manifests/bases/ibm-common-service-operator.clusterserviceversion.yaml").spec.relatedImages' bundle/manifests/ibm-common-service-operator.clusterserviceversion.yaml

generate-all: yq kustomize operator-sdk generate manifests ## Generate bundle manifests, metadata and package manifests
generate-all: yq kustomize operator-sdk generate manifests cloudpak-theme-version ## Generate bundle manifests, metadata and package manifests
$(OPERATOR_SDK) generate kustomize manifests -q
- make bundle-manifests CHANNELS=v4.6 DEFAULT_CHANNEL=v4.6

Expand Down
25 changes: 13 additions & 12 deletions api/v3/commonservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

type CSData struct {
Channel string
Version string
CPFSNs string
ServicesNs string
OperatorNs string
CatalogSourceName string
CatalogSourceNs string
IsolatedModeEnable string
ApprovalMode string
OnPremMultiEnable string
WatchNamespaces string
CloudPakThemes string
Channel string
Version string
CPFSNs string
ServicesNs string
OperatorNs string
CatalogSourceName string
CatalogSourceNs string
IsolatedModeEnable string
ApprovalMode string
OnPremMultiEnable string
WatchNamespaces string
CloudPakThemes string
CloudPakThemesVersion string
}

// +kubebuilder:pruning:PreserveUnknownFields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ metadata:
}
]
capabilities: Seamless Upgrades
cloudPakThemesVersion: styles460.css
containerImage: icr.io/cpopen/common-service-operator:latest
createdAt: "2024-04-03T14:59:21Z"
createdAt: "2024-04-11T02:45:28Z"
description: The IBM Cloud Pak foundational services operator is used to deploy IBM foundational services.
nss.operator.ibm.com/managed-operators: ibm-common-service-operator
nss.operator.ibm.com/managed-webhooks: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
annotations:
alm-examples: '[]'
capabilities: Seamless Upgrades
cloudPakThemesVersion: styles460.css
containerImage: icr.io/cpopen/common-service-operator:latest
createdAt: "2020-10-19T21:38:33Z"
description: The IBM Cloud Pak foundational services operator is used to deploy
Expand Down
5 changes: 5 additions & 0 deletions controllers/bootstrap/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ func NewBootstrap(mgr manager.Manager) (bs *Bootstrap, err error) {
if r, ok := annotations["operatorVersion"]; ok {
bs.CSData.Version = r
}

if r, ok := annotations["cloudPakThemesVersion"]; ok {
bs.CSData.CloudPakThemesVersion = r
}

klog.Infof("Single Deployment Status: %v, MultiInstance Deployment status: %v, SaaS Depolyment Status: %v", !bs.MultiInstancesEnable, bs.MultiInstancesEnable, bs.SaasEnable)
return
}
Expand Down
1 change: 1 addition & 0 deletions controllers/constant/keycloakThemes.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ metadata:
operator.ibm.com/managedByCsOperator: "true"
annotations:
version: {{ .Version }}
themesVersion: {{ .CloudPakThemesVersion }}
binaryData:
cloudpak-theme.jar: {{ .CloudPakThemes }}
`
4 changes: 2 additions & 2 deletions controllers/constant/odlm.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,13 +647,13 @@ spec:
podTemplate:
metadata:
annotations:
cpfsVersion:
cloudpakThemesVersion:
templatingValueFrom:
objectRef:
apiVersion: v1
kind: ConfigMap
name: cs-keycloak-theme
path: .metadata.annotations.version
path: .metadata.annotations.themesVersion
required: true
spec:
containers:
Expand Down
9 changes: 8 additions & 1 deletion hack/keycloak-themes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ default: cloudpak-theme.jar
cloudpak-theme.jar:
@echo "Building the keycloak jar theme..."
rm $(KEYCLOAK_THEME_DIR)/$(JAR_THEME_FILE) || true
(cd $(KEYCLOAK_THEME_DIR) && zip -r ./$(JAR_THEME_FILE) META-INF theme)
(cd $(KEYCLOAK_THEME_DIR) && zip -r ./$(JAR_THEME_FILE) META-INF theme)

cloudpak-theme-version:
$(eval THEME_VERSION := $(shell ls $(KEYCLOAK_THEME_DIR)/theme/cloudpak/login/resources/css/ | grep .css))
@echo "Updating the keycloak jar theme version to $(THEME_VERSION)"
$(YQ) eval -i '.spec.template.metadata.annotations.cloudPakThemesVersion = "$(THEME_VERSION)"' $(KEYCLOAK_THEME_DIR)/../../testdata/deploy/deploy.yaml
$(YQ) eval -i '.metadata.annotations.cloudPakThemesVersion = "$(THEME_VERSION)"' $(KEYCLOAK_THEME_DIR)/../../config/manifests/bases/ibm-common-service-operator.clusterserviceversion.yaml
$(YQ) eval -i '.metadata.annotations.cloudPakThemesVersion = "$(THEME_VERSION)"' $(KEYCLOAK_THEME_DIR)/../../bundle/manifests/ibm-common-service-operator.clusterserviceversion.yaml
65 changes: 33 additions & 32 deletions testdata/deploy/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,45 @@ spec:
description: The IBM Common Service Operator is used to deploy IBM Common Services
operatorChannel: v4.6
operatorVersion: 4.6.0
cloudPakThemesVersion: styles460.css
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
containers:
- command:
- /manager
env:
- name: OPERATOR_NAME
value: ibm-common-service-operator
image: siji/operator:cs
imagePullPolicy: IfNotPresent
name: ibm-common-service-operator
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 200Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
- command:
- /manager
env:
- name: OPERATOR_NAME
value: ibm-common-service-operator
image: siji/operator:cs
imagePullPolicy: IfNotPresent
name: ibm-common-service-operator
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 200Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
Expand Down