Skip to content

Commit

Permalink
Merge pull request #156 from darkowlzz/testenv-provision-user
Browse files Browse the repository at this point in the history
testenv: Add AddUser() to provision new user
  • Loading branch information
stefanprodan authored Oct 7, 2021
2 parents 1f33307 + db45852 commit 6a3ed50
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 6a3ed50

Please sign in to comment.