diff --git a/.github/workflows/minikube-test-helm.yaml b/.github/workflows/minikube-test-helm.yaml index c191f8049..a74fd7074 100644 --- a/.github/workflows/minikube-test-helm.yaml +++ b/.github/workflows/minikube-test-helm.yaml @@ -22,7 +22,7 @@ jobs: id: run-minikube uses: che-incubator/setup-minikube-action@next with: - minikube-version: v1.23.2 + minikube-version: v1.29.0 - name: Install yq run: sudo pip install yq - name: Install chectl diff --git a/.github/workflows/minikube-test-operator.yaml b/.github/workflows/minikube-test-operator.yaml index 91d32cf9a..c320c44c6 100644 --- a/.github/workflows/minikube-test-operator.yaml +++ b/.github/workflows/minikube-test-operator.yaml @@ -22,7 +22,7 @@ jobs: id: run-minikube uses: che-incubator/setup-minikube-action@next with: - minikube-version: v1.23.2 + minikube-version: v1.29.0 - name: Install yq run: sudo pip install yq - name: Install chectl diff --git a/.github/workflows/minikube-test-upgrade-stable-to-next.yaml b/.github/workflows/minikube-test-upgrade-stable-to-next.yaml index d81e96047..26d095718 100644 --- a/.github/workflows/minikube-test-upgrade-stable-to-next.yaml +++ b/.github/workflows/minikube-test-upgrade-stable-to-next.yaml @@ -25,7 +25,7 @@ jobs: id: run-minikube uses: che-incubator/setup-minikube-action@next with: - minikube-version: v1.23.2 + minikube-version: v1.29.0 - name: Install yq run: sudo pip install yq - name: Install chectl diff --git a/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml b/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml index 42f09033b..f7beb7d41 100644 --- a/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml +++ b/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml @@ -25,7 +25,7 @@ jobs: id: run-minikube uses: che-incubator/setup-minikube-action@next with: - minikube-version: v1.23.2 + minikube-version: v1.29.0 - name: Install yq run: sudo pip install yq - name: Install chectl diff --git a/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml b/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml index b98087af9..b7b35840e 100644 --- a/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml @@ -40,6 +40,12 @@ metadata: "enable": true }, "server": { + "externalDevfileRegistries": [ + { + "url": "https://registry.devfile.io" + } + ], + "externalDevfileRegistry": true, "workspaceNamespaceDefault": "-che" }, "storage": { @@ -55,7 +61,16 @@ metadata: "namespace": "eclipse-che" }, "spec": { - "components": {}, + "components": { + "devfileRegistry": { + "disableInternalRegistry": true, + "externalDevfileRegistries": [ + { + "url": "https://registry.devfile.io" + } + ] + } + }, "containerRegistry": {}, "devEnvironments": {}, "gitServices": {}, @@ -77,7 +92,7 @@ metadata: operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/eclipse-che/che-operator support: Eclipse Foundation - name: eclipse-che.v7.82.0-835.next + name: eclipse-che.v7.82.0-842.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1248,7 +1263,7 @@ spec: minKubeVersion: 1.19.0 provider: name: Eclipse Foundation - version: 7.82.0-835.next + version: 7.82.0-842.next webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/config/samples/org_v1_checluster.yaml b/config/samples/org_v1_checluster.yaml index e22975177..9dd8567a1 100644 --- a/config/samples/org_v1_checluster.yaml +++ b/config/samples/org_v1_checluster.yaml @@ -17,7 +17,10 @@ metadata: namespace: eclipse-che spec: server: - workspaceNamespaceDefault: "-che" + workspaceNamespaceDefault: '-che' + externalDevfileRegistry: true + externalDevfileRegistries: + - url: 'https://registry.devfile.io' database: externalDb: false storage: diff --git a/config/samples/org_v2_checluster.yaml b/config/samples/org_v2_checluster.yaml index 8df20648c..bd29d2788 100644 --- a/config/samples/org_v2_checluster.yaml +++ b/config/samples/org_v2_checluster.yaml @@ -16,7 +16,11 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - components: {} + components: + devfileRegistry: + disableInternalRegistry: true + externalDevfileRegistries: + - url: 'https://registry.devfile.io' devEnvironments: {} networking: {} containerRegistry: {} diff --git a/deploy/deployment/kubernetes/org_v2_checluster.yaml b/deploy/deployment/kubernetes/org_v2_checluster.yaml index 8df20648c..bd29d2788 100644 --- a/deploy/deployment/kubernetes/org_v2_checluster.yaml +++ b/deploy/deployment/kubernetes/org_v2_checluster.yaml @@ -16,7 +16,11 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - components: {} + components: + devfileRegistry: + disableInternalRegistry: true + externalDevfileRegistries: + - url: 'https://registry.devfile.io' devEnvironments: {} networking: {} containerRegistry: {} diff --git a/deploy/deployment/openshift/org_v2_checluster.yaml b/deploy/deployment/openshift/org_v2_checluster.yaml index 8df20648c..bd29d2788 100644 --- a/deploy/deployment/openshift/org_v2_checluster.yaml +++ b/deploy/deployment/openshift/org_v2_checluster.yaml @@ -16,7 +16,11 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - components: {} + components: + devfileRegistry: + disableInternalRegistry: true + externalDevfileRegistries: + - url: 'https://registry.devfile.io' devEnvironments: {} networking: {} containerRegistry: {} diff --git a/helmcharts/next/templates/org_v2_checluster.yaml b/helmcharts/next/templates/org_v2_checluster.yaml index 9c7809878..aacc4ae65 100644 --- a/helmcharts/next/templates/org_v2_checluster.yaml +++ b/helmcharts/next/templates/org_v2_checluster.yaml @@ -16,7 +16,11 @@ metadata: name: eclipse-che namespace: eclipse-che spec: - components: {} + components: + devfileRegistry: + disableInternalRegistry: true + externalDevfileRegistries: + - url: 'https://registry.devfile.io' devEnvironments: {} networking: tlsSecretName: che-tls diff --git a/pkg/deploy/devfileregistry/devfileregistry.go b/pkg/deploy/devfileregistry/devfileregistry.go index b6de69c14..755ebfc60 100644 --- a/pkg/deploy/devfileregistry/devfileregistry.go +++ b/pkg/deploy/devfileregistry/devfileregistry.go @@ -1,5 +1,5 @@ // -// Copyright (c) 2019-2023 Red Hat, Inc. +// Copyright (c) 2019-2024 Red Hat, Inc. // This program and the accompanying materials are made // available under the terms of the Eclipse Public License 2.0 // which is available at https://www.eclipse.org/legal/epl-2.0/ @@ -15,6 +15,9 @@ package devfileregistry import ( "fmt" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + "github.com/eclipse-che/che-operator/pkg/common/chetypes" "github.com/eclipse-che/che-operator/pkg/common/constants" "github.com/eclipse-che/che-operator/pkg/deploy" @@ -33,9 +36,18 @@ func NewDevfileRegistryReconciler() *DevfileRegistryReconciler { func (d *DevfileRegistryReconciler) Reconcile(ctx *chetypes.DeployContext) (reconcile.Result, bool, error) { if ctx.CheCluster.Spec.Components.DevfileRegistry.DisableInternalRegistry { - ctx.CheCluster.Status.DevfileRegistryURL = "" - err := deploy.UpdateCheCRStatus(ctx, "DevfileRegistryURL", "") - return reconcile.Result{}, err == nil, err + _, _ = deploy.DeleteNamespacedObject(ctx, constants.DevfileRegistryName, &corev1.Service{}) + _, _ = deploy.DeleteNamespacedObject(ctx, constants.DevfileRegistryName, &corev1.ConfigMap{}) + _, _ = deploy.DeleteNamespacedObject(ctx, gateway.GatewayConfigMapNamePrefix+constants.DevfileRegistryName, &corev1.ConfigMap{}) + _, _ = deploy.DeleteNamespacedObject(ctx, constants.DevfileRegistryName, &appsv1.Deployment{}) + + if ctx.CheCluster.Status.DevfileRegistryURL != "" { + ctx.CheCluster.Status.DevfileRegistryURL = "" + err := deploy.UpdateCheCRStatus(ctx, "DevfileRegistryURL", "") + return reconcile.Result{}, err == nil, err + } + + return reconcile.Result{}, true, nil } done, err := d.syncService(ctx)