Skip to content

Commit

Permalink
testenv: Add AddUser() to provision new user
Browse files Browse the repository at this point in the history
Add `Environment.AddUser()` to allow provisioning of new cluster user.

Signed-off-by: Sunny <[email protected]>
  • Loading branch information
darkowlzz committed Oct 7, 2021
1 parent 1f33307 commit db45852
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime/testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,13 @@ func (e *Environment) CreateNamespace(ctx context.Context, generateName string)
}
return ns, nil
}

// AddUser provisions a new user for connecting to this Environment. The user
// will have the specified name & belong to the specified groups.
//
// If a "base" config is specified, the returned REST Config will contain those
// settings as well as any required by the authentication method. It can also
// be used to specify options like QPS.
func (e *Environment) AddUser(user envtest.User, baseConfig *rest.Config) (*envtest.AuthenticatedUser, error) {
return e.env.AddUser(user, baseConfig)
}

0 comments on commit db45852

Please sign in to comment.