From 6a78cc8c882c0fb0476e969f9cd538f54c1b1353 Mon Sep 17 00:00:00 2001 From: Sayan Biswas Date: Wed, 25 Nov 2026 16:01:41 +0530 Subject: [PATCH] fix(shipwright): append version info to release manifests Changes: - Add a method in fetch_release.sh script to append Shipwright Build and Shared Resource version info ConfigMap - Adjust version info ConfigMap name in the controllers Signed-off-by: Sayan Biswas --- hack/fetch-releases.sh | 28 +++++++++++++++++++ .../kubernetes/shipwrightbuild/common.go | 2 +- .../openshift/sharedresource/common.go | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/hack/fetch-releases.sh b/hack/fetch-releases.sh index ea85e27ce4..a52a881109 100755 --- a/hack/fetch-releases.sh +++ b/hack/fetch-releases.sh @@ -343,6 +343,32 @@ release_yaml_custom() { done } +append_version_info_config_map() { + local component=$1 + local repository=$(yq ."${component}".github "${CONFIG}") + local version=$(yq ."${component}".version "${CONFIG}") + local destination=${SCRIPT_DIR}/cmd/${TARGET}/operator/kodata/${component}/${version//v}/release.yaml + + if [[ ! -f "${destination}" ]]; then + echo "Error: ${destination} not found, cannot append ConfigMap" + fi + + printf '\n---\n' >> "${destination}" + cat >> "${destination}" << EOF +apiVersion: v1 +kind: ConfigMap +metadata: + name: ${component}-info + namespace: tekton-pipelines + labels: + app.kubernetes.io/instance: default + app.kubernetes.io/part-of: ${component%-*} +data: + version: "${version}" +EOF + +} + fetch_openshift_build_strategies() { local shipwright_version=$(yq .shipwright-build.version ${CONFIG}) local strategy_repository="redhat-openshift-builds/strategies" @@ -495,10 +521,12 @@ main() { else release_yaml_custom shipwright-build "" "" true release.yaml sample-strategies.yaml fi + append_version_info_config_map shipwright-build # Shared Resource CSI Driver if [[ ${TARGET} == "openshift" ]]; then release_yaml_custom shared-resource "" "" true release.yaml + append_version_info_config_map shared-resource fi echo updated payload tree diff --git a/pkg/reconciler/kubernetes/shipwrightbuild/common.go b/pkg/reconciler/kubernetes/shipwrightbuild/common.go index daae89ae58..de7c072d8f 100644 --- a/pkg/reconciler/kubernetes/shipwrightbuild/common.go +++ b/pkg/reconciler/kubernetes/shipwrightbuild/common.go @@ -7,7 +7,7 @@ const ( ControllerDeploymentName = "shipwright-build-controller" KindClusterBuildStrategy = "ClusterBuildStrategy" OperandName = "shipwright-build" - VersionConfigMap = "shipwright-build" + VersionConfigMap = "shipwright-build-info" WebhookContainerName = "shipwright-build-webhook" WebhookDeploymentName = "shipwright-build-webhook" // WebhookSecretName / WebhookServiceName / WebhookSecretDuration describe the diff --git a/pkg/reconciler/openshift/sharedresource/common.go b/pkg/reconciler/openshift/sharedresource/common.go index 3f56678725..5869ba5bcc 100644 --- a/pkg/reconciler/openshift/sharedresource/common.go +++ b/pkg/reconciler/openshift/sharedresource/common.go @@ -31,7 +31,7 @@ const ( // VersionConfigMap is the ConfigMap that carries the installed component // version. It must match v1alpha1.SharedResourceResourceName so that the // init controller selects the shared-resource payload. - VersionConfigMap = "shared-resource" + VersionConfigMap = "shared-resource-info" // ServiceName is the service used to for CSI driver node. ServiceName = "shared-resource-csi-driver-node" // ServiceMonitorName is the name of the Service Monitor