Skip to content

Commit 604a02a

Browse files
committed
fix(bundle): remove unused CSV env vars, add relatedImages, improve examples
- Remove unused env vars COMPUTE_PCRS_IMAGE and REG_SERVER_IMAGE from CSV deployment spec since the operator never reads them at runtime (images come from TrustedExecutionCluster CR spec) - Add relatedImages section for air-gapped environment support - Update generate-bundle-prod.sh to patch relatedImages with OPERATOR_IMAGE, COMPUTE_PCRS_IMAGE, REG_SERVER_IMAGE, and TRUSTEE_IMAGE instead of patching deployment env vars - Update Makefile to pass TRUSTEE_IMAGE to bundle generation - Remove Machine from alm-examples as it's auto-created by register-server, not user-facing - Add publicTrusteeAddr field to TrustedExecutionCluster example - Normalize image tags from v0.1.0 to 0.1.0 (standard container format) - Update matchLabels from 'name' to 'app: trusted-cluster-operator' for consistency with operator deployment Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
1 parent 14dc956 commit 604a02a

File tree

3 files changed

+24
-28
lines changed

3 files changed

+24
-28
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ bundle: manifests
113113
@OPERATOR_IMAGE=$(OPERATOR_IMAGE) \
114114
COMPUTE_PCRS_IMAGE=$(COMPUTE_PCRS_IMAGE) \
115115
REG_SERVER_IMAGE=$(REG_SERVER_IMAGE) \
116+
TRUSTEE_IMAGE=$(TRUSTEE_IMAGE) \
116117
scripts/generate-bundle-prod.sh -v $(TAG) -n $(NAMESPACE) $(if $(PREVIOUS_CSV),-p $(PREVIOUS_CSV))
117118

118119
bundle-image: bundle

bundle/static/manifests/trusted-cluster-operator.clusterserviceversion.yaml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,9 @@ metadata:
1616
},
1717
"spec": {
1818
"trusteeImage": "quay.io/trusted-execution-clusters/key-broker-service:tpm-verifier-built-in-as-20250711",
19-
"pcrsComputeImage": "quay.io/trusted-execution-clusters/compute-pcrs:latest",
20-
"registerServerImage": "quay.io/trusted-execution-clusters/registration-server:latest"
21-
}
22-
},
23-
{
24-
"apiVersion": "trusted-execution-clusters.io/v1alpha1",
25-
"kind": "Machine",
26-
"metadata": {
27-
"name": "example-machine"
28-
},
29-
"spec": {
30-
"id": "c3e3e3e3-c3e3-c3e3-c3e3-c3e3e3e3e3e3",
31-
"address": "192.168.1.100"
19+
"pcrsComputeImage": "quay.io/trusted-execution-clusters/compute-pcrs:0.1.0",
20+
"registerServerImage": "quay.io/trusted-execution-clusters/registration-server:0.1.0",
21+
"publicTrusteeAddr": "<trustee-address>"
3222
}
3323
},
3424
{
@@ -43,21 +33,20 @@ metadata:
4333
}
4434
]
4535
olm.skipRange: ">=0.0.0 <1.0.0"
46-
containerImage: "quay.io/trusted-execution-clusters/trusted-cluster-operator:v0.1.0"
36+
containerImage: "quay.io/trusted-execution-clusters/trusted-cluster-operator:0.1.0"
4737
capabilities: Basic Install
4838
name: trusted-cluster-operator.v0.1.0
4939
namespace: placeholder
5040
spec:
5141
displayName: Trusted Execution Cluster Operator
52-
description: An operator to manage trusted execution cluster, which are Kubernetes cluster that can attest their integrity to a relying party
42+
description: An operator to manage a trusted execution cluster, which is a Kubernetes cluster that can attest its integrity to a relying party
5343
version: 0.1.0
5444
minKubeVersion: "1.27.0"
5545
provider:
5646
name: Red Hat
5747
icon:
5848
- base64data: "<base64 PNG>"
5949
mediatype: "image/png"
60-
# replaces: trusted-cluster-operator.vX.Y.Z # Uncomment and set this to the previous CSV name when updating the operator.
6150

6251
maturity: alpha
6352
installModes:
@@ -69,6 +58,15 @@ spec:
6958
supported: false
7059
- type: AllNamespaces
7160
supported: false
61+
relatedImages:
62+
- name: trusted-cluster-operator
63+
image: quay.io/trusted-execution-clusters/trusted-cluster-operator:0.1.0
64+
- name: compute-pcrs
65+
image: quay.io/trusted-execution-clusters/compute-pcrs:0.1.0
66+
- name: registration-server
67+
image: quay.io/trusted-execution-clusters/registration-server:0.1.0
68+
- name: trustee
69+
image: quay.io/trusted-execution-clusters/key-broker-service:tpm-verifier-built-in-as-20250711
7270
install:
7371
strategy: deployment
7472
spec:
@@ -82,19 +80,19 @@ spec:
8280
replicas: 1
8381
selector:
8482
matchLabels:
85-
name: trusted-cluster-operator
83+
app: trusted-cluster-operator
8684
template:
8785
metadata:
8886
labels:
89-
name: trusted-cluster-operator
87+
app: trusted-cluster-operator
9088
spec:
9189
securityContext:
9290
runAsNonRoot: true
9391
runAsUser: 65534
9492
serviceAccountName: trusted-cluster-operator
9593
containers:
9694
- name: trusted-cluster-operator
97-
image: quay.io/trusted-execution-clusters/trusted-cluster-operator:v0.1.0
95+
image: quay.io/trusted-execution-clusters/trusted-cluster-operator:0.1.0
9896
command:
9997
- /usr/bin/operator
10098
imagePullPolicy: IfNotPresent
@@ -109,10 +107,6 @@ spec:
109107
fieldPath: metadata.name
110108
- name: OPERATOR_NAME
111109
value: "trusted-cluster-operator"
112-
- name: COMPUTE_PCRS_IMAGE
113-
value: "quay.io/trusted-execution-clusters/compute-pcrs:v0.1.0"
114-
- name: REGISTER_SERVER_IMAGE
115-
value: "quay.io/trusted-execution-clusters/registration-server:v0.1.0"
116110
resources:
117111
limits:
118112
cpu: 500m

scripts/generate-bundle-prod.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ done
2222
[[ -z "$BUNDLE_VERSION" ]] && { echo "Error: bundle version cannot be empty"; exit 1; }
2323

2424
# Required environment variables
25-
for var in OPERATOR_IMAGE COMPUTE_PCRS_IMAGE REG_SERVER_IMAGE; do
25+
for var in OPERATOR_IMAGE COMPUTE_PCRS_IMAGE REG_SERVER_IMAGE TRUSTEE_IMAGE; do
2626
: "${!var:?Please export $var}"
2727
done
2828

@@ -58,10 +58,11 @@ yq -i ".metadata.annotations.containerImage = \"${OPERATOR_IMAGE}\"" "$CSV_FILE"
5858
# Patch deployment container image
5959
yq -i ".spec.install.spec.deployments[0].spec.template.spec.containers[0].image = \"${OPERATOR_IMAGE}\"" "$CSV_FILE"
6060

61-
# Patch environment variables
62-
for env_var in COMPUTE_PCRS_IMAGE REG_SERVER_IMAGE; do
63-
yq -i "(.spec.install.spec.deployments[0].spec.template.spec.containers[0].env[] | select(.name == \"$env_var\")).value = \"${!env_var}\"" "$CSV_FILE"
64-
done
61+
# Patch relatedImages section for air-gapped environments
62+
yq -i "(.spec.relatedImages[] | select(.name == \"trusted-cluster-operator\")).image = \"${OPERATOR_IMAGE}\"" "$CSV_FILE"
63+
yq -i "(.spec.relatedImages[] | select(.name == \"compute-pcrs\")).image = \"${COMPUTE_PCRS_IMAGE}\"" "$CSV_FILE"
64+
yq -i "(.spec.relatedImages[] | select(.name == \"registration-server\")).image = \"${REG_SERVER_IMAGE}\"" "$CSV_FILE"
65+
yq -i "(.spec.relatedImages[] | select(.name == \"trustee\")).image = \"${TRUSTEE_IMAGE}\"" "$CSV_FILE"
6566

6667
# Patch RBAC rules
6768
yq -i ".spec.install.spec.clusterPermissions[0].rules = load(\"${RBAC_ROLE_FILE}\").rules" "$CSV_FILE"

0 commit comments

Comments
 (0)