Skip to content

Commit

Permalink
[CLI-2701] fixing confluent iam rbac role-binding list panic (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-wu24 committed Aug 22, 2023
1 parent ca0ef9d commit d81d815
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/iam/command_rbac_role_binding_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (c *roleBindingCommand) listMyRoleBindings(cmd *cobra.Command, listRoleBind
}

if currentUser {
listRoleBinding.Principal = mdsv2.PtrString("User:" + c.Context.State.Auth.User.GetResourceId())
listRoleBinding.Principal = mdsv2.PtrString("User:" + c.Context.State.Auth.GetUser().GetResourceId())
}

inclusive, err := cmd.Flags().GetBool("inclusive")
Expand Down
7 changes: 7 additions & 0 deletions pkg/config/auth_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ type AuthConfig struct {
Account *ccloudv1.Account `json:"account,omitempty"`
Accounts []*ccloudv1.Account `json:"accounts,omitempty"`
}

func (a *AuthConfig) GetUser() *ccloudv1.User {
if a != nil {
return a.User
}
return nil
}

0 comments on commit d81d815

Please sign in to comment.