Skip to content

Commit

Permalink
Fix nil pointer when using devspace cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Oct 19, 2018
1 parent fc89358 commit 6aaa246
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pkg/devspace/cloud/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const GetClusterConfigEndpoint = "/clusterConfig"

// DevSpaceCloudProviderConfig holds the information for the devspace-cloud
var DevSpaceCloudProviderConfig = &Provider{
Name: DevSpaceCloudProviderName,
Host: "http://cli.devspace-cloud.com",
}

Expand Down Expand Up @@ -84,16 +85,22 @@ func SaveCloudConfig(config ProviderConfig) error {
}

cfgPath := filepath.Join(homedir, DevSpaceCloudConfigPath)
saveConfig := ProviderConfig{}

for name, provider := range config {
provider.Name = ""

host := provider.Host
if name == DevSpaceCloudProviderName {
provider.Host = ""
host = ""
}

saveConfig[name] = &Provider{
Name: "",
Host: host,
Token: provider.Token,
}
}

out, err := yaml.Marshal(config)
out, err := yaml.Marshal(saveConfig)
if err != nil {
return err
}
Expand Down

0 comments on commit 6aaa246

Please sign in to comment.