Skip to content

Commit

Permalink
openstack: Use openstack as a cloud name for our credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
flaper87 committed Jan 30, 2019
1 parent d3ff3af commit 9c7feb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/asset/machines/openstack/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import (
"github.com/openshift/installer/pkg/types/openstack"
)

// TODO(flaper87): We're choosing to hardcode these two values
// to make the environment more predictable. We expect there to
// a secret named `openstack-credentials` and a cloud named `openstack`
// in the clouds file stored in this secret.
const CloudName = "openstack"
const cloudsSecret = "openstack-credentials"

// Machines returns a list of machines for a machinepool.
Expand Down Expand Up @@ -80,7 +85,7 @@ func provider(clusterID, clusterName string, platform *openstack.Platform, mpool
Size: pointer.Int64Ptr(int64(mpool.Size)),
},*/
Image: osImage,
CloudName: platform.Cloud,
CloudName: CloudName,
CloudsSecret: &corev1.SecretReference{Name: cloudsSecret},
UserDataSecret: &corev1.SecretReference{Name: userDataSecret},
Networks: []openstackprovider.NetworkParam{
Expand Down
3 changes: 2 additions & 1 deletion pkg/asset/manifests/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/installconfig"
"github.com/openshift/installer/pkg/asset/machines"
osmachine "github.com/openshift/installer/pkg/asset/machines/openstack"
"github.com/openshift/installer/pkg/asset/password"
"github.com/openshift/installer/pkg/asset/templates/content/openshift"
)
Expand Down Expand Up @@ -91,7 +92,7 @@ func (o *Openshift) Generate(dependencies asset.Parents) error {
}
clouds := make(map[string]map[string]*clientconfig.Cloud)
clouds["clouds"] = map[string]*clientconfig.Cloud{
"openstack": cloud,
osmachine.CloudName: cloud,
}

marshalled, err := yaml.Marshal(clouds)
Expand Down

0 comments on commit 9c7feb5

Please sign in to comment.