From 7f051fa08d029def52fcc29ecdf019e9943f7907 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 3 Aug 2022 10:35:24 +0300 Subject: [PATCH] feat: Configure Open VSX registry URL (#1466) * feat: Configure Open VSX registry URL Signed-off-by: Anatolii Bazko --- api/checluster_conversion_from_test.go | 2 ++ api/checluster_conversion_to_test.go | 2 ++ api/v1/checluster_conversion_from.go | 1 + api/v1/checluster_conversion_to.go | 1 + api/v1/checluster_types.go | 3 +++ api/v2/checluster_types.go | 3 +++ .../manifests/che-operator.clusterserviceversion.yaml | 4 ++-- .../manifests/org.eclipse.che_checlusters.yaml | 8 ++++++++ config/crd/bases/org.eclipse.che_checlusters.yaml | 8 ++++++++ deploy/deployment/kubernetes/combined.yaml | 6 ++++++ ...clusters.org.eclipse.che.CustomResourceDefinition.yaml | 6 ++++++ deploy/deployment/openshift/combined.yaml | 6 ++++++ ...clusters.org.eclipse.che.CustomResourceDefinition.yaml | 6 ++++++ ...clusters.org.eclipse.che.CustomResourceDefinition.yaml | 6 ++++++ 14 files changed, 60 insertions(+), 2 deletions(-) diff --git a/api/checluster_conversion_from_test.go b/api/checluster_conversion_from_test.go index 1f23e3205..3e7a98886 100644 --- a/api/checluster_conversion_from_test.go +++ b/api/checluster_conversion_from_test.go @@ -175,6 +175,7 @@ func TestConvertFrom(t *testing.T) { Url: "ExternalPluginRegistries_2", }, }, + OpenVSXURL: "open-vsx-registry", }, DevfileRegistry: chev2.DevfileRegistry{ Deployment: &chev2.Deployment{ @@ -442,6 +443,7 @@ func TestConvertFrom(t *testing.T) { assert.Equal(t, checlusterv1.Spec.Server.ExternalPluginRegistry, true) assert.Equal(t, checlusterv1.Spec.Server.GitSelfSignedCert, true) assert.Equal(t, checlusterv1.Spec.Server.NonProxyHosts, "NonProxyHosts_1|NonProxyHosts_2") + assert.Equal(t, checlusterv1.Spec.Server.OpenVSXRegistryURL, "open-vsx-registry") assert.Equal(t, checlusterv1.Spec.Server.PluginRegistryCpuLimit, "2") assert.Equal(t, checlusterv1.Spec.Server.PluginRegistryCpuRequest, "1") assert.Equal(t, checlusterv1.Spec.Server.PluginRegistryImage, "PluginRegistryImage") diff --git a/api/checluster_conversion_to_test.go b/api/checluster_conversion_to_test.go index 379faeab1..6f886e2e7 100644 --- a/api/checluster_conversion_to_test.go +++ b/api/checluster_conversion_to_test.go @@ -227,6 +227,7 @@ func TestConvertTo(t *testing.T) { Effect: "Effect", }, }, + OpenVSXRegistryURL: "open-vsx-registry", }, Database: chev1.CheClusterSpecDB{ ExternalDb: true, @@ -411,6 +412,7 @@ func TestConvertTo(t *testing.T) { assert.Equal(t, checlusterv2.Spec.Components.PluginRegistry.Deployment.Containers[0].Resources.Requests.Cpu, resource.MustParse("1")) assert.Equal(t, checlusterv2.Spec.Components.PluginRegistry.Deployment.Containers[0].Resources.Requests.Memory, resource.MustParse("100Mi")) assert.Equal(t, checlusterv2.Spec.Components.PluginRegistry.DisableInternalRegistry, true) + assert.Equal(t, checlusterv2.Spec.Components.PluginRegistry.OpenVSXURL, "open-vsx-registry") assert.Equal(t, checlusterv2.Spec.Components.PluginRegistry.ExternalPluginRegistries, []chev2.ExternalPluginRegistry{{Url: "PluginRegistryUrl"}}) assert.Equal(t, checlusterv2.Spec.DevEnvironments.Storage.Pvc.ClaimSize, "WorkspacePvcClaimSize") diff --git a/api/v1/checluster_conversion_from.go b/api/v1/checluster_conversion_from.go index ada1a6739..188958d09 100644 --- a/api/v1/checluster_conversion_from.go +++ b/api/v1/checluster_conversion_from.go @@ -180,6 +180,7 @@ func (dst *CheCluster) convertFrom_Server(src *chev2.CheCluster) error { } func (dst *CheCluster) convertFrom_Server_PluginRegistry(src *chev2.CheCluster) error { + dst.Spec.Server.OpenVSXRegistryURL = src.Spec.Components.PluginRegistry.OpenVSXURL dst.Spec.Server.ExternalPluginRegistry = src.Spec.Components.PluginRegistry.DisableInternalRegistry if src.Spec.Components.PluginRegistry.DisableInternalRegistry { diff --git a/api/v1/checluster_conversion_to.go b/api/v1/checluster_conversion_to.go index 11b12192d..046c60211 100644 --- a/api/v1/checluster_conversion_to.go +++ b/api/v1/checluster_conversion_to.go @@ -394,6 +394,7 @@ func (src *CheCluster) convertTo_Components_CheServer(dst *chev2.CheCluster) err } func (src *CheCluster) convertTo_Components_PluginRegistry(dst *chev2.CheCluster) error { + dst.Spec.Components.PluginRegistry.OpenVSXURL = src.Spec.Server.OpenVSXRegistryURL dst.Spec.Components.PluginRegistry.DisableInternalRegistry = src.Spec.Server.ExternalPluginRegistry if dst.Spec.Components.PluginRegistry.DisableInternalRegistry { diff --git a/api/v1/checluster_types.go b/api/v1/checluster_types.go index 3e633c813..fbb5033f6 100644 --- a/api/v1/checluster_types.go +++ b/api/v1/checluster_types.go @@ -366,6 +366,9 @@ type CheClusterSpecServer struct { // These default components are meant to be used when a Devfile does not contain any components. // +optional WorkspaceDefaultComponents []devfile.Component `json:"workspaceDefaultComponents,omitempty"` + // Open VSX registry URL. If omitted an embedded instance will be used. + // +optional + OpenVSXRegistryURL string `json:"openVSXRegistryURL,omitempty"` } // +k8s:openapi-gen=true diff --git a/api/v2/checluster_types.go b/api/v2/checluster_types.go index 84c32a645..0c7be5127 100644 --- a/api/v2/checluster_types.go +++ b/api/v2/checluster_types.go @@ -242,6 +242,9 @@ type PluginRegistry struct { // External plugin registries. // +optional ExternalPluginRegistries []ExternalPluginRegistry `json:"externalPluginRegistries,omitempty"` + // Open VSX registry URL. If omitted an embedded instance will be used. + // +optional + OpenVSXURL string `json:"openVSXURL,omitempty"` } // Configuration settings related to the devfile registry used by the Che installation. diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml index 605f899e9..3bc66a579 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml @@ -76,7 +76,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-preview-openshift.v7.52.0-639.next + name: eclipse-che-preview-openshift.v7.52.0-642.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1390,7 +1390,7 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.52.0-639.next + version: 7.52.0-642.next webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml index afa678e36..fb6854cbb 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml @@ -888,6 +888,10 @@ spec: resources. See the doc https://docs.openshift.com/container-platform/4.4/networking/enable-cluster-wide-proxy.html. See also the `proxyURL` fields.' type: string + openVSXRegistryURL: + description: Open VSX registry URL. If omitted an embedded instance + will be used. + type: string pluginRegistryCpuLimit: description: Overrides the CPU limit used in the plugin registry deployment. In cores. (500m = .5 cores). Default to 500m. @@ -3622,6 +3626,10 @@ spec: type: string type: object type: array + openVSXURL: + description: Open VSX registry URL. If omitted an embedded + instance will be used. + type: string type: object type: object containerRegistry: diff --git a/config/crd/bases/org.eclipse.che_checlusters.yaml b/config/crd/bases/org.eclipse.che_checlusters.yaml index c4f69d05e..75c39615a 100644 --- a/config/crd/bases/org.eclipse.che_checlusters.yaml +++ b/config/crd/bases/org.eclipse.che_checlusters.yaml @@ -857,6 +857,10 @@ spec: resources. See the doc https://docs.openshift.com/container-platform/4.4/networking/enable-cluster-wide-proxy.html. See also the `proxyURL` fields.' type: string + openVSXRegistryURL: + description: Open VSX registry URL. If omitted an embedded instance + will be used. + type: string pluginRegistryCpuLimit: description: Overrides the CPU limit used in the plugin registry deployment. In cores. (500m = .5 cores). Default to 500m. @@ -3521,6 +3525,10 @@ spec: type: string type: object type: array + openVSXURL: + description: Open VSX registry URL. If omitted an embedded + instance will be used. + type: string type: object type: object containerRegistry: diff --git a/deploy/deployment/kubernetes/combined.yaml b/deploy/deployment/kubernetes/combined.yaml index ebe49c69f..d5af7d87f 100644 --- a/deploy/deployment/kubernetes/combined.yaml +++ b/deploy/deployment/kubernetes/combined.yaml @@ -544,6 +544,9 @@ spec: nonProxyHosts: description: 'List of hosts that will be reached directly, bypassing the proxy. Specify wild card domain use the following form `.` and `|` as delimiter, for example: `localhost|.my.host.com|123.42.12.32` Only use when configuring a proxy is required. Operator respects OpenShift cluster wide proxy configuration and no additional configuration is required, but defining `nonProxyHosts` in a custom resource leads to merging non proxy hosts lists from the cluster proxy configuration and ones defined in the custom resources. See the doc https://docs.openshift.com/container-platform/4.4/networking/enable-cluster-wide-proxy.html. See also the `proxyURL` fields.' type: string + openVSXRegistryURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string pluginRegistryCpuLimit: description: Overrides the CPU limit used in the plugin registry deployment. In cores. (500m = .5 cores). Default to 500m. type: string @@ -2389,6 +2392,9 @@ spec: type: string type: object type: array + openVSXURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string type: object type: object containerRegistry: diff --git a/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index ac35e5d96..3a8845cb0 100644 --- a/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -539,6 +539,9 @@ spec: nonProxyHosts: description: 'List of hosts that will be reached directly, bypassing the proxy. Specify wild card domain use the following form `.` and `|` as delimiter, for example: `localhost|.my.host.com|123.42.12.32` Only use when configuring a proxy is required. Operator respects OpenShift cluster wide proxy configuration and no additional configuration is required, but defining `nonProxyHosts` in a custom resource leads to merging non proxy hosts lists from the cluster proxy configuration and ones defined in the custom resources. See the doc https://docs.openshift.com/container-platform/4.4/networking/enable-cluster-wide-proxy.html. See also the `proxyURL` fields.' type: string + openVSXRegistryURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string pluginRegistryCpuLimit: description: Overrides the CPU limit used in the plugin registry deployment. In cores. (500m = .5 cores). Default to 500m. type: string @@ -2384,6 +2387,9 @@ spec: type: string type: object type: array + openVSXURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string type: object type: object containerRegistry: diff --git a/deploy/deployment/openshift/combined.yaml b/deploy/deployment/openshift/combined.yaml index 28335f6f6..96552f644 100644 --- a/deploy/deployment/openshift/combined.yaml +++ b/deploy/deployment/openshift/combined.yaml @@ -544,6 +544,9 @@ spec: nonProxyHosts: description: 'List of hosts that will be reached directly, bypassing the proxy. Specify wild card domain use the following form `.` and `|` as delimiter, for example: `localhost|.my.host.com|123.42.12.32` Only use when configuring a proxy is required. Operator respects OpenShift cluster wide proxy configuration and no additional configuration is required, but defining `nonProxyHosts` in a custom resource leads to merging non proxy hosts lists from the cluster proxy configuration and ones defined in the custom resources. See the doc https://docs.openshift.com/container-platform/4.4/networking/enable-cluster-wide-proxy.html. See also the `proxyURL` fields.' type: string + openVSXRegistryURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string pluginRegistryCpuLimit: description: Overrides the CPU limit used in the plugin registry deployment. In cores. (500m = .5 cores). Default to 500m. type: string @@ -2389,6 +2392,9 @@ spec: type: string type: object type: array + openVSXURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string type: object type: object containerRegistry: diff --git a/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index b20d72133..cce59c71c 100644 --- a/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -539,6 +539,9 @@ spec: nonProxyHosts: description: 'List of hosts that will be reached directly, bypassing the proxy. Specify wild card domain use the following form `.` and `|` as delimiter, for example: `localhost|.my.host.com|123.42.12.32` Only use when configuring a proxy is required. Operator respects OpenShift cluster wide proxy configuration and no additional configuration is required, but defining `nonProxyHosts` in a custom resource leads to merging non proxy hosts lists from the cluster proxy configuration and ones defined in the custom resources. See the doc https://docs.openshift.com/container-platform/4.4/networking/enable-cluster-wide-proxy.html. See also the `proxyURL` fields.' type: string + openVSXRegistryURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string pluginRegistryCpuLimit: description: Overrides the CPU limit used in the plugin registry deployment. In cores. (500m = .5 cores). Default to 500m. type: string @@ -2384,6 +2387,9 @@ spec: type: string type: object type: array + openVSXURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string type: object type: object containerRegistry: diff --git a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index ac35e5d96..3a8845cb0 100644 --- a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -539,6 +539,9 @@ spec: nonProxyHosts: description: 'List of hosts that will be reached directly, bypassing the proxy. Specify wild card domain use the following form `.` and `|` as delimiter, for example: `localhost|.my.host.com|123.42.12.32` Only use when configuring a proxy is required. Operator respects OpenShift cluster wide proxy configuration and no additional configuration is required, but defining `nonProxyHosts` in a custom resource leads to merging non proxy hosts lists from the cluster proxy configuration and ones defined in the custom resources. See the doc https://docs.openshift.com/container-platform/4.4/networking/enable-cluster-wide-proxy.html. See also the `proxyURL` fields.' type: string + openVSXRegistryURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string pluginRegistryCpuLimit: description: Overrides the CPU limit used in the plugin registry deployment. In cores. (500m = .5 cores). Default to 500m. type: string @@ -2384,6 +2387,9 @@ spec: type: string type: object type: array + openVSXURL: + description: Open VSX registry URL. If omitted an embedded instance will be used. + type: string type: object type: object containerRegistry: