Skip to content

Commit

Permalink
fix bug (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny0826 committed Feb 7, 2021
1 parent fe11e48 commit cb2db4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/clear.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type ClearCommand struct {
BaseCommand
}

// Init AliasCommand
// Init ClearCommand
func (cl *ClearCommand) Init() {
cl.command = &cobra.Command{
Use: "clear",
Expand Down
6 changes: 2 additions & 4 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
)

// ClearCommand clean command struct
// CreateCommand clean command struct
type CreateCommand struct {
BaseCommand
}
Expand All @@ -31,7 +31,7 @@ type CreateOptions struct {
namespace string
}

// Init AliasCommand
// Init CreateCommand
func (ce *CreateCommand) Init() {
ce.command = &cobra.Command{
Use: "create",
Expand Down Expand Up @@ -132,7 +132,6 @@ func (co *CreateOptions) chooseNamespace() error {

func (co *CreateOptions) createServiceAccounts() error {
saName := co.userName
// TODO 判断 sa 是否存在
userServiceAccount, err := co.clientSet.CoreV1().ServiceAccounts(co.namespace).Get(context.TODO(), saName, metav1.GetOptions{})
if err != nil {
saObj := &coreV1.ServiceAccount{
Expand Down Expand Up @@ -188,7 +187,6 @@ func (co *CreateOptions) selectClusterRole() error {
}

func (co *CreateOptions) createRoleBinding() error {
co.role = "view"
rb := &rbacV1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-%s", co.userName, co.role),
Expand Down

0 comments on commit cb2db4a

Please sign in to comment.