Skip to content

Commit

Permalink
Merge pull request #304 from covexo/improve-up
Browse files Browse the repository at this point in the history
Fix nil pointer when using devspace cloud
  • Loading branch information
FabianKramm authored Oct 19, 2018
2 parents 2e318c1 + 6aaa246 commit 212bd63
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 212bd63

Please sign in to comment.