Skip to content

Commit

Permalink
OCM-6419 | feat: fetch OIDC thumbprint from CS
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmckay committed May 7, 2024
1 parent 5935b9c commit dc9fcab
Show file tree
Hide file tree
Showing 28 changed files with 40,185 additions and 38,853 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -93,6 +93,7 @@ codecov: coverage

mocks: $(MOCKGEN)
$(MOCKGEN) --build_flags=--mod=mod -package mocks -destination=cmd/create/idp/mocks/identityprovider.go -source=cmd/create/idp/cmd.go IdentityProvider
$(MOCKGEN) --build_flags=--mod=mod -package mocks -destination=pkg/rosa/mocks/mock_cmd.go -source=pkg/rosa/runner.go CommandInterface
$(MOCKGEN) -source=pkg/aws/api_interface/iam_api_client.go -package=mocks -destination=pkg/aws/mocks/mock_iam_api_client.go
$(MOCKGEN) -source=pkg/aws/api_interface/organizations_api_client.go -package=mocks -destination=pkg/aws/mocks/mock_organizations_api_client.go
$(MOCKGEN) -source=pkg/aws/api_interface/sts_api_client.go -package=mocks -destination=pkg/aws/mocks/mock_sts_api_client.go
Expand Down
21 changes: 14 additions & 7 deletions cmd/create/cluster/cmd.go
Expand Up @@ -3236,7 +3236,14 @@ func run(cmd *cobra.Command, _ []string) {
if !output.HasFlag() || r.Reporter.IsTerminal() {
r.Reporter.Infof("Preparing to create OIDC Provider.")
}
oidcprovider.Cmd.Run(oidcprovider.Cmd, []string{clusterName, mode, ""})

runner := oidcprovider.CreateOidcProviderRunner()
err = runner(nil, r, oidcprovider.NewCreateOidcProviderCommand(),
[]string{clusterName, mode, ""})
if err != nil {
r.Reporter.Errorf("%s", err)
os.Exit(1)
}
} else {
output := ""
if len(operatorRoles) == 0 {
Expand Down Expand Up @@ -3353,12 +3360,12 @@ func GenerateContractDisplay(contract *accountsv1.Contract) string {
numberOfVCPUs, numberOfClusters := ocm.GetNumsOfVCPUsAndClusters(dimensions)

contractDisplay := fmt.Sprintf(`
+---------------------+----------------+
| Start Date |%s |
| End Date |%s |
| Number of vCPUs: |'%s' |
| Number of clusters: |'%s' |
+---------------------+----------------+
+---------------------+----------------+
| Start Date |%s |
| End Date |%s |
| Number of vCPUs: |'%s' |
| Number of clusters: |'%s' |
+---------------------+----------------+
`,
contract.StartDate().Format(format),
contract.EndDate().Format(format),
Expand Down
8 changes: 5 additions & 3 deletions cmd/create/cmd.go
Expand Up @@ -54,8 +54,10 @@ func init() {
Cmd.AddCommand(cluster.Cmd)
Cmd.AddCommand(idp.Cmd)
Cmd.AddCommand(machinepool.Cmd)
Cmd.AddCommand(oidcconfig.Cmd)
Cmd.AddCommand(oidcprovider.Cmd)
Cmd.AddCommand(oidcconfig.NewCreateOidcConfigCommand())
cmd := oidcprovider.CreateOidcProvider{}
oidcProviderCmd := cmd.NewCommand()
Cmd.AddCommand(oidcProviderCmd)
Cmd.AddCommand(operatorroles.Cmd)
Cmd.AddCommand(userrole.Cmd)
Cmd.AddCommand(ocmrole.Cmd)
Expand All @@ -75,7 +77,7 @@ func init() {
globallyAvailableCommands := []*cobra.Command{
accountroles.Cmd, operatorroles.Cmd,
userrole.Cmd, ocmrole.Cmd,
oidcprovider.Cmd,
oidcProviderCmd,
}
arguments.MarkRegionHidden(Cmd, globallyAvailableCommands)
}
53 changes: 53 additions & 0 deletions cmd/create/idp/mocks/identityprovider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dc9fcab

Please sign in to comment.