Skip to content

Commit

Permalink
Fix cloudprofiles (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Lohage <lohage@23technologies.cloud>
Signed-off-by: Jens Schneider <jens.schneider.ac@posteo.de>
  • Loading branch information
JensAc committed Mar 28, 2023
1 parent e5d69c7 commit 3b76059
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
1 change: 0 additions & 1 deletion pkg/common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func RandHex(bytes int) string {
return hex.EncodeToString(byteArr)
}


func ExitOnCtrlC(err error) {
if errors.Is(err, terminal.InterruptErr) {
fmt.Println("Ctrl+C, exiting.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ stringData:
global:
kubernetes:
versions:
1.22.9:
1.24.12:
classification: preview
seedSelector:
enabled: true
selector:
providerTypes:
- hcloud
hcloud:
- {{ .BaseCluster.Provider }}
{{ range .CloudProfiles }}
{{ . }}:
enabled: true
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ stringData:
global:
kubernetes:
versions:
1.22.9:
1.24.12:
classification: preview
seedSelector:
enabled: true
selector:
providerTypes:
- hcloud
hcloud:
enabled: true
regiocloud:
enabled: true
4 changes: 4 additions & 0 deletions pkg/install/v2/configsurvey.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ func queryConfig(kubeClient client.Client) error {
return err
}

if !viper.IsSet("cloudprofiles") {
viper.Set("cloudprofiles", []string{"alicloud", "aws", "azure", "gcp", "hcloud", "regiocloud", "wavestack"})
}

// enable the provider extensions needed for a minimal setup
viper.Set("extensionsConfig.provider-"+viper.GetString("baseCluster.provider")+".enabled", true)
viper.Set("extensionsConfig."+common.DNS_PROVIDER_TO_PROVIDER[viper.GetString("domainConfig.provider")]+".enabled", true)
Expand Down
2 changes: 2 additions & 0 deletions pkg/install/v2/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func init() {
"bucket.accesskey": "minioadmin",
"bucket.endpoint": "localhost:9000",
"bucket.secretkey": "minioadmin",
"cloudprofiles": []string{"hcloud", "regiocloud"},
"clusteridentity": "garden-cluster-my-identity",
"dashboard.clientsecret": "my-client-secret",
"dashboard.sessionsecret": "my-session-secret",
Expand Down Expand Up @@ -128,6 +129,7 @@ func init() {
viper.Set("dashboard.clientSecret", testConfig["dashboard.clientsecret"])
viper.Set("kubeApiServer.basicAuthPassword", testConfig["kubeapiserver.basicauthpassword"])
viper.Set("clusterIdentity", testConfig["clusteridentity"])
viper.Set("cloudprofiles", testConfig["cloudprofiles"])

_, err = git.PlainInit(configRepo, true)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions pkg/install/v2/templates.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package install

import (
"bytes"
"embed"
"fmt"
"io/fs"
Expand Down Expand Up @@ -183,8 +182,6 @@ func writeConfigDir(filesystem billy.Filesystem, subFolder string) error {
return err
}

buf := &bytes.Buffer{}
_ = tpl.Execute(buf, keConfig)
err = tpl.Execute(file, keConfig)
file.Close()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/install/v2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type KeConfig struct {
DomainConfig domainConfiguration `yaml:"domainConfig,omitempty"`
BackupConfig backupConfiguration `yaml:"backupConfig,omitempty"`
ExtensionsConfig extensionsConfig `yaml:"extensions"`
CloudProfiles []string `yaml:"cloudprofiles"`
}

type admin struct {
Expand Down

0 comments on commit 3b76059

Please sign in to comment.