internal

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIServerDefaultArgs = []string{

	"--advertise-address=127.0.0.1",
	"--etcd-servers={{ if .EtcdURL }}{{ .EtcdURL.String }}{{ end }}",
	"--cert-dir={{ .CertDir }}",
	"--insecure-port={{ if .URL }}{{ .URL.Port }}{{ end }}",
	"--insecure-bind-address={{ if .URL }}{{ .URL.Hostname }}{{ end }}",
	"--secure-port={{ if .SecurePort }}{{ .SecurePort }}{{ end }}",
	"--disable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,TaintNodesByCondition,Priority,DefaultTolerationSeconds,DefaultStorageClass,StorageObjectInUseProtection,PersistentVolumeClaimResize,ResourceQuota",
	"--service-cluster-ip-range=10.0.0.0/24",
	"--allow-privileged=true",
}
View Source
var EtcdDefaultArgs = []string{
	"--listen-peer-urls=http://localhost:0",
	"--advertise-client-urls={{ if .URL }}{{ .URL.String }}{{ end }}",
	"--listen-client-urls={{ if .URL }}{{ .URL.String }}{{ end }}",
	"--data-dir={{ .DataDir }}",
}

Functions

func BinPathFinder

func BinPathFinder(symbolicName string) (binPath string)

BinPathFinder checks the an environment variable, derived from the symbolic name, and falls back to a default assets location when this variable is not set

func DoAPIServerArgDefaulting

func DoAPIServerArgDefaulting(args []string) []string

func DoEtcdArgDefaulting

func DoEtcdArgDefaulting(args []string) []string

func GetEtcdStartMessage

func GetEtcdStartMessage(listenURL url.URL) string

func RenderTemplates

func RenderTemplates(argTemplates []string, data interface{}) (args []string, err error)

Types

type CertPair added in v0.5.1

type CertPair struct {
	Key  crypto.Signer
	Cert *x509.Certificate
}

CertPair is a private key and certificate for use for client auth, as a CA, or serving.

func (CertPair) AsBytes added in v0.5.1

func (k CertPair) AsBytes() (cert []byte, key []byte, err error)

AsBytes encodes keypair in the appropriate formats for on-disk storage (PEM and PKCS8, respectively).

func (CertPair) CertBytes added in v0.5.1

func (k CertPair) CertBytes() []byte

CertBytes returns the PEM-encoded version of the certificate for this pair.

type DefaultedProcessInput

type DefaultedProcessInput struct {
	URL              url.URL
	Dir              string
	DirNeedsCleaning bool
	Path             string
	StopTimeout      time.Duration
	StartTimeout     time.Duration
}

func DoDefaulting

func DoDefaulting(
	name string,
	listenURL *url.URL,
	dir string,
	path string,
	startTimeout time.Duration,
	stopTimeout time.Duration,
) (DefaultedProcessInput, error)

type ProcessState

type ProcessState struct {
	DefaultedProcessInput
	Session *gexec.Session
	// Healthcheck Endpoint. If we get http.StatusOK from this endpoint, we
	// assume the process is ready to operate. E.g. "/healthz". If this is set,
	// we ignore StartMessage.
	HealthCheckEndpoint string
	// HealthCheckPollInterval is the interval which will be used for polling the
	// HealthCheckEndpoint.
	// If left empty it will default to 100 Milliseconds.
	HealthCheckPollInterval time.Duration
	// StartMessage is the message to wait for on stderr. If we receive this
	// message, we assume the process is ready to operate. Ignored if
	// HealthCheckEndpoint is specified.
	//
	// The usage of StartMessage is discouraged, favour HealthCheckEndpoint
	// instead!
	//
	// Deprecated: Use HealthCheckEndpoint in favour of StartMessage
	StartMessage string
	Args         []string
	// contains filtered or unexported fields
}

func (*ProcessState) Start

func (ps *ProcessState) Start(stdout, stderr io.Writer) (err error)

func (*ProcessState) Stop

func (ps *ProcessState) Stop() error

type TinyCA added in v0.5.1

type TinyCA struct {
	CA CertPair
	// contains filtered or unexported fields
}

TinyCA supports signing serving certs and client-certs, and can be used as an auth mechanism with envtest.

func NewTinyCA added in v0.5.1

func NewTinyCA() (*TinyCA, error)

func (*TinyCA) NewServingCert added in v0.5.1

func (c *TinyCA) NewServingCert() (CertPair, error)

NewServingCert returns a new CertPair for a serving HTTPS on localhost.

Directories

Path Synopsis
Package integrariontests is holding the integration tests to run against the framework.
Package integrariontests is holding the integration tests to run against the framework.

Jump to

Keyboard shortcuts

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