Skip to content

Commit

Permalink
Merge pull request #2568 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2565-to-release_1.2.47

[release_1.2.47] OCM-12100 | fix: Only attempt provider creation with auto mode
  • Loading branch information
davidleerh authored Oct 25, 2024
2 parents f24c96a + 1e857ec commit 4ebcf5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
27 changes: 13 additions & 14 deletions cmd/create/oidcconfig/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,25 +295,24 @@ func run(cmd *cobra.Command, _ []string) {
os.Exit(1)
}
oidcConfigId := oidcConfigStrategy.execute(r)
if mode == interactive.ModeAuto {
if !args.rawFiles {
arguments.DisableRegionDeprecationWarning = true // disable region deprecation warning
providerArgs := []string{"", mode, oidcConfigInput.IssuerUrl}
if oidcConfigId != "" {
providerArgs = append(providerArgs, "--oidc-config-id", oidcConfigId)
err = oidcprovider.Cmd.Flags().Set("oidc-config-id", oidcConfigId)
if err != nil {
r.Reporter.Errorf("Unable to attempt creation of OIDC provider; oidc config ID"+
" not found / not created successfully: %s", err)
}
} else {
if !args.rawFiles {
arguments.DisableRegionDeprecationWarning = true // disable region deprecation warning
providerArgs := []string{"", mode, oidcConfigInput.IssuerUrl}
if oidcConfigId != "" {
providerArgs = append(providerArgs, "--oidc-config-id", oidcConfigId)
err = oidcprovider.Cmd.Flags().Set("oidc-config-id", oidcConfigId)
if err != nil {
r.Reporter.Errorf("Unable to attempt creation of OIDC provider; oidc config ID"+
" not found / not created successfully: %s", err)
os.Exit(1)
}
oidcprovider.Cmd.Run(oidcprovider.Cmd, providerArgs)
arguments.DisableRegionDeprecationWarning = false // enable region deprecation again
} else {
r.Reporter.Infof("To create the OIDC provider, please run 'rosa create oidc-provider' with the ID " +
"of the OIDC config or cluster you want to associate it with.")
os.Exit(1)
}
oidcprovider.Cmd.Run(oidcprovider.Cmd, providerArgs)
arguments.DisableRegionDeprecationWarning = false // enable region deprecation again
}
}

Expand Down
3 changes: 0 additions & 3 deletions cmd/create/oidcprovider/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ func buildCommands(r *rosa.Runtime, oidcEndpointUrl string, clusterId string) (s
if err != nil {
return "", err
}
if err != nil {
return "", err
}
r.Reporter.Debugf("Using thumbprint '%s'", thumbprint.Thumbprint())

iamTags := map[string]string{
Expand Down

0 comments on commit 4ebcf5a

Please sign in to comment.