diff --git a/deploy/kubernetes/console/templates/deployment.yaml b/deploy/kubernetes/console/templates/deployment.yaml index 54f82fdaf3..b385fda21f 100644 --- a/deploy/kubernetes/console/templates/deployment.yaml +++ b/deploy/kubernetes/console/templates/deployment.yaml @@ -302,8 +302,8 @@ spec: value: "{{.Values.kube.registry.hostname}}/{{.Values.kube.organization}}/stratos-kube-terminal:{{.Values.consoleVersion}}" - name: STRATOS_KUBERNETES_DASHBOARD_IMAGE value: "{{.Values.console.kubeDashboardImage}}" - - name: ARTIFACT_HUB_ENABLED - value: {{ default "true" .Values.console.artifactHubEnabled | quote }} + - name: ARTIFACT_HUB_DISABLED + value: {{ default "false" .Values.console.artifactHubDisabled | quote }} {{- include "stratosJetstreamEnv" . | indent 8 }} readinessProbe: httpGet: diff --git a/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts b/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts index 18f44e643e..74c42fc2d0 100644 --- a/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts +++ b/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts @@ -90,7 +90,7 @@ export function generateHelmEntities(): StratosBaseCatalogEntity[] { registrationComponent: HelmHubRegistrationComponent, registeredLimit: (store: Store): Observable => store.select('auth').pipe( filter(auth => !!auth.sessionData['plugin-config']), - map(auth => auth.sessionData['plugin-config'].helmHubEnabled === 'true' ? 1 : 0), + map(auth => auth.sessionData['plugin-config'].artifactHubDisabled === 'true' ? 0 : 1), ) }, ], diff --git a/src/jetstream/config.example b/src/jetstream/config.example index ab58bbee49..ae64d55697 100644 --- a/src/jetstream/config.example +++ b/src/jetstream/config.example @@ -79,4 +79,4 @@ INVITE_USER_CLIENT_SECRET= # HELM_CACHE_FOLDER=./helm-cache # Enabled Artifact Hub -# ARTIFACT_HUB_ENABLED=false +# ARTIFACT_HUB_DISABLED=false diff --git a/src/jetstream/plugins/monocular/main.go b/src/jetstream/plugins/monocular/main.go index 581b31977e..21bc68de3e 100644 --- a/src/jetstream/plugins/monocular/main.go +++ b/src/jetstream/plugins/monocular/main.go @@ -14,15 +14,15 @@ import ( ) const ( - helmEndpointType = "helm" - helmHubEndpointType = "hub" - helmRepoEndpointType = "repo" - stratosPrefix = "/pp/v1/" - kubeReleaseNameEnvVar = "STRATOS_HELM_RELEASE" - cacheFolderEnvVar = "HELM_CACHE_FOLDER" - defaultCacheFolder = "./.helm-cache" - helmHubEnabledEnvVar = "ARTIFACT_HUB_ENABLED" - helmHubEnabled = "helmHubEnabled" + helmEndpointType = "helm" + helmHubEndpointType = "hub" + helmRepoEndpointType = "repo" + stratosPrefix = "/pp/v1/" + kubeReleaseNameEnvVar = "STRATOS_HELM_RELEASE" + cacheFolderEnvVar = "HELM_CACHE_FOLDER" + defaultCacheFolder = "./.helm-cache" + artifactHubDisabledEnvVar = "ARTIFACT_HUB_DISABLED" + artifactHubDisabled = "artifactHubDisabled" ) // Monocular is a plugin for Monocular @@ -59,10 +59,10 @@ func Init(portalProxy interfaces.PortalProxy) (interfaces.StratosPlugin, error) func (m *Monocular) Init() error { log.Debug("Monocular init .... ") - if val, ok := m.portalProxy.Env().Lookup(helmHubEnabledEnvVar); ok { - m.portalProxy.GetConfig().PluginConfig[helmHubEnabled] = val + if val, ok := m.portalProxy.Env().Lookup(artifactHubDisabledEnvVar); ok { + m.portalProxy.GetConfig().PluginConfig[artifactHubDisabled] = val } else { - m.portalProxy.GetConfig().PluginConfig[helmHubEnabled] = "true" + m.portalProxy.GetConfig().PluginConfig[artifactHubDisabled] = "false" } m.CacheFolder = m.portalProxy.Env().String(cacheFolderEnvVar, defaultCacheFolder) @@ -246,7 +246,7 @@ func (m *Monocular) validateExternalMonocularEndpoint(cnsi string) (*interfaces. return &endpoint, nil } - if m.portalProxy.GetConfig().PluginConfig[helmHubEnabled] != "true" { + if m.portalProxy.GetConfig().PluginConfig[artifactHubDisabled] != "true" { return nil, echo.NewHTTPError(http.StatusInternalServerError, errors.New("Artifact Hub is disabled")) }