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
Tom McKay committed May 15, 2024
1 parent d2e2da5 commit 604d6f4
Show file tree
Hide file tree
Showing 46 changed files with 34,295 additions and 31,100 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
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
23 changes: 16 additions & 7 deletions cmd/create/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3225,7 +3225,16 @@ 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, ""})

cmd := oidcprovider.CreateOidcProvider.NewCommand()
args := []string{clusterName, mode, ""}
cmd.ParseFlags(args)
runner := oidcprovider.CreateOidcProvider.Runner()
err = runner(nil, r, cmd, args)
if err != nil {
r.Reporter.Errorf("%s", err)
os.Exit(1)
}
} else {
output := ""
if len(operatorRoles) == 0 {
Expand Down Expand Up @@ -3343,12 +3352,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
7 changes: 4 additions & 3 deletions cmd/create/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ 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())
createOidcProviderCmd := oidcprovider.CreateOidcProvider.NewCommand()
Cmd.AddCommand(createOidcProviderCmd)
Cmd.AddCommand(operatorroles.Cmd)
Cmd.AddCommand(userrole.Cmd)
Cmd.AddCommand(ocmrole.Cmd)
Expand All @@ -76,7 +77,7 @@ func init() {
globallyAvailableCommands := []*cobra.Command{
accountroles.Cmd, operatorroles.Cmd,
userrole.Cmd, ocmrole.Cmd,
oidcprovider.Cmd, breakglasscredential.Cmd,
createOidcProviderCmd, breakglasscredential.Cmd,
admin.Cmd, autoscaler.Cmd, dnsdomains.Cmd,
externalauthprovider.Cmd, idp.Cmd, kubeletConfig, tuningconfigs.Cmd,
}
Expand Down
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 604d6f4

Please sign in to comment.