Skip to content

openstack: Use openstack as a cloud name for our credentials #1153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/asset/machines/openstack/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ import (
)

const (
// TODO(flaper87): We're choosing to hardcode these 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.
cloudsSecret = "openstack-credentials"
cloudsSecretNamespace = "kube-system"

// CloudName is a constant containing the name of the cloud used in the internal cloudsSecret
CloudName = "openstack"
)

// Machines returns a list of machines for a machinepool.
Expand Down Expand Up @@ -83,7 +90,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, Namespace: cloudsSecretNamespace},
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