From 931e8fa2c90c53a60a6c773ac32a385db849ea38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Pieszka?= Date: Fri, 11 Oct 2024 13:37:53 +0200 Subject: [PATCH] AVS cleanup - last stage (#1309) configuration removed from model and some tests utility function removed secrets removed error code docs update, fixtures update last touches --- common/runtime/model.go | 1 - docs/user/03-10-service-description.md | 2 - internal/error/errors.go | 1 - internal/fixture/fixture.go | 1 - internal/model.go | 19 +- .../remove_instance_step_test.go | 2 +- .../provisioning/initialisation_test.go | 3 +- .../upgrade_cluster/initialisation_test.go | 378 ------------------ internal/runtime/handler.go | 6 - resources/keb/templates/_helpers.tpl | 13 - resources/keb/templates/app-config.yaml | 5 - resources/keb/templates/secrets.yaml | 24 -- resources/keb/values.yaml | 88 ---- 13 files changed, 3 insertions(+), 540 deletions(-) diff --git a/common/runtime/model.go b/common/runtime/model.go index cf4831451a..8ee03b1eca 100644 --- a/common/runtime/model.go +++ b/common/runtime/model.go @@ -50,7 +50,6 @@ type RuntimeDTO struct { Provider string `json:"provider"` Status RuntimeStatus `json:"status"` UserID string `json:"userID"` - AVSInternalEvaluationID int64 `json:"avsInternalEvaluationID"` KymaConfig *gqlschema.KymaConfigInput `json:"kymaConfig,omitempty"` ClusterConfig *gqlschema.GardenerConfigInput `json:"clusterConfig,omitempty"` RuntimeConfig *map[string]interface{} `json:"runtimeConfig,omitempty"` diff --git a/docs/user/03-10-service-description.md b/docs/user/03-10-service-description.md index 7d34372854..88e866bd4d 100644 --- a/docs/user/03-10-service-description.md +++ b/docs/user/03-10-service-description.md @@ -194,8 +194,6 @@ The trial plan allows you to install Kyma runtime on Azure, AWS, or GCP. The pla - Kyma runtime is uninstalled after 14 days and the Kyma cluster is deprovisioned after this time. - It's possible to provision only one Kyma runtime per global account. -To reduce the costs, the trial plan skips one of the [provisioning steps](./03-20-runtime-operations.md#provisioning), that is, `AVS External Evaluation`. - ### Provisioning Parameters These are the provisioning parameters for the Trial plan that you can configure: diff --git a/internal/error/errors.go b/internal/error/errors.go index b3f3d2bf40..1521b3906e 100644 --- a/internal/error/errors.go +++ b/internal/error/errors.go @@ -54,7 +54,6 @@ const ( ErrEDP ErrComponent = "edp" ErrProvisioner ErrComponent = "provisioner" ErrReconciler ErrComponent = "reconciler" - ErrAVS ErrComponent = "avs" ) func (err LastError) Reason() ErrReason { diff --git a/internal/fixture/fixture.go b/internal/fixture/fixture.go index 98dbd6c513..4fe317a902 100644 --- a/internal/fixture/fixture.go +++ b/internal/fixture/fixture.go @@ -123,7 +123,6 @@ func FixInstanceDetails(id string) internal.InstanceDetails { } return internal.InstanceDetails{ - Avs: internal.AvsLifecycleData{}, EventHub: internal.EventHub{Deleted: false}, SubAccountID: subAccountId, RuntimeID: runtimeId, diff --git a/internal/model.go b/internal/model.go index f66c63979a..8db21cdfcd 100644 --- a/internal/model.go +++ b/internal/model.go @@ -40,22 +40,6 @@ type ProvisionerInputCreator interface { SetOIDCLastValues(oidcConfig gqlschema.OIDCConfigInput) ProvisionerInputCreator } -type AvsEvaluationStatus struct { - Current string `json:"current_value"` - Original string `json:"original_value"` -} - -type AvsLifecycleData struct { - AvsEvaluationInternalId int64 `json:"avs_evaluation_internal_id"` - AVSEvaluationExternalId int64 `json:"avs_evaluation_external_id"` - - AvsInternalEvaluationStatus AvsEvaluationStatus `json:"avs_internal_evaluation_status"` - AvsExternalEvaluationStatus AvsEvaluationStatus `json:"avs_external_evaluation_status"` - - AVSInternalEvaluationDeleted bool `json:"avs_internal_evaluation_deleted"` - AVSExternalEvaluationDeleted bool `json:"avs_external_evaluation_deleted"` -} - type EventHub struct { Deleted bool `json:"event_hub_deleted"` } @@ -231,8 +215,7 @@ type InstanceWithOperation struct { } type InstanceDetails struct { - Avs AvsLifecycleData `json:"avs"` - EventHub EventHub `json:"eh"` + EventHub EventHub `json:"eh"` SubAccountID string `json:"sub_account_id"` RuntimeID string `json:"runtime_id"` diff --git a/internal/process/deprovisioning/remove_instance_step_test.go b/internal/process/deprovisioning/remove_instance_step_test.go index d92c760925..3b4c8c95aa 100644 --- a/internal/process/deprovisioning/remove_instance_step_test.go +++ b/internal/process/deprovisioning/remove_instance_step_test.go @@ -104,7 +104,7 @@ func TestRemoveInstanceStep_InstanceHasExecutedButNotCompletedOperationSteps(t * memoryStorage := storage.NewMemoryStorage() operation := fixture.FixDeprovisioningOperationAsOperation(testOperationID, testInstanceID) - operation.ExcutedButNotCompleted = append(operation.ExcutedButNotCompleted, "De-provision_AVS_Evaluations") + operation.ExcutedButNotCompleted = append(operation.ExcutedButNotCompleted, "Remove_Runtime") instance := fixture.FixInstance(testInstanceID) instance.DeletedAt = time.Time{} diff --git a/internal/process/provisioning/initialisation_test.go b/internal/process/provisioning/initialisation_test.go index 6aeca11ad7..f05fc676f6 100644 --- a/internal/process/provisioning/initialisation_test.go +++ b/internal/process/provisioning/initialisation_test.go @@ -20,8 +20,7 @@ const ( statusGlobalAccountID = "abf73c71-a653-4951-b9c2-a26d6c2cccbd" statusProvisionerOperationID = "e04de524-53b3-4890-b05a-296be393e4ba" - dashboardURL = "http://runtime.com" - fixAvsEvaluationInternalId = int64(1234) + dashboardURL = "http://runtime.com" ) func TestInitialisationStep_Run(t *testing.T) { diff --git a/internal/process/upgrade_cluster/initialisation_test.go b/internal/process/upgrade_cluster/initialisation_test.go index ede9d90d8e..d8d2256ac9 100644 --- a/internal/process/upgrade_cluster/initialisation_test.go +++ b/internal/process/upgrade_cluster/initialisation_test.go @@ -229,393 +229,15 @@ func TestInitialisationStep_Run(t *testing.T) { assert.Equal(t, upgradeOperation, *storedOp) }) - t.Run("should refresh avs on success (both monitors, empty init)", func(t *testing.T) { - // given - log := logrus.New() - memoryStorage := storage.NewMemoryStorage() - inputBuilder := &automock.CreatorForPlan{} - - err := memoryStorage.Orchestrations().Insert(fixOrchestrationWithKymaVer()) - require.NoError(t, err) - - provisioningOperation := fixProvisioningOperation() - err = memoryStorage.Operations().InsertOperation(provisioningOperation) - require.NoError(t, err) - - upgradeOperation := fixUpgradeClusterOperation() - - err = memoryStorage.Operations().InsertUpgradeClusterOperation(upgradeOperation) - require.NoError(t, err) - - instance := fixInstanceRuntimeStatus() - err = memoryStorage.Instances().Insert(instance) - require.NoError(t, err) - - provisionerClient := &provisionerAutomock.Client{} - provisionerClient.On("RuntimeOperationStatus", fixGlobalAccountID, fixProvisionerOperationID).Return(gqlschema.OperationStatus{ - ID: ptr.String(fixProvisionerOperationID), - Operation: "", - State: gqlschema.OperationStateSucceeded, - Message: nil, - RuntimeID: StringPtr(fixRuntimeID), - }, nil) - - notificationTenants := []notification.NotificationTenant{ - { - InstanceID: fixInstanceID, - State: notification.FinishedMaintenanceState, - EndDate: time.Now().Format("2006-01-02 15:04:05"), - }, - } - notificationParas := notification.NotificationParams{ - OrchestrationID: fixOrchestrationID, - Tenants: notificationTenants, - } - notificationBuilder := ¬ificationAutomock.BundleBuilder{} - bundle := ¬ificationAutomock.Bundle{} - notificationBuilder.On("NewBundle", fixOrchestrationID, notificationParas).Return(bundle, nil).Once() - bundle.On("UpdateNotificationEvent").Return(nil).Once() - - step := NewInitialisationStep(memoryStorage.Operations(), memoryStorage.Orchestrations(), provisionerClient, inputBuilder, nil, notificationBuilder) - - // when - upgradeOperation, repeat, err := step.Run(upgradeOperation, log) - - // then - assert.NoError(t, err) - assert.Equal(t, time.Duration(0), repeat) - assert.Equal(t, domain.Succeeded, upgradeOperation.State) - - storedOp, err := memoryStorage.Operations().GetUpgradeClusterOperationByID(upgradeOperation.Operation.ID) - assert.Equal(t, upgradeOperation, *storedOp) - assert.NoError(t, err) - }) - - t.Run("should refresh avs on success (both monitors)", func(t *testing.T) { - // given - log := logrus.New() - memoryStorage := storage.NewMemoryStorage() - inputBuilder := &automock.CreatorForPlan{} - - err := memoryStorage.Orchestrations().Insert(fixOrchestrationWithKymaVer()) - require.NoError(t, err) - - provisioningOperation := fixProvisioningOperation() - err = memoryStorage.Operations().InsertOperation(provisioningOperation) - require.NoError(t, err) - - upgradeOperation := fixUpgradeClusterOperation() - - err = memoryStorage.Operations().InsertUpgradeClusterOperation(upgradeOperation) - require.NoError(t, err) - - instance := fixInstanceRuntimeStatus() - err = memoryStorage.Instances().Insert(instance) - require.NoError(t, err) - - provisionerClient := &provisionerAutomock.Client{} - provisionerClient.On("RuntimeOperationStatus", fixGlobalAccountID, fixProvisionerOperationID).Return(gqlschema.OperationStatus{ - ID: ptr.String(fixProvisionerOperationID), - Operation: "", - State: gqlschema.OperationStateSucceeded, - Message: nil, - RuntimeID: StringPtr(fixRuntimeID), - }, nil) - - notificationTenants := []notification.NotificationTenant{ - { - InstanceID: fixInstanceID, - State: notification.FinishedMaintenanceState, - EndDate: time.Now().Format("2006-01-02 15:04:05"), - }, - } - notificationParas := notification.NotificationParams{ - OrchestrationID: fixOrchestrationID, - Tenants: notificationTenants, - } - notificationBuilder := ¬ificationAutomock.BundleBuilder{} - bundle := ¬ificationAutomock.Bundle{} - notificationBuilder.On("NewBundle", fixOrchestrationID, notificationParas).Return(bundle, nil).Once() - bundle.On("UpdateNotificationEvent").Return(nil).Once() - - step := NewInitialisationStep(memoryStorage.Operations(), memoryStorage.Orchestrations(), provisionerClient, inputBuilder, nil, notificationBuilder) - - // when - upgradeOperation, repeat, err := step.Run(upgradeOperation, log) - - // then - assert.NoError(t, err) - assert.Equal(t, time.Duration(0), repeat) - assert.Equal(t, domain.Succeeded, upgradeOperation.State) - - storedOp, err := memoryStorage.Operations().GetUpgradeClusterOperationByID(upgradeOperation.Operation.ID) - assert.Equal(t, upgradeOperation, *storedOp) - assert.NoError(t, err) - }) - - t.Run("should refresh avs on fail (both monitors)", func(t *testing.T) { - // given - log := logrus.New() - memoryStorage := storage.NewMemoryStorage() - inputBuilder := &automock.CreatorForPlan{} - - err := memoryStorage.Orchestrations().Insert(fixOrchestrationWithKymaVer()) - require.NoError(t, err) - - provisioningOperation := fixProvisioningOperation() - err = memoryStorage.Operations().InsertOperation(provisioningOperation) - require.NoError(t, err) - - upgradeOperation := fixUpgradeClusterOperation() - - err = memoryStorage.Operations().InsertUpgradeClusterOperation(upgradeOperation) - require.NoError(t, err) - - instance := fixInstanceRuntimeStatus() - err = memoryStorage.Instances().Insert(instance) - require.NoError(t, err) - - provisionerClient := &provisionerAutomock.Client{} - provisionerClient.On("RuntimeOperationStatus", fixGlobalAccountID, fixProvisionerOperationID).Return(gqlschema.OperationStatus{ - ID: ptr.String(fixProvisionerOperationID), - Operation: "", - State: gqlschema.OperationStateFailed, - Message: nil, - RuntimeID: StringPtr(fixRuntimeID), - }, nil) - - notificationTenants := []notification.NotificationTenant{ - { - InstanceID: fixInstanceID, - State: notification.FinishedMaintenanceState, - EndDate: time.Now().Format("2006-01-02 15:04:05"), - }, - } - notificationParas := notification.NotificationParams{ - OrchestrationID: fixOrchestrationID, - Tenants: notificationTenants, - } - notificationBuilder := ¬ificationAutomock.BundleBuilder{} - bundle := ¬ificationAutomock.Bundle{} - notificationBuilder.On("NewBundle", fixOrchestrationID, notificationParas).Return(bundle, nil).Once() - bundle.On("UpdateNotificationEvent").Return(nil).Once() - - step := NewInitialisationStep(memoryStorage.Operations(), memoryStorage.Orchestrations(), provisionerClient, inputBuilder, nil, notificationBuilder) - - // when - upgradeOperation, repeat, err := step.Run(upgradeOperation, log) - - // then - assert.NotNil(t, err) - assert.Equal(t, time.Duration(0), repeat) - assert.Equal(t, domain.Failed, upgradeOperation.State) - - storedOp, err := memoryStorage.Operations().GetUpgradeClusterOperationByID(upgradeOperation.Operation.ID) - assert.Equal(t, upgradeOperation, *storedOp) - assert.NoError(t, err) - }) - - t.Run("should refresh avs on success (internal monitor)", func(t *testing.T) { - // given - log := logrus.New() - memoryStorage := storage.NewMemoryStorage() - inputBuilder := &automock.CreatorForPlan{} - - err := memoryStorage.Orchestrations().Insert(fixOrchestrationWithKymaVer()) - require.NoError(t, err) - - provisioningOperation := fixProvisioningOperation() - err = memoryStorage.Operations().InsertOperation(provisioningOperation) - require.NoError(t, err) - - upgradeOperation := fixUpgradeClusterOperation() - - err = memoryStorage.Operations().InsertUpgradeClusterOperation(upgradeOperation) - require.NoError(t, err) - - instance := fixInstanceRuntimeStatus() - err = memoryStorage.Instances().Insert(instance) - require.NoError(t, err) - - provisionerClient := &provisionerAutomock.Client{} - provisionerClient.On("RuntimeOperationStatus", fixGlobalAccountID, fixProvisionerOperationID).Return(gqlschema.OperationStatus{ - ID: ptr.String(fixProvisionerOperationID), - Operation: "", - State: gqlschema.OperationStateSucceeded, - Message: nil, - RuntimeID: StringPtr(fixRuntimeID), - }, nil) - - notificationTenants := []notification.NotificationTenant{ - { - InstanceID: fixInstanceID, - State: notification.FinishedMaintenanceState, - EndDate: time.Now().Format("2006-01-02 15:04:05"), - }, - } - notificationParas := notification.NotificationParams{ - OrchestrationID: fixOrchestrationID, - Tenants: notificationTenants, - } - notificationBuilder := ¬ificationAutomock.BundleBuilder{} - bundle := ¬ificationAutomock.Bundle{} - notificationBuilder.On("NewBundle", fixOrchestrationID, notificationParas).Return(bundle, nil).Once() - bundle.On("UpdateNotificationEvent").Return(nil).Once() - - step := NewInitialisationStep(memoryStorage.Operations(), memoryStorage.Orchestrations(), provisionerClient, inputBuilder, nil, notificationBuilder) - - // when - upgradeOperation, repeat, err := step.Run(upgradeOperation, log) - - // then - assert.NoError(t, err) - assert.Equal(t, time.Duration(0), repeat) - assert.Equal(t, domain.Succeeded, upgradeOperation.State) - - storedOp, err := memoryStorage.Operations().GetUpgradeClusterOperationByID(upgradeOperation.Operation.ID) - assert.Equal(t, upgradeOperation, *storedOp) - assert.NoError(t, err) - }) - - t.Run("should refresh avs on success (external monitor)", func(t *testing.T) { - // given - log := logrus.New() - memoryStorage := storage.NewMemoryStorage() - inputBuilder := &automock.CreatorForPlan{} - - err := memoryStorage.Orchestrations().Insert(fixOrchestrationWithKymaVer()) - require.NoError(t, err) - - provisioningOperation := fixProvisioningOperation() - err = memoryStorage.Operations().InsertOperation(provisioningOperation) - require.NoError(t, err) - - upgradeOperation := fixUpgradeClusterOperation() - - err = memoryStorage.Operations().InsertUpgradeClusterOperation(upgradeOperation) - require.NoError(t, err) - - instance := fixInstanceRuntimeStatus() - err = memoryStorage.Instances().Insert(instance) - require.NoError(t, err) - - provisionerClient := &provisionerAutomock.Client{} - provisionerClient.On("RuntimeOperationStatus", fixGlobalAccountID, fixProvisionerOperationID).Return(gqlschema.OperationStatus{ - ID: ptr.String(fixProvisionerOperationID), - Operation: "", - State: gqlschema.OperationStateSucceeded, - Message: nil, - RuntimeID: StringPtr(fixRuntimeID), - }, nil) - - notificationTenants := []notification.NotificationTenant{ - { - InstanceID: fixInstanceID, - State: notification.FinishedMaintenanceState, - EndDate: time.Now().Format("2006-01-02 15:04:05"), - }, - } - notificationParas := notification.NotificationParams{ - OrchestrationID: fixOrchestrationID, - Tenants: notificationTenants, - } - notificationBuilder := ¬ificationAutomock.BundleBuilder{} - bundle := ¬ificationAutomock.Bundle{} - notificationBuilder.On("NewBundle", fixOrchestrationID, notificationParas).Return(bundle, nil).Once() - bundle.On("UpdateNotificationEvent").Return(nil).Once() - - step := NewInitialisationStep(memoryStorage.Operations(), memoryStorage.Orchestrations(), provisionerClient, inputBuilder, nil, notificationBuilder) - - // when - upgradeOperation, repeat, err := step.Run(upgradeOperation, log) - - // then - assert.NoError(t, err) - assert.Equal(t, time.Duration(0), repeat) - assert.Equal(t, domain.Succeeded, upgradeOperation.State) - - storedOp, err := memoryStorage.Operations().GetUpgradeClusterOperationByID(upgradeOperation.Operation.ID) - assert.Equal(t, upgradeOperation, *storedOp) - assert.NoError(t, err) - }) - - t.Run("should refresh avs on success (no monitors)", func(t *testing.T) { - // given - log := logrus.New() - memoryStorage := storage.NewMemoryStorage() - inputBuilder := &automock.CreatorForPlan{} - - err := memoryStorage.Orchestrations().Insert(fixOrchestrationWithKymaVer()) - require.NoError(t, err) - - provisioningOperation := fixProvisioningOperation() - err = memoryStorage.Operations().InsertOperation(provisioningOperation) - require.NoError(t, err) - - upgradeOperation := fixUpgradeClusterOperation() - - err = memoryStorage.Operations().InsertUpgradeClusterOperation(upgradeOperation) - require.NoError(t, err) - - instance := fixInstanceRuntimeStatus() - err = memoryStorage.Instances().Insert(instance) - require.NoError(t, err) - - provisionerClient := &provisionerAutomock.Client{} - provisionerClient.On("RuntimeOperationStatus", fixGlobalAccountID, fixProvisionerOperationID).Return(gqlschema.OperationStatus{ - ID: ptr.String(fixProvisionerOperationID), - Operation: "", - State: gqlschema.OperationStateSucceeded, - Message: nil, - RuntimeID: StringPtr(fixRuntimeID), - }, nil) - - notificationTenants := []notification.NotificationTenant{ - { - InstanceID: fixInstanceID, - State: notification.FinishedMaintenanceState, - EndDate: time.Now().Format("2006-01-02 15:04:05"), - }, - } - notificationParas := notification.NotificationParams{ - OrchestrationID: fixOrchestrationID, - Tenants: notificationTenants, - } - notificationBuilder := ¬ificationAutomock.BundleBuilder{} - bundle := ¬ificationAutomock.Bundle{} - notificationBuilder.On("NewBundle", fixOrchestrationID, notificationParas).Return(bundle, nil).Once() - bundle.On("UpdateNotificationEvent").Return(nil).Once() - - step := NewInitialisationStep(memoryStorage.Operations(), memoryStorage.Orchestrations(), provisionerClient, inputBuilder, nil, notificationBuilder) - - // when - upgradeOperation, repeat, err := step.Run(upgradeOperation, log) - - // then - assert.NoError(t, err) - assert.Equal(t, time.Duration(0), repeat) - assert.Equal(t, domain.Succeeded, upgradeOperation.State) - assert.Equal(t, upgradeOperation.Avs.AvsInternalEvaluationStatus, internal.AvsEvaluationStatus{Current: "", Original: ""}) - assert.Equal(t, upgradeOperation.Avs.AvsExternalEvaluationStatus, internal.AvsEvaluationStatus{Current: "", Original: ""}) - - storedOp, err := memoryStorage.Operations().GetUpgradeClusterOperationByID(upgradeOperation.Operation.ID) - assert.Equal(t, upgradeOperation, *storedOp) - assert.NoError(t, err) - }) } func fixUpgradeClusterOperation() internal.UpgradeClusterOperation { - return fixUpgradeClusterOperationWithAvs(internal.AvsLifecycleData{}) -} - -func fixUpgradeClusterOperationWithAvs(avsData internal.AvsLifecycleData) internal.UpgradeClusterOperation { upgradeOperation := fixture.FixUpgradeClusterOperation(fixUpgradeOperationID, fixInstanceID) upgradeOperation.OrchestrationID = fixOrchestrationID upgradeOperation.ProvisionerOperationID = fixProvisionerOperationID upgradeOperation.State = orchestration.Pending upgradeOperation.Description = "" upgradeOperation.UpdatedAt = time.Now() - upgradeOperation.InstanceDetails.Avs = avsData upgradeOperation.ProvisioningParameters = fixProvisioningParameters() upgradeOperation.RuntimeOperation.GlobalAccountID = fixGlobalAccountID upgradeOperation.RuntimeOperation.SubAccountID = fixSubAccountID diff --git a/internal/runtime/handler.go b/internal/runtime/handler.go index b3a26669be..7e380b2799 100644 --- a/internal/runtime/handler.go +++ b/internal/runtime/handler.go @@ -334,9 +334,6 @@ func (h *Handler) setRuntimeAllOperations(dto *pkg.RuntimeDTO) error { provOprs := operationsGroup.ProvisionOperations if len(provOprs) != 0 { firstProvOp := &provOprs[len(provOprs)-1] - lastProvOp := provOprs[0] - // Set AVS evaluation ID based on the data in the last provisioning operation - dto.AVSInternalEvaluationID = lastProvOp.InstanceDetails.Avs.AvsEvaluationInternalId h.converter.ApplyProvisioningOperation(dto, firstProvOp) if len(provOprs) > 1 { h.converter.ApplyUnsuspensionOperations(dto, provOprs[:len(provOprs)-1]) @@ -380,9 +377,6 @@ func (h *Handler) setRuntimeLastOperation(dto *pkg.RuntimeDTO) error { return fmt.Errorf("while fetching last operation instance %s: %w", dto.InstanceID, err) } - // Set AVS evaluation ID based on the data in the last operation - dto.AVSInternalEvaluationID = lastOp.InstanceDetails.Avs.AvsEvaluationInternalId - switch lastOp.Type { case internal.OperationTypeProvision: provOps, err := h.operationsDb.ListProvisioningOperationsByInstanceID(dto.InstanceID) diff --git a/resources/keb/templates/_helpers.tpl b/resources/keb/templates/_helpers.tpl index 224ee21d31..a555180d7a 100644 --- a/resources/keb/templates/_helpers.tpl +++ b/resources/keb/templates/_helpers.tpl @@ -51,16 +51,3 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} - -{{/* -Utility function for joining Avs tag list into string. -*/}} -{{- define "avs.utils.joinTags" -}} -{{- $local := dict "first" true -}} -{{- $data := (printf "%s:\n%s" "tags" .) | fromYaml -}} -{{- range $tag := $data.tags -}} -{{- if not $local.first -}},{{- end -}} -{{ printf "{%q,%v,%q}" $tag.content $tag.tag_id $tag.tag_name }} -{{- $_ := set $local "first" false -}} -{{- end -}} -{{- end -}} diff --git a/resources/keb/templates/app-config.yaml b/resources/keb/templates/app-config.yaml index c654e17793..f1e6780f52 100644 --- a/resources/keb/templates/app-config.yaml +++ b/resources/keb/templates/app-config.yaml @@ -30,11 +30,6 @@ data: skrDNSProvidersValues.yaml: |- {{- with .Values.skrDNSProvidersValues }} {{ tpl . $ | indent 4 }} -{{- end }} - avsMaintenanceModeDuringUpgradeAlwaysDisabledGlobalAccountIDs.yaml: |- - maintenanceModeDuringUpgradeAlwaysDisabledGAIDs: -{{- range .Values.avs.maintenanceModeDuringUpgrade.alwaysDisabledGlobalAccountIDs }} -{{ tpl . $ | print "- " | indent 6 }} {{- end }} catalog.yaml: |- {{ .Files.Get "files/catalog.yaml" | indent 4 }} diff --git a/resources/keb/templates/secrets.yaml b/resources/keb/templates/secrets.yaml index 5fc66857c5..29353aa39b 100644 --- a/resources/keb/templates/secrets.yaml +++ b/resources/keb/templates/secrets.yaml @@ -1,30 +1,6 @@ {{- if and .Values.global.secrets.enabled (eq .Values.global.secrets.mechanism "secrets") }} {{- if eq .Values.manageSecrets true }} apiVersion: v1 -data: - apiEndpoint: {{ .Values.avs.apiEndpoint | b64enc | quote }} - apiKey: {{ .Values.avs.apiKey | b64enc | quote }} - clientId: {{ .Values.avs.clientId | b64enc | quote }} - oauthPassword: {{ .Values.avs.oauthPassword | b64enc | quote }} - oauthTokenEndpoint: {{ .Values.avs.oauthTokenEndpoint | b64enc | quote }} - oauthUserName: {{ .Values.avs.oauthUserName | b64enc | quote }} - internalTesterAccessId: {{ .Values.avs.internalTesterAccessId | b64enc | quote }} - externalTesterAccessId: {{ .Values.avs.externalTesterAccessId | b64enc | quote }} - internalTesterService: {{ .Values.avs.internalTesterService | b64enc | quote }} - externalTesterService: {{ .Values.avs.externalTesterService | b64enc | quote }} - groupId: {{ .Values.avs.groupId | b64enc | quote }} - parentId: {{ .Values.avs.parentId | b64enc | quote }} - trialApiKey: {{ .Values.avs.trialApiKey | b64enc | quote }} - trialInternalTesterAccessId: {{ .Values.avs.trialInternalTesterAccessId | b64enc | quote }} - trialGroupId: {{ .Values.avs.trialGroupId | b64enc | quote }} - trialParentId: {{ .Values.avs.trialParentId | b64enc | quote }} -kind: Secret -metadata: - name: {{ .Values.avs.secretName }} - labels: -{{ include "kyma-env-broker.labels" . | indent 4 }} ---- -apiVersion: v1 kind: Secret metadata: name: "{{ .Values.edp.secretName }}" diff --git a/resources/keb/values.yaml b/resources/keb/values.yaml index 387cf616b9..ede26f435c 100644 --- a/resources/keb/values.yaml +++ b/resources/keb/values.yaml @@ -105,53 +105,6 @@ global: # https://pages.github.tools.sap/kyma/docusaurus-docs/kyma/cicd/argocd/secrets vsoSecrets: secrets: - avs-creds: - path: avs - secretName: "{{ .Values.avs.secretName }}" - #restartTargets: - # - kind: Deployment - # name: >- - # {{- template "kyma-env-broker.fullname" . -}} - labels: >- - {{ template "kyma-env-broker.labels" . }} - templating: - enabled: true - keys: - apiEndpoint: api_endpoint - apiKey: api_key - clientId: client_id - oauthPassword: password - oauthTokenEndpoint: oauth_token_endpoint - oauthUserName: username - internalTesterAccessId: internal_tester_access_id - externalTesterAccessId: external_tester_access_id - groupId: group_id - parentId: parent_id - trialApiKey: trial_api_key - trialInternalTesterAccessId: trial_internal_tester_access_id - trialGroupId: trial_group_id - trialParentId: trial_parent_id - data: - apiEndpoint: {} - apiKey: {} - clientId: {} - oauthPassword: {} - oauthTokenEndpoint: {} - oauthUserName: {} - internalTesterAccessId: {} - externalTesterAccessId: {} - internalTesterService: - template: |- - {{- .Values.avs.internalTesterService -}} - externalTesterService: - template: |- - {{- .Values.avs.externalTesterService -}} - groupId: {} - parentId: {} - trialApiKey: {} - trialInternalTesterAccessId: {} - trialGroupId: {} - trialParentId: {} edp: path: edp secretName: "{{ .Values.edp.secretName }}" @@ -385,47 +338,6 @@ kubeconfig: clientID: "TBD" allowOrigins: "*" -avs: - disabled: false - secretName: "avs-creds" - apiEndpoint: "TBD" - apiKey: "TBD" - clientId: "TBD" - oauthPassword: "TBD" - oauthTokenEndpoint: "TBD" - oauthUserName: "TBD" - internalTesterAccessId: "40" - externalTesterAccessId: "40" - groupId: "40" - parentId: "40" - # if set - overrides default tester service name - internalTesterService: "" - externalTesterService: "" - # List of tags to bind to testers. - # Example: - # internalTesterTags: |- - # - content: tag-A - # tag_id: 1 - # tag_name: value-A - # - content: tag-B - # tag_id: 2 - # tag_name: value-B - instanceIdTagClassId: "0" - globalAccountIdTagClassId: "0" - subAccountIdTagClassId: "0" - landscapeTagClassId: "0" - providerTagClassId: "0" - regionTagClassId: "0" - shootNameTagClassId: "0" - externalTesterDisabled: false - trialApiKey: "" - trialInternalTesterAccessId: "0" - trialGroupId: "0" - trialParentId: "0" - maintenanceModeDuringUpgrade: - disabled: false # disable AvS maintenance mode during upgrade, false until SKR ZDM is done - alwaysDisabledGlobalAccountIDs: [ ] # list of GA IDs where maintenance mode is always disabled during upgrade - edp: authURL: "TBD" adminURL: "TBD"