Skip to content

Commit a828096

Browse files
flaper87tomassedovic
authored andcommitted
openstack: Use openstack as a cloud name for our credentials
1 parent 749d9e5 commit a828096

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/asset/machines/openstack/machines.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ import (
1616
)
1717

1818
const (
19+
// TODO(flaper87): We're choosing to hardcode these values to make
20+
// the environment more predictable. We expect there to a secret
21+
// named `openstack-credentials` and a cloud named `openstack` in
22+
// the clouds file stored in this secret.
1923
cloudsSecret = "openstack-credentials"
2024
cloudsSecretNamespace = "kube-system"
25+
26+
// CloudName is a constant containing the name of the cloud used in the internal cloudsSecret
27+
CloudName = "openstack"
2128
)
2229

2330
// Machines returns a list of machines for a machinepool.
@@ -83,7 +90,7 @@ func provider(clusterID, clusterName string, platform *openstack.Platform, mpool
8390
Size: pointer.Int64Ptr(int64(mpool.Size)),
8491
},*/
8592
Image: osImage,
86-
CloudName: platform.Cloud,
93+
CloudName: CloudName,
8794
CloudsSecret: &corev1.SecretReference{Name: cloudsSecret, Namespace: cloudsSecretNamespace},
8895
UserDataSecret: &corev1.SecretReference{Name: userDataSecret},
8996
Networks: []openstackprovider.NetworkParam{

pkg/asset/manifests/openshift.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/openshift/installer/pkg/asset"
1919
"github.com/openshift/installer/pkg/asset/installconfig"
2020
"github.com/openshift/installer/pkg/asset/machines"
21+
osmachine "github.com/openshift/installer/pkg/asset/machines/openstack"
2122
"github.com/openshift/installer/pkg/asset/password"
2223
"github.com/openshift/installer/pkg/asset/templates/content/openshift"
2324
)
@@ -91,7 +92,7 @@ func (o *Openshift) Generate(dependencies asset.Parents) error {
9192
}
9293
clouds := make(map[string]map[string]*clientconfig.Cloud)
9394
clouds["clouds"] = map[string]*clientconfig.Cloud{
94-
"openstack": cloud,
95+
osmachine.CloudName: cloud,
9596
}
9697

9798
marshalled, err := yaml.Marshal(clouds)

0 commit comments

Comments
 (0)