Skip to content

Commit c36c0d7

Browse files
Merge pull request #9734 from shiftstack/OCPBUGS-43783
OSASINFRA-3915: openstack: Start setting CredentialsMode
2 parents 4ec879c + 6c83f9f commit c36c0d7

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
@@ -4260,13 +4260,14 @@ spec:
42604260
"Passthrough": copy the credentials with all of the overall permissions for each CredentialsRequest
42614261
"Manual": CredentialsRequests must be handled manually by the user
42624262
4263-
For each of the following platforms, the field can set to the specified values. For all other platforms, the
4263+
For each of the following platforms, the field can be set to the specified values. For all other platforms, the
42644264
field must not be set.
42654265
AWS: "Mint", "Passthrough", "Manual"
42664266
Azure: "Passthrough", "Manual"
42674267
AzureStack: "Manual"
42684268
GCP: "Mint", "Passthrough", "Manual"
42694269
IBMCloud: "Manual"
4270+
OpenStack: "Passthrough"
42704271
PowerVS: "Manual"
42714272
Nutanix: "Manual"
42724273
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
@@ -193,13 +193,14 @@ type InstallConfig struct {
193193
// "Passthrough": copy the credentials with all of the overall permissions for each CredentialsRequest
194194
// "Manual": CredentialsRequests must be handled manually by the user
195195
//
196-
// For each of the following platforms, the field can set to the specified values. For all other platforms, the
196+
// For each of the following platforms, the field can be set to the specified values. For all other platforms, the
197197
// field must not be set.
198198
// AWS: "Mint", "Passthrough", "Manual"
199199
// Azure: "Passthrough", "Manual"
200200
// AzureStack: "Manual"
201201
// GCP: "Mint", "Passthrough", "Manual"
202202
// IBMCloud: "Manual"
203+
// OpenStack: "Passthrough"
203204
// PowerVS: "Manual"
204205
// Nutanix: "Manual"
205206
// +optional

pkg/types/validation/installconfig.go

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

0 commit comments

Comments
 (0)