Documentation ¶
Overview ¶
Package testenv contains common helpers for tests
Index ¶
- Constants
- func AddRandomSuffix(name string, s rand.Source) string
- func ApplyTemplate(k kubectl.Command, asset string, data interface{}) error
- func AssetPath(p ...string) string
- func CreateCluster(k kubectl.Command, namespace, name string, labels map[string]string, ...) error
- func CreateClusterGroup(k kubectl.Command, namespace, name string, matchLabels map[string]string, ...) error
- func CreateGitRepo(k kubectl.Command, namespace string, name string, branch string, shard string, ...) error
- func ExamplePath(p ...string) string
- func NewNamespaceName(name string, s rand.Source) string
- func RandomFilename(filename string, r *rand.Rand) string
- func Root() string
- func SetRoot(dir string)
- func Template(output string, tmplPath string, data any) error
- type Env
- type GitRepoData
Constants ¶
View Source
const Timeout = 5 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func AddRandomSuffix ¶ added in v0.10.0
AddRandomSuffix adds a random suffix to a given name.
func ApplyTemplate ¶ added in v0.7.0
ApplyTemplate templates a file and applies it to the cluster.
func CreateCluster ¶ added in v0.10.0
func CreateClusterGroup ¶ added in v0.10.0
func CreateClusterGroup( k kubectl.Command, namespace, name string, matchLabels map[string]string, labels map[string]string, ) error
CreateClusterGroup uses the template to create a clustergroup resource.
func CreateGitRepo ¶ added in v0.7.0
func CreateGitRepo( k kubectl.Command, namespace string, name string, branch string, shard string, paths ...string, ) error
CreateGitRepo uses the template to create a gitrepo resource. The namespace is the TargetNamespace for the workloads.
func ExamplePath ¶
ExamplePath returns the path to the fleet examples
func NewNamespaceName ¶ added in v0.7.0
NewNamespaceName returns a name for a namespace that is unique to the test run. e.g. as a targetNamespace for workloads
func RandomFilename ¶ added in v0.5.0
RandomName returns a slightly random name, so temporary assets don't conflict
Types ¶
type Env ¶
type Env struct { Kubectl kubectl.Command // Upstream context for cluster containing the fleet controller and local agent Upstream string // Downstream context for fleet-agent cluster Downstream string // Namespace which contains the cluster resource for most E2E tests // (cluster registration namespace) Namespace string // Namespace which contains downstream clusters, besides the local // cluster, for some multi-cluster E2E tests ClusterRegistrationNamespace string }
Click to show internal directories.
Click to hide internal directories.