Documentation ¶
Index ¶
- func Client(args ...string) *clitest.CommandWrapper
- func StopOsprey(server *TestOsprey) error
- func WithoutToken(authInfo *clientgo.AuthInfo) *clientgo.AuthInfo
- type TestConfig
- type TestOsprey
- func (o *TestOsprey) CallHealthcheck() (*http.Response, error)
- func (o *TestOsprey) OspreyconfigAliasName() string
- func (o *TestOsprey) OspreyconfigTargetName() string
- func (o *TestOsprey) ToGroupClaims(authInfo *clientgo.AuthInfo) ([]string, error)
- func (o *TestOsprey) ToKubeconfigCluster() *clientgo.Cluster
- func (o *TestOsprey) ToKubeconfigContext() *clientgo.Context
- func (o *TestOsprey) ToKubeconfigUserWithoutToken() *clientgo.AuthInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(args ...string) *clitest.CommandWrapper
Client returns a CommandWrapper for the osprey binary with the provided args arguments.
func StopOsprey ¶
func StopOsprey(server *TestOsprey) error
StopOsprey stops the TestOsprey server. Returns an error if any happened.
Types ¶
type TestConfig ¶
type TestConfig struct { *ospreyClient.Config ConfigFile string }
TestConfig represents an Osprey client configuration file used for testing.
func BuildCADataConfig ¶ added in v1.1.0
func BuildCADataConfig(testDir string, servers []*TestOsprey, caData bool, caPath string) (*TestConfig, error)
BuildCADataConfig creates an ospreyconfig file with as many targets as servers are provided. It uses testDir as the home for the .kube and .osprey folders. It also base64 encodes the CA data instead of using the file path.
func BuildConfig ¶
func BuildConfig(testDir string, servers []*TestOsprey) (*TestConfig, error)
BuildConfig creates an ospreyconfig file with as many targets as servers are provided. It uses testDir as the home for the .kube and .osprey folders.
type TestOsprey ¶
type TestOsprey struct { *clitest.AsyncCommandWrapper Port int32 Environment string APIServerURL string APIServerCA string Secret string URL string IssuerURL string IssuerPath string IssuerCA string KeyFile string CertFile string TestDir string }
TestOsprey represents an Osprey server instance used for testing.
func StartOspreys ¶
StartOspreys creates one Osprey test server per TestDex provided, using ports starting from portsFrom. The Osprey directory will be testDir/dex.Environment.
func (*TestOsprey) CallHealthcheck ¶ added in v1.1.0
func (o *TestOsprey) CallHealthcheck() (*http.Response, error)
CallHealthcheck returns the current status of osprey's healthcheck as an http response and error
func (*TestOsprey) OspreyconfigAliasName ¶
func (o *TestOsprey) OspreyconfigAliasName() string
OspreyconfigAliasName returns the ospreyconfig target's alias for the TestOsprey instance.
func (*TestOsprey) OspreyconfigTargetName ¶
func (o *TestOsprey) OspreyconfigTargetName() string
OspreyconfigTargetName returns the ospreyconfig target's name for the TestOsprey instance.
func (*TestOsprey) ToGroupClaims ¶
func (o *TestOsprey) ToGroupClaims(authInfo *clientgo.AuthInfo) ([]string, error)
ToGroupClaims returns the groups contained in the groups claim of the id-token for the authInfo. If no tokens exists it returns an empty slice.
func (*TestOsprey) ToKubeconfigCluster ¶
func (o *TestOsprey) ToKubeconfigCluster() *clientgo.Cluster
ToKubeconfigCluster returns a *Cluster representation of the TestOsprey instance.
func (*TestOsprey) ToKubeconfigContext ¶
func (o *TestOsprey) ToKubeconfigContext() *clientgo.Context
ToKubeconfigContext returns a *Context representation of the TestOsprey instance.
func (*TestOsprey) ToKubeconfigUserWithoutToken ¶
func (o *TestOsprey) ToKubeconfigUserWithoutToken() *clientgo.AuthInfo
ToKubeconfigUserWithoutToken returns an *AuthInfo representation, with an empty id-token, of the TestOsprey instance.