Skip to content

Commit

Permalink
Add user "etcd" to role "root" so that the default tls client works
Browse files Browse the repository at this point in the history
  • Loading branch information
hvgirish authored and Quentin-M committed Aug 25, 2021
1 parent ac1d785 commit e7ab44b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/operator/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ func (s *Operator) enableACL(ctx context.Context, config *etcd.ACLConfig) error
return err
}

if _, err := s.etcdClient.UserAddWithOptions(ctx, "etcd", "", &clientv3.UserAddOptions{NoPassword: true}); err != nil {
return err
}

if _, err := s.etcdClient.UserGrantRole(ctx, "etcd", "root"); err != nil {
return err
}

if _, err := s.etcdClient.AuthEnable(ctx); err != nil {
return err
}
Expand Down

0 comments on commit e7ab44b

Please sign in to comment.