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

Remove Kyma version configuration #861

Merged
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
5 changes: 2 additions & 3 deletions cmd/broker/broker_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ func NewBrokerSuiteTestWithConfig(t *testing.T, cfg *Config, version ...string)
provisionerClient := provisioner.NewFakeClientWithGardener(gardenerClient, "kcp-system")
eventBroker := event.NewPubSub(logs)

accountVersionMapping := runtimeversion.NewAccountVersionMapping(ctx, cli, cfg.VersionConfig.Namespace, cfg.VersionConfig.Name, logs)
runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, accountVersionMapping, nil)
runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, nil)

avsDel, externalEvalCreator, internalEvalAssistant, externalEvalAssistant := createFakeAvsDelegator(t, db, cfg)

Expand All @@ -221,7 +220,7 @@ func NewBrokerSuiteTestWithConfig(t *testing.T, cfg *Config, version ...string)
provisionManager.SpeedUp(10000)

updateManager := process.NewStagedManager(db.Operations(), eventBroker, time.Hour, cfg.Update, logs)
rvc := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, nil, db.RuntimeStates())
rvc := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, db.RuntimeStates())
updateQueue := NewUpdateProcessingQueue(context.Background(), updateManager, 1, db, inputFactory, provisionerClient,
eventBroker, rvc, db.RuntimeStates(), *cfg, k8sClientProvider, cli, logs)
updateQueue.SpeedUp(10000)
Expand Down
11 changes: 2 additions & 9 deletions cmd/broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ type Config struct {
Kubeconfig kubeconfig.Config

KymaVersion string
EnableOnDemandVersion bool `envconfig:"default=false"`
ManagedRuntimeComponentsYAMLFilePath string
NewAdditionalRuntimeComponentsYAMLFilePath string
SkrOidcDefaultValuesYAMLFilePath string
Expand All @@ -127,11 +126,6 @@ type Config struct {

Notification notification.Config

VersionConfig struct {
Namespace string
Name string
}

KymaDashboardConfig dashboard.Config

OrchestrationConfig orchestration.Config
Expand Down Expand Up @@ -355,8 +349,7 @@ func main() {
_ = metricsv2.Register(ctx, eventBroker, db.Operations(), db.Instances(), cfg.MetricsV2, logs)

// define steps
accountVersionMapping := runtimeversion.NewAccountVersionMapping(ctx, cli, cfg.VersionConfig.Namespace, cfg.VersionConfig.Name, logs)
runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, accountVersionMapping, db.RuntimeStates())
runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, db.RuntimeStates())

// run queues
provisionManager := process.NewStagedManager(db.Operations(), eventBroker, cfg.OperationTimeout, cfg.Provisioning, logs.WithField("provisioning", "manager"))
Expand Down Expand Up @@ -497,7 +490,7 @@ func createAPI(router *mux.Router, servicesConfig broker.ServicesConfig, planVal
kymaEnvBroker := &broker.KymaEnvironmentBroker{
ServicesEndpoint: broker.NewServices(cfg.Broker, servicesConfig, logs, convergedCloudRegionProvider),
ProvisionEndpoint: broker.NewProvision(cfg.Broker, cfg.Gardener, db.Operations(), db.Instances(), db.InstancesArchived(),
provisionQueue, planValidator, defaultPlansConfig, cfg.EnableOnDemandVersion,
provisionQueue, planValidator, defaultPlansConfig,
planDefaults, whitelistedGlobalAccountIds, cfg.EuAccessRejectionMessage, logs, cfg.KymaDashboardConfig, kcBuilder, freemiumGlobalAccountIds, convergedCloudRegionProvider,
),
DeprovisionEndpoint: broker.NewDeprovision(db.Instances(), db.Operations(), deprovisionQueue, logs),
Expand Down
6 changes: 2 additions & 4 deletions cmd/broker/provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,7 @@ func TestProvisioning_Conflict(t *testing.T) {
"user_id": "john.smith@email.com"
},
"parameters": {
"name": "testing-cluster",
"kymaVersion": "2.4.0"
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
Expand All @@ -579,8 +578,7 @@ func TestProvisioning_Conflict(t *testing.T) {
"user_id": "john.smith@email.com"
},
"parameters": {
"name": "testing-cluster",
"kymaVersion": "2.5.0"
"name": "testing-cluster-2"
}
}`)
// then
Expand Down
36 changes: 14 additions & 22 deletions cmd/broker/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,18 @@ import (
)

const (
globalAccountLabel = "account"
subAccountLabel = "subaccount"
runtimeIDAnnotation = "kcp.provisioner.kyma-project.io/runtime-id"
defaultNamespace = "kcp-system"
defaultKymaVer = "2.4.0"
kymaVersionsConfigName = "kyma-versions"
defaultRegion = "cf-eu10"
globalAccountID = "dummy-ga-id"
dashboardURL = "http://console.garden-dummy.kyma.io"
operationID = "provisioning-op-id"
deprovisioningOpID = "deprovisioning-op-id"
reDeprovisioningOpID = "re-deprovisioning-op-id"
instanceID = "instance-id"
dbSecretKey = "1234567890123456"
globalAccountLabel = "account"
subAccountLabel = "subaccount"
runtimeIDAnnotation = "kcp.provisioner.kyma-project.io/runtime-id"
defaultKymaVer = "2.4.0"
defaultRegion = "cf-eu10"
globalAccountID = "dummy-ga-id"
dashboardURL = "http://console.garden-dummy.kyma.io"
operationID = "provisioning-op-id"
deprovisioningOpID = "deprovisioning-op-id"
reDeprovisioningOpID = "re-deprovisioning-op-id"
instanceID = "instance-id"
dbSecretKey = "1234567890123456"

pollingInterval = 3 * time.Millisecond
)
Expand Down Expand Up @@ -156,7 +154,7 @@ func NewOrchestrationSuite(t *testing.T, additionalKymaVersions []string) *Orche

eventBroker := event.NewPubSub(logs)

runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(kymaVer, runtimeversion.NewAccountVersionMapping(ctx, cli, defaultNamespace, kymaVersionsConfigName, logs), nil)
runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(kymaVer, nil)

avsClient, _ := avs.NewClient(ctx, avs.Config{}, logs)
avsDel := avs.NewDelegator(avsClient, avs.Config{}, db.Operations())
Expand Down Expand Up @@ -202,8 +200,6 @@ type RuntimeOptions struct {
Region string
PlanID string
Provider internal.CloudProvider
KymaVersion string
OverridesVersion string
OIDC *internal.OIDCConfigDTO
UserID string
RuntimeAdmins []string
Expand Down Expand Up @@ -616,8 +612,7 @@ func NewProvisioningSuite(t *testing.T, multiZoneCluster bool, controlPlaneFailu
internalEvalAssistant := avs.NewInternalEvalAssistant(cfg.Avs)
externalEvalCreator := provisioning.NewExternalEvalCreator(avsDel, cfg.Avs.Disabled, externalEvalAssistant)

accountVersionMapping := runtimeversion.NewAccountVersionMapping(ctx, cli, cfg.VersionConfig.Namespace, cfg.VersionConfig.Name, logs)
runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, accountVersionMapping, nil)
runtimeVerConfigurator := runtimeversion.NewRuntimeVersionConfigurator(cfg.KymaVersion, nil)

edpClient := edp.NewFakeClient()

Expand Down Expand Up @@ -656,8 +651,6 @@ func (s *ProvisioningSuite) CreateProvisioning(options RuntimeOptions) string {
PlatformProvider: options.PlatformProvider,
Parameters: internal.ProvisioningParametersDTO{
Region: options.ProvideRegion(),
KymaVersion: options.KymaVersion,
OverridesVersion: options.OverridesVersion,
OIDC: options.ProvideOIDC(),
RuntimeAdministrators: options.ProvideRuntimeAdmins(),
},
Expand Down Expand Up @@ -967,7 +960,6 @@ func fixConfig() *Config {
ShootDomain: "kyma.sap.com",
},
KymaVersion: defaultKymaVer,
EnableOnDemandVersion: true,
UpdateProcessingEnabled: true,
Broker: broker.Config{
EnablePlans: []string{"azure", "trial", "aws", "own_cluster", "preview", "sap-converged-cloud", "gcp", "free"},
Expand Down
12 changes: 4 additions & 8 deletions cmd/broker/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ func TestUnsuspensionTrialKyma20(t *testing.T) {
"user_id": "john.smith@email.com"
},
"parameters": {
"name": "testing-cluster",
"kymaVersion":"2.0"
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
Expand Down Expand Up @@ -643,8 +642,7 @@ func TestUpdateWithOwnClusterPlan(t *testing.T) {
"name": "testing-cluster",
"shootName": "shoot-name",
"shootDomain": "kyma-dev.shoot.canary.k8s-hana.ondemand.com",
"kubeconfig":"YXBpVmVyc2lvbjogdjEKa2luZDogQ29uZmlnCmN1cnJlbnQtY29udGV4dDogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUKY29udGV4dHM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZQogICAgY29udGV4dDoKICAgICAgY2x1c3Rlcjogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUKICAgICAgdXNlcjogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUtdG9rZW4KY2x1c3RlcnM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZQogICAgY2x1c3RlcjoKICAgICAgc2VydmVyOiBodHRwczovL2FwaS5jbHVzdGVyLW5hbWUua3ltYS1kZXYuc2hvb3QuY2FuYXJ5Lms4cy1oYW5hLm9uZGVtYW5kLmNvbQogICAgICBjZXJ0aWZpY2F0ZS1hdXRob3JpdHktZGF0YTogPi0KICAgICAgICBMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHQKdXNlcnM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZS10b2tlbgogICAgdXNlcjoKICAgICAgdG9rZW46ID4tCiAgICAgICAgdE9rRW4K",
"kymaVersion": "2.4.0"
"kubeconfig":"YXBpVmVyc2lvbjogdjEKa2luZDogQ29uZmlnCmN1cnJlbnQtY29udGV4dDogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUKY29udGV4dHM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZQogICAgY29udGV4dDoKICAgICAgY2x1c3Rlcjogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUKICAgICAgdXNlcjogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUtdG9rZW4KY2x1c3RlcnM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZQogICAgY2x1c3RlcjoKICAgICAgc2VydmVyOiBodHRwczovL2FwaS5jbHVzdGVyLW5hbWUua3ltYS1kZXYuc2hvb3QuY2FuYXJ5Lms4cy1oYW5hLm9uZGVtYW5kLmNvbQogICAgICBjZXJ0aWZpY2F0ZS1hdXRob3JpdHktZGF0YTogPi0KICAgICAgICBMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHQKdXNlcnM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZS10b2tlbgogICAgdXNlcjoKICAgICAgdG9rZW46ID4tCiAgICAgICAgdE9rRW4K"
}
}`)
opID := suite.DecodeOperationID(resp)
Expand All @@ -660,8 +658,7 @@ func TestUpdateWithOwnClusterPlan(t *testing.T) {
"user_id": "john.smith@email.com"
},
"parameters": {
"kubeconfig":"YXBpVmVyc2lvbjogdjEKa2luZDogQ29uZmlnCmN1cnJlbnQtY29udGV4dDogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUKY29udGV4dHM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZQogICAgY29udGV4dDoKICAgICAgY2x1c3Rlcjogc2hvb3QtLWt5bWEtZGV2LS1jbHVzdGVyLW5hbWUKICAgICAgdXNl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1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHQKdXNlcnM6CiAgLSBuYW1lOiBzaG9vdC0ta3ltYS1kZXYtLWNsdXN0ZXItbmFtZS10b2tlbgogICAgdXNlcjoKICAgICAgdG9rZW46ID4tCiAgICAgICAgdE9rRW4K"
}
}`)
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
Expand Down Expand Up @@ -2055,8 +2052,7 @@ func TestUpdateBTPOperatorCredsSuccess(t *testing.T) {
"user_id": "john.smith@email.com"
},
"parameters": {
"name": "testing-cluster",
"kymaVersion": "2.0"
"name": "testing-cluster"
}
}`)

Expand Down
2 changes: 0 additions & 2 deletions cmd/broker/upgrade_kyma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func TestClusterUpgradeUsesUpdatedAutoscalerParams(t *testing.T) {
},
"parameters": {
"name": "testing-cluster",
"kymaVersion": "2.0",
"region": "eastus"
}
}`)
Expand Down Expand Up @@ -147,7 +146,6 @@ func TestKymaUpgradeScheduledToFutureMaintenanceWindow(t *testing.T) {
},
"parameters": {
"name": "testing-cluster",
"kymaVersion": "2.0",
"region": "eastus"
}
}`)
Expand Down
8 changes: 0 additions & 8 deletions internal/broker/instance_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ type ProvisionEndpoint struct {
builderFactory PlanValidator
enabledPlanIDs map[string]struct{}
plansConfig PlansConfig
kymaVerOnDemand bool
planDefaults PlanDefaults

shootDomain string
Expand Down Expand Up @@ -88,7 +87,6 @@ func NewProvision(cfg Config,
queue Queue,
builderFactory PlanValidator,
plansConfig PlansConfig,
kvod bool,
planDefaults PlanDefaults,
euAccessWhitelist whitelist.Set,
euRejectMessage string,
Expand All @@ -114,7 +112,6 @@ func NewProvision(cfg Config,
log: log.WithField("service", "ProvisionEndpoint"),
enabledPlanIDs: enabledPlanIDs,
plansConfig: plansConfig,
kymaVerOnDemand: kvod,
shootDomain: gardenerConfig.ShootDomain,
shootProject: gardenerConfig.Project,
shootDnsProviders: gardenerConfig.DNSProviders,
Expand Down Expand Up @@ -322,11 +319,6 @@ func (b *ProvisionEndpoint) validateAndExtract(details domain.ProvisionDetails,
}
}

if !b.kymaVerOnDemand {
logger.Infof("Kyma on demand functionality is disabled. Default Kyma version will be used instead %s", parameters.KymaVersion)
parameters.KymaVersion = ""
parameters.OverridesVersion = ""
}
parameters.LicenceType = b.determineLicenceType(details.PlanID)

found := b.builderFactory.IsPlanSupport(details.PlanID)
Expand Down
3 changes: 0 additions & 3 deletions internal/broker/instance_create_input_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func TestShootAndSeedSameRegion(t *testing.T) {
nil,
nil,
nil,
false,
nil,
nil,
"",
Expand Down Expand Up @@ -63,7 +62,6 @@ func TestShootAndSeedSameRegion(t *testing.T) {
nil,
nil,
nil,
false,
nil,
nil,
"",
Expand Down Expand Up @@ -97,7 +95,6 @@ func TestShootAndSeedSameRegion(t *testing.T) {
nil,
nil,
nil,
false,
nil,
nil,
"",
Expand Down
Loading
Loading