Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mumoshu committed Apr 24, 2018
1 parent e9f1ed5 commit fa009a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/controlplane/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func NewCluster(cfgRef *config.Cluster, opts config.StackTemplateOptions, plugin

// Import all the managed subnets from the network stack
var err error
cfg.Subnets, err = cfg.Subnets.ImportFromNetworkStack()
cfg.Subnets, err = cfg.Subnets.ImportFromNetworkStackRetainingNames()
if err != nil {
return nil, fmt.Errorf("failed to import subnets from network stack: %v", err)
}
Expand Down
13 changes: 13 additions & 0 deletions model/subnets.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,20 @@ func (ss Subnets) ImportFromNetworkStack() (Subnets, error) {
} else {
result[i] = NewPublicSubnetFromFn(az, stackOutputName)
}
} else {
result[i] = s
}
}
return result, nil
}

func (ss Subnets) ImportFromNetworkStackRetainingNames() (Subnets, error) {
result, err := ss.ImportFromNetworkStack()
if err != nil {
return result, err
}
for i, s := range ss {
result[i].Name = s.Name
}
return result, nil
}
2 changes: 2 additions & 0 deletions test/integration/maincluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3431,6 +3431,8 @@ worker:
stackTemplateOptions.RootStackTemplateTmplFile = "../../core/root/config/templates/stack-template.json"
stackTemplateOptions.NodePoolStackTemplateTmplFile = "../../core/nodepool/config/templates/stack-template.json"
stackTemplateOptions.ControlPlaneStackTemplateTmplFile = "../../core/controlplane/config/templates/stack-template.json"
stackTemplateOptions.NetworkStackTemplateTmplFile = "../../core/network/config/templates/stack-template.json"
stackTemplateOptions.EtcdStackTemplateTmplFile = "../../core/etcd/config/templates/stack-template.json"

cluster, err := root.ClusterFromConfig(providedConfig, stackTemplateOptions, false)
if err != nil {
Expand Down

0 comments on commit fa009a6

Please sign in to comment.