Skip to content

Commit

Permalink
OCM-12100 | fix: Only run oidcprovider command when mode=auto
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterkepley committed Oct 25, 2024
1 parent 8144ec1 commit 0b2b682
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions cmd/create/oidcconfig/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,23 +295,25 @@ func run(cmd *cobra.Command, _ []string) {
os.Exit(1)
}
oidcConfigId := oidcConfigStrategy.execute(r)
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 {
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 {
r.Reporter.Errorf("Unable to attempt creation of OIDC provider; oidc config ID"+
" not found / not created successfully: %s", err)
os.Exit(1)
}
} else {
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
}
oidcprovider.Cmd.Run(oidcprovider.Cmd, providerArgs)
arguments.DisableRegionDeprecationWarning = false // enable region deprecation again
}
}

Expand Down

0 comments on commit 0b2b682

Please sign in to comment.