Skip to content

Commit 6c83f9f

Browse files
committed
openstack: Start setting CredentialsMode
This is done for the other platforms. Do it now for OpenStack. Signed-off-by: Stephen Finucane <[email protected]>
1 parent 97030df commit 6c83f9f

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

data/data/install.openshift.io_installconfigs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4143,13 +4143,14 @@ spec:
41434143
"Passthrough": copy the credentials with all of the overall permissions for each CredentialsRequest
41444144
"Manual": CredentialsRequests must be handled manually by the user
41454145
4146-
For each of the following platforms, the field can set to the specified values. For all other platforms, the
4146+
For each of the following platforms, the field can be set to the specified values. For all other platforms, the
41474147
field must not be set.
41484148
AWS: "Mint", "Passthrough", "Manual"
41494149
Azure: "Passthrough", "Manual"
41504150
AzureStack: "Manual"
41514151
GCP: "Mint", "Passthrough", "Manual"
41524152
IBMCloud: "Manual"
4153+
OpenStack: "Passthrough"
41534154
PowerVS: "Manual"
41544155
Nutanix: "Manual"
41554156
enum:

pkg/explain/printer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ There are three possible values for this field, but the valid values are depende
8181
"Passthrough": copy the credentials with all of the overall permissions for each CredentialsRequest
8282
"Manual": CredentialsRequests must be handled manually by the user
8383
84-
For each of the following platforms, the field can set to the specified values. For all other platforms, the
84+
For each of the following platforms, the field can be set to the specified values. For all other platforms, the
8585
field must not be set.
8686
AWS: "Mint", "Passthrough", "Manual"
8787
Azure: "Passthrough", "Manual"
8888
AzureStack: "Manual"
8989
GCP: "Mint", "Passthrough", "Manual"
9090
IBMCloud: "Manual"
91+
OpenStack: "Passthrough"
9192
PowerVS: "Manual"
9293
Nutanix: "Manual"
9394

pkg/types/defaults/installconfig.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func SetInstallConfigDefaults(c *types.InstallConfig) {
9090
if c.CredentialsMode == "" {
9191
if c.Platform.Azure != nil && c.Platform.Azure.CloudName == azure.StackCloud {
9292
c.CredentialsMode = types.ManualCredentialsMode
93+
} else if c.Platform.OpenStack != nil {
94+
c.CredentialsMode = types.PassthroughCredentialsMode
9395
} else if c.Platform.Nutanix != nil {
9496
c.CredentialsMode = types.ManualCredentialsMode
9597
} else if c.Platform.PowerVS != nil {

pkg/types/defaults/installconfig_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func defaultAzureInstallConfig() *types.InstallConfig {
6363

6464
func defaultOpenStackInstallConfig() *types.InstallConfig {
6565
c := defaultInstallConfig()
66+
c.CredentialsMode = types.PassthroughCredentialsMode
6667
c.Platform.OpenStack = &openstack.Platform{}
6768
openstackdefaults.SetPlatformDefaults(c.Platform.OpenStack, c.Networking)
6869
return c

pkg/types/installconfig.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,14 @@ type InstallConfig struct {
192192
// "Passthrough": copy the credentials with all of the overall permissions for each CredentialsRequest
193193
// "Manual": CredentialsRequests must be handled manually by the user
194194
//
195-
// For each of the following platforms, the field can set to the specified values. For all other platforms, the
195+
// For each of the following platforms, the field can be set to the specified values. For all other platforms, the
196196
// field must not be set.
197197
// AWS: "Mint", "Passthrough", "Manual"
198198
// Azure: "Passthrough", "Manual"
199199
// AzureStack: "Manual"
200200
// GCP: "Mint", "Passthrough", "Manual"
201201
// IBMCloud: "Manual"
202+
// OpenStack: "Passthrough"
202203
// PowerVS: "Manual"
203204
// Nutanix: "Manual"
204205
// +optional

pkg/types/validation/installconfig.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,12 +1282,13 @@ func validateCloudCredentialsMode(mode types.CredentialsMode, fldPath *field.Pat
12821282
// validPlatformCredentialsModes is a map from the platform name to a slice of credentials modes that are valid
12831283
// for the platform. If a platform name is not in the map, then the credentials mode cannot be set for that platform.
12841284
validPlatformCredentialsModes := map[string][]types.CredentialsMode{
1285-
aws.Name: {types.MintCredentialsMode, types.PassthroughCredentialsMode, types.ManualCredentialsMode},
1286-
azure.Name: allowedAzureModes,
1287-
gcp.Name: {types.MintCredentialsMode, types.PassthroughCredentialsMode, types.ManualCredentialsMode},
1288-
ibmcloud.Name: {types.ManualCredentialsMode},
1289-
powervs.Name: {types.ManualCredentialsMode},
1290-
nutanix.Name: {types.ManualCredentialsMode},
1285+
aws.Name: {types.MintCredentialsMode, types.PassthroughCredentialsMode, types.ManualCredentialsMode},
1286+
azure.Name: allowedAzureModes,
1287+
gcp.Name: {types.MintCredentialsMode, types.PassthroughCredentialsMode, types.ManualCredentialsMode},
1288+
openstack.Name: {types.PassthroughCredentialsMode},
1289+
ibmcloud.Name: {types.ManualCredentialsMode},
1290+
powervs.Name: {types.ManualCredentialsMode},
1291+
nutanix.Name: {types.ManualCredentialsMode},
12911292
}
12921293
if validModes, ok := validPlatformCredentialsModes[platform.Name()]; ok {
12931294
validModesSet := sets.NewString()

0 commit comments

Comments
 (0)