From ddf56ed496bbdbe6c90966bde9803d03752cb494 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 19 Feb 2024 11:54:07 +0100 Subject: [PATCH 1/3] chore: Ensure that internal registry in enabled in downstream Signed-off-by: Anatolii Bazko --- .../manifests/devspaces.csv.yaml | 6 +++++- .../build/scripts/sync-che-olm.sh | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml b/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml index 1955cb416f..2758353e02 100644 --- a/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml +++ b/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml @@ -47,7 +47,11 @@ metadata: "namespace": "openshift-devspaces" }, "spec": { - "components": {}, + "components": { + "pluginRegistry" : { + "disableInternalRegistry": "true", + }, + }, "containerRegistry": {}, "devEnvironments": {}, "gitServices": {}, diff --git a/devspaces-operator-bundle/build/scripts/sync-che-olm.sh b/devspaces-operator-bundle/build/scripts/sync-che-olm.sh index dfa844db1b..b3d0fcefc8 100755 --- a/devspaces-operator-bundle/build/scripts/sync-che-olm.sh +++ b/devspaces-operator-bundle/build/scripts/sync-che-olm.sh @@ -231,6 +231,25 @@ for CSVFILE in ${TARGETDIR}/manifests/devspaces.csv.yaml; do echo " ${0##*/} :: Converted (sed) ${CSVFILE}" fi + # Ensure that internal devfile registry is enabled by default in downstream + # See https://github.com/eclipse/che/issues/22485 + ALM_EXAMPLES=$(yq -r '.metadata.annotations["alm-examples"]' "${TARGETDIR}/manifests/devspaces.csv.yaml") + V1_EXAMPLE=$(echo "$ALM_EXAMPLES" | yq '(.[] | select(.apiVersion=="org.eclipse.che/v1"))') + V2_EXAMPLE=$(echo "$ALM_EXAMPLES" | yq '(.[] | select(.apiVersion=="org.eclipse.che/v2"))') + FIXED_V2_EXAMPLE=$(echo "$V2_EXAMPLE" | \ + yq 'del(.spec.components.pluginRegistry.disableInternalRegistry)' | \ + yq 'del(.spec.components.pluginRegistry.externalPluginRegistries)'| \ + yq 'del(.spec.components.pluginRegistry | select(length == 0))') + FIXED_V1_EXAMPLE=$(echo "$V1_EXAMPLE" | \ + yq 'del(.spec.server.externalPluginRegistry)' | \ + yq 'del(.spec.server.pluginRegistryUrl)'| \ + yq 'del(.spec.server | select(length == 0))') + FIXED_ALM_EXAMPLES=$(echo "$ALM_EXAMPLES" | \ + yq '(.[] | select(.apiVersion=="org.eclipse.che/v1")) |= '"$FIXED_V1_EXAMPLE" | \ + yq '(.[] | select(.apiVersion=="org.eclipse.che/v2")) |= '"$FIXED_V2_EXAMPLE" | \ + sed -r 's/"/\\"/g') + yq -riY ".metadata.annotations[\"alm-examples\"] = \"$FIXED_ALM_EXAMPLES\"" "${TARGETDIR}/manifests/devspaces.csv.yaml" + # Change the install Mode to AllNamespaces by default yq -Yi '.spec.installModes[] |= if .type=="OwnNamespace" then .supported |= false else . end' "${CSVFILE}" yq -Yi '.spec.installModes[] |= if .type=="SingleNamespace" then .supported |= false else . end' "${CSVFILE}" From 1f34d2c0f3f3971eedcb702c6761400b15973bf0 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 19 Feb 2024 11:54:44 +0100 Subject: [PATCH 2/3] fixup Signed-off-by: Anatolii Bazko --- .../manifests/devspaces.csv.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml b/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml index 2758353e02..1955cb416f 100644 --- a/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml +++ b/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml @@ -47,11 +47,7 @@ metadata: "namespace": "openshift-devspaces" }, "spec": { - "components": { - "pluginRegistry" : { - "disableInternalRegistry": "true", - }, - }, + "components": {}, "containerRegistry": {}, "devEnvironments": {}, "gitServices": {}, From 162bc6050bff9acc8af98271f60f34f2c6de58aa Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 19 Feb 2024 12:39:00 +0100 Subject: [PATCH 3/3] fixup Signed-off-by: Anatolii Bazko --- .../build/scripts/sync-che-olm.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/devspaces-operator-bundle/build/scripts/sync-che-olm.sh b/devspaces-operator-bundle/build/scripts/sync-che-olm.sh index b3d0fcefc8..541f1fd4b4 100755 --- a/devspaces-operator-bundle/build/scripts/sync-che-olm.sh +++ b/devspaces-operator-bundle/build/scripts/sync-che-olm.sh @@ -237,12 +237,13 @@ for CSVFILE in ${TARGETDIR}/manifests/devspaces.csv.yaml; do V1_EXAMPLE=$(echo "$ALM_EXAMPLES" | yq '(.[] | select(.apiVersion=="org.eclipse.che/v1"))') V2_EXAMPLE=$(echo "$ALM_EXAMPLES" | yq '(.[] | select(.apiVersion=="org.eclipse.che/v2"))') FIXED_V2_EXAMPLE=$(echo "$V2_EXAMPLE" | \ - yq 'del(.spec.components.pluginRegistry.disableInternalRegistry)' | \ - yq 'del(.spec.components.pluginRegistry.externalPluginRegistries)'| \ - yq 'del(.spec.components.pluginRegistry | select(length == 0))') + yq 'del(.spec.components.devfileRegistry.disableInternalRegistry)' | \ + yq 'del(.spec.components.devfileRegistry.externalDevfileRegistries)'| \ + yq 'del(.spec.components.devfileRegistry | select(length == 0))') FIXED_V1_EXAMPLE=$(echo "$V1_EXAMPLE" | \ - yq 'del(.spec.server.externalPluginRegistry)' | \ - yq 'del(.spec.server.pluginRegistryUrl)'| \ + yq 'del(.spec.server.externalDevfileRegistry)' | \ + yq 'del(.spec.server.devfileRegistryUrl)'| \ + yq 'del(.spec.server.externalDevfileRegistries)'| \ yq 'del(.spec.server | select(length == 0))') FIXED_ALM_EXAMPLES=$(echo "$ALM_EXAMPLES" | \ yq '(.[] | select(.apiVersion=="org.eclipse.che/v1")) |= '"$FIXED_V1_EXAMPLE" | \