testhelper

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualError

func EqualError(a, b error) bool

EqualError reports whether errors a and b are considered equal. They're equal if both are nil, or both are not nil and a.Error() == b.Error().

func FSWithFiles

func FSWithFiles(ff ...filefunc) func() afero.Fs

FSWithFiles is a testhelper that can be used to quickly setup a MemMapFs with required Files

func NamespaceFromName

func NamespaceFromName(name string) *v1.Namespace

NamespaceFromName creates a simple namespace object for a name

Types

type FilesystemManager

type FilesystemManager struct{}

FilesystemManager is used to manage filefuncs. It is feature identical to its string counterpart SampleKonfManager

func (*FilesystemManager) ActiveDir

func (*FilesystemManager) ActiveDir(fs afero.Fs)

ActiveDir creates standard konf active

func (*FilesystemManager) DSStore

func (*FilesystemManager) DSStore(fs afero.Fs)

DSStore creates a .DS_Store file, that has caused quite some problems in the past

func (*FilesystemManager) EUDir added in v0.2.0

func (*FilesystemManager) EUDir(fs afero.Fs)

EUDir creates an dir called "eu" in StoreDir and ActiveDir. It is mainly used to test globing

func (*FilesystemManager) EmptyDir

func (*FilesystemManager) EmptyDir(fs afero.Fs)

EmptyDir creates an EmptyDir in StoreDir and ActiveDir

func (*FilesystemManager) InvalidYaml

func (*FilesystemManager) InvalidYaml(fs afero.Fs)

InvalidYaml creates an invalidYaml in store and active

func (*FilesystemManager) KonfWithoutContext

func (*FilesystemManager) KonfWithoutContext(fs afero.Fs)

KonfWithoutContext creates a kubeconfig which has no context, but still is valid

func (*FilesystemManager) KonfWithoutContext2 added in v0.5.0

func (*FilesystemManager) KonfWithoutContext2(fs afero.Fs)

KonfWithoutContext2 creates a kubeconfig which has no context, but still is valid

func (*FilesystemManager) LatestKonf

func (*FilesystemManager) LatestKonf(fs afero.Fs)

LatestKonf creates a latestKonfFile pointing to an imaginary context and cluster

func (*FilesystemManager) MultiClusterMultiContext

func (*FilesystemManager) MultiClusterMultiContext(fs afero.Fs)

MultiClusterMultiContext creates a kubeconfig with multiple clusters and contexts in store, resulting in an impure konfstore

func (*FilesystemManager) MultiClusterSingleContext

func (*FilesystemManager) MultiClusterSingleContext(fs afero.Fs)

MultiClusterSingleContext creates a kubeconfig with multiple clusters and one context in store, resulting in an impure konfstore

func (*FilesystemManager) SingleClusterMultiContext

func (*FilesystemManager) SingleClusterMultiContext(fs afero.Fs)

SingleClusterMultiContext creates a kubeconfig with one cluster and multiple contexts in store, resulting in an impure konfstore

func (*FilesystemManager) SingleClusterSingleContextASIA

func (*FilesystemManager) SingleClusterSingleContextASIA(fs afero.Fs)

SingleClusterSingleContextASIA creates a valid kubeconfig in store and active

func (*FilesystemManager) SingleClusterSingleContextASIA2 added in v0.2.0

func (*FilesystemManager) SingleClusterSingleContextASIA2(fs afero.Fs)

SingleClusterSingleContextASIA2 creates a second valid kubeconfig in store and active. It is mainly used for glob testing

func (*FilesystemManager) SingleClusterSingleContextEU

func (*FilesystemManager) SingleClusterSingleContextEU(fs afero.Fs)

SingleClusterSingleContextEU creates a valid kubeconfig in store and active

func (*FilesystemManager) SingleClusterSingleContextEU2 added in v0.2.0

func (*FilesystemManager) SingleClusterSingleContextEU2(fs afero.Fs)

SingleClusterSingleContextEU2 creates a second valid kubeconfig in store and active. It is mainly used for glob testing

func (*FilesystemManager) StoreDir

func (*FilesystemManager) StoreDir(fs afero.Fs)

StoreDir creates standard konf store

type SampleKonfManager

type SampleKonfManager struct{}

SampleKonfManager is used to manage kubeconfig strings. It is feature identical to its file counterpart FilesystemManager

func (*SampleKonfManager) MultiClusterMultiContext

func (*SampleKonfManager) MultiClusterMultiContext() string

MultiClusterMultiContext returns a valid kubeconfig, that is unprocessed

func (*SampleKonfManager) MultiClusterSingleContext

func (*SampleKonfManager) MultiClusterSingleContext() string

MultiClusterSingleContext returns a valid kubeconfig, that is unprocessed

func (*SampleKonfManager) SingleClusterSingleContextASIA

func (*SampleKonfManager) SingleClusterSingleContextASIA() string

SingleClusterSingleContextASIA returns a valid kubeconfig

func (*SampleKonfManager) SingleClusterSingleContextEU

func (*SampleKonfManager) SingleClusterSingleContextEU() string

SingleClusterSingleContextEU returns a valid kubeconfig

Jump to

Keyboard shortcuts

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