Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Removes devfile-registry deployment component #1876

Merged
merged 3 commits into from
Aug 7, 2024
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
6 changes: 3 additions & 3 deletions api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ type PluginRegistry struct {
// Configuration settings related to the devfile registry used by the Che installation.
// +k8s:openapi-gen=true
type DevfileRegistry struct {
// Deployment override options.
// Deprecated deployment override options.
// +optional
Deployment *Deployment `json:"deployment,omitempty"`
// Disables internal devfile registry.
Expand Down Expand Up @@ -857,7 +857,7 @@ type CheClusterStatus struct {
// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="ChePhase"
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors="urn:alm:descriptor:text"
ChePhase CheClusterPhase `json:"chePhase,omitempty"`
// The public URL of the internal devfile registry.
// Deprecated the public URL of the internal devfile registry.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=status
// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Devfile registry URL"
Expand Down Expand Up @@ -893,7 +893,7 @@ type CheClusterStatus struct {

// The `CheCluster` custom resource allows defining and managing Eclipse Che server installation.
// Based on these settings, the Operator automatically creates and maintains several ConfigMaps:
// `che`, `plugin-registry`, `devfile-registry` that will contain the appropriate environment variables
// `che`, `plugin-registry` that will contain the appropriate environment variables
// of the various components of the installation. These generated ConfigMaps must NOT be updated manually.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
Expand Down
56 changes: 0 additions & 56 deletions build/scripts/dockerContainerExtract.sh

This file was deleted.

8 changes: 0 additions & 8 deletions build/scripts/minikube-tests/minikube-checluster-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ spec:
cpu: '20m'
limits:
cpu: '20m'
devfileRegistry:
deployment:
containers:
- resources:
request:
cpu: '20m'
limits:
cpu: '20m'
cheServer:
deployment:
containers:
Expand Down
4 changes: 1 addition & 3 deletions build/scripts/minikube-tests/test-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ runTest() {

# Patch CheCluster CR to limit resources (see minikube-checluster-patch.yaml)
CHECLUSTER_CR="${HELMCHART_DIR}"/templates/org_v2_checluster.yaml
yq -riY '.spec.components = null' ${CHECLUSTER_CR}
yq -riY '.spec.components.pluginRegistry.openVSXURL = "https://open-vsx.org"' ${CHECLUSTER_CR}
for component in pluginRegistry devfileRegistry dashboard; do
for component in dashboard; do
yq -riY '.spec.components.'${component}'.deployment.containers[0].resources = {limits: {cpu: "50m"}, request: {cpu: "50m"}}' ${CHECLUSTER_CR}
done
yq -riY '.spec.components.cheServer.deployment.containers[0].resources.limits.cpu = "500m"' ${CHECLUSTER_CR}
Expand Down
160 changes: 0 additions & 160 deletions build/scripts/oc-tests/oc-test-disconnected.sh

This file was deleted.

18 changes: 1 addition & 17 deletions build/scripts/release/addDigests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ do
source=$(echo "${mapping}" | sed -e 's;\(.*\)=.*=.*;\1;')
# Image with digest.
dest=$(echo "${mapping}" | sed -e 's;.*=.*=\(.*\);\1;')
# Image label to set image target. For example: 'devfile-registry-image'
imageLabel=$(echo "${mapping}" | sed -e 's;.*=\(.*\)=.*;\1;')
name=$(echo "${dest}" | sed -e 's;.*/\([^\/][^\/]*\)@.*;\1;')
tagOrDigest=""
if [[ ${source} == *"@"* ]]; then
Expand All @@ -94,20 +92,6 @@ do
tagOrDigest="${source#*:}"
fi

if [[ ${imageLabel} == "devfile-registry-image" ]]; then
# Image tag could contains invalid for Env variable name characters, so let's encode it using base32.
# But alphabet of base32 uses one invalid for env variable name character '=' at the end of the line, so let's replace it by '_'.
# To recovery original tag should be done opposite actions: replace '_' to '=', and decode string using 'base32 -d'.
encodedTag=$(echo "${tagOrDigest}" | base32 -w 0 | tr "=" "_")
relatedImageEnvName=$(echo "${RELATED_IMAGE_PREFIX}${name}_${imageLabel}_${encodedTag}" | sed -r 's/[-.]/_/g')
ENV="{ name: \"${relatedImageEnvName}\", value: \"${dest}\"}"
if [[ -z ${RELATED_IMAGES_ENV} ]]; then
RELATED_IMAGES_ENV="${ENV}"
elif [[ ! ${RELATED_IMAGES_ENV} =~ ${relatedImageEnvName} ]]; then
RELATED_IMAGES_ENV="${RELATED_IMAGES_ENV}, ${ENV}"
fi
fi

relatedImageName=${name}-${tagOrDigest}
RELATED_IMAGE="{ name: \"${relatedImageName}\", image: \"${dest}\", tag: \"${source}\"}"
if [[ -z ${RELATED_IMAGES} ]]; then
Expand All @@ -131,7 +115,7 @@ if [[ ${OPERATOR_FILE} ]]; then
i=0
while [ "${i}" -lt "${envVarLength}" ]; do
envVarName=$(cat "${OPERATOR_FILE}" | yq -r '.spec.template.spec.containers[0].env['${i}'].name')
if [[ ${envVarName} =~ plugin_registry_image ]] || [[ ${envVarName} =~ devfile_registry_image ]]; then
if [[ ${envVarName} =~ editor_definition ]]; then
yq -riY 'del(.spec.template.spec.containers[0].env['${i}'])' ${OPERATOR_FILE}
i=$((i-1))
fi
Expand Down
14 changes: 0 additions & 14 deletions build/scripts/release/buildDigestMap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ setOperatorImage() {
OPERATOR_IMAGE=$(yq -r '.spec.install.spec.deployments[].spec.template.spec.containers[0].image' "${CSV}")
}

setDevfileRegistryList() {
registry=$(yq -r '.spec.install.spec.deployments[].spec.template.spec.containers[].env[] | select(.name | test("RELATED_IMAGE_.*devfile_registry"; "g")) | .value' "${CSV}")

setRegistryImages "${registry}"
DEVFILE_REGISTRY_LIST=${registryImages}
}

setRegistryImages() {
registry="${1}"
registry="${registry/\@sha256:*/:${IMAGE_TAG}}" # remove possible existing @sha256:... and use current tag instead
Expand Down Expand Up @@ -139,9 +132,6 @@ setImagesFromDeploymentEnv
setOperatorImage
echo "${OPERATOR_IMAGE}"

setDevfileRegistryList
echo "${DEVFILE_REGISTRY_LIST}"

DIGEST_FILE=${SCRIPTS_DIR}/generated/digests-mapping.txt
rm -Rf "${DIGEST_FILE}"
touch "${DIGEST_FILE}"
Expand All @@ -151,7 +141,3 @@ writeDigest "${OPERATOR_IMAGE}" "operator-image"
for image in ${REQUIRED_IMAGES}; do
writeDigest "${image}" "required-image"
done

for image in ${DEVFILE_REGISTRY_LIST}; do
writeDigest "${image}" "devfile-registry-image"
done
2 changes: 0 additions & 2 deletions build/scripts/release/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ init() {
CHE_SERVER_IMAGE=$(yq -r '.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_che_server") | .value' "${MANAGER_YAML}" | sed -e "s/\(.*:\).*/\1${RELEASE}/")
CHE_DASHBOARD_IMAGE=$(yq -r '.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_dashboard") | .value' "${MANAGER_YAML}" | sed -e "s/\(.*:\).*/\1${RELEASE}/")
CHE_PLUGIN_REGISTRY_IMAGE=$(yq -r '.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_plugin_registry") | .value' "${MANAGER_YAML}" | sed -e "s/\(.*:\).*/\1${RELEASE}/")
CHE_DEVFILE_REGISTRY_IMAGE=$(yq -r '.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_devfile_registry") | .value' "${MANAGER_YAML}" | sed -e "s/\(.*:\).*/\1${RELEASE}/")
CHE_GATEWAY_IMAGE=$(yq -r '.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_single_host_gateway_config_sidecar") | .value' "${MANAGER_YAML}" | sed -e "s/\(.*:\).*/\1${RELEASE}/")

if [[ $# -lt 1 ]]; then usage; exit; fi
Expand Down Expand Up @@ -102,7 +101,6 @@ releaseManagerYaml() {
yq -riY '(.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_che_server") | .value) = "'${CHE_SERVER_IMAGE}'"' "${MANAGER_YAML}"
yq -riY '(.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_dashboard") | .value) = "'${CHE_DASHBOARD_IMAGE}'"' "${MANAGER_YAML}"
yq -riY '(.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_plugin_registry") | .value) = "'${CHE_PLUGIN_REGISTRY_IMAGE}'"' "${MANAGER_YAML}"
yq -riY '(.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_devfile_registry") | .value) = "'${CHE_DEVFILE_REGISTRY_IMAGE}'"' "${MANAGER_YAML}"
yq -riY '(.spec.template.spec.containers[0].env[] | select(.name=="RELATED_IMAGE_single_host_gateway_config_sidecar") | .value) = "'${CHE_GATEWAY_IMAGE}'"' "${MANAGER_YAML}"

echo "[INFO] releaseManagerYaml :: Update editors definitions images"
Expand Down
Loading
Loading