File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
2626 "github.com/openshift/osdctl/cmd/cost"
2727 "github.com/openshift/osdctl/cmd/env"
2828 "github.com/openshift/osdctl/cmd/hive"
29+ "github.com/openshift/osdctl/cmd/iampermissions"
2930 "github.com/openshift/osdctl/cmd/jira"
3031 "github.com/openshift/osdctl/cmd/jumphost"
3132 "github.com/openshift/osdctl/cmd/mc"
@@ -101,6 +102,7 @@ func NewCmdRoot(streams genericclioptions.IOStreams) *cobra.Command {
101102 rootCmd .AddCommand (servicelog .NewCmdServiceLog ())
102103 rootCmd .AddCommand (setup .NewCmdSetup ())
103104 rootCmd .AddCommand (swarm .Cmd )
105+ rootCmd .AddCommand (iampermissions .NewCmdIamPermissions ())
104106
105107 // Add cost command to use AWS Cost Manager
106108 rootCmd .AddCommand (cost .NewCmdCost (streams , globalOpts ))
Original file line number Diff line number Diff line change 11package policies
22
33import (
4+ "slices"
45 "strings"
56
67 cco "github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1"
@@ -51,8 +52,11 @@ func CredentialsRequestToWifServiceAccount(credReq *cco.CredentialsRequest) (*Se
5152 }
5253
5354 if len (gcpSpec .Permissions ) > 0 {
55+ roleId := strings .ReplaceAll (credReq .Name , "-" , "_" )
56+ roleId = roleId [:min (64 , len (roleId ))]
57+ slices .Sort (gcpSpec .Permissions )
5458 sa .Roles = append (sa .Roles , Role {
55- Id : credReq . Name ,
59+ Id : roleId ,
5660 Kind : "Role" ,
5761 Permissions : gcpSpec .Permissions ,
5862 Predefined : false ,
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ type ServiceAccount struct {
2323}
2424
2525type CredentialRequest struct {
26- SecretRef SecretRef
27- ServiceAccountNames []string
26+ SecretRef SecretRef `json:"secret_ref,omitempty"`
27+ ServiceAccountNames []string `json:"service_account_names,omitempty"`
2828}
2929
3030type SecretRef struct {
31- Name string
32- Namespace string
31+ Name string `json:"name,omitempty"`
32+ Namespace string `json:"namespace,omitempty"`
3333}
3434
3535func (s ServiceAccount ) GetId () string {
You can’t perform that action at this time.
0 commit comments