ospreytest

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2018 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

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.

func WithoutToken

func WithoutToken(authInfo *clientgo.AuthInfo) *clientgo.AuthInfo

WithoutToken creates a DeepCopy() of authInfo without an id-token.

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

func StartOspreys(testDir string, dexes []*dextest.TestDex, portsFrom int32) ([]*TestOsprey, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL