kind

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns a fixture that exposes Kubernetes configuration/context information about a KinD cluster. If no such KinD cluster exists, one will be created. If the KinD cluster is created, it is destroyed at the end of the fixture's scope (when Fixture.Stop() is called). The returned fixture exposes some state keys:

  • "kube.config" returns the path of the kubeconfig file to use with this KinD cluster
  • "kube.context" returns the kubecontext to use with this KinD cluster

Types

type KindFixture

type KindFixture struct {

	// ClusterName is the name of the KinD cluster. If not specified, gdt will
	// use the default cluster name that KinD uses, which is just "kind"
	ClusterName string
	// Context is the name of the kubecontext to use. If not specified, gdt
	// will use the default KinD context, which is "kind-{cluster_name}"
	// See https://github.com/kubernetes-sigs/kind/blob/3610f606516ccaa88aa098465d8c13af70937050/pkg/cluster/internal/kubeconfig/internal/kubeconfig/helpers.go#L23-L26
	Context string
	// contains filtered or unexported fields
}

KindFixture implements `gdttypes.Fixture` and exposes connection/config information about a running KinD cluster.

func (*KindFixture) HasState

func (f *KindFixture) HasState(key string) bool

func (*KindFixture) Start

func (f *KindFixture) Start()

func (*KindFixture) State

func (f *KindFixture) State(key string) interface{}

func (*KindFixture) Stop

func (f *KindFixture) Stop()

type KindFixtureModifier

type KindFixtureModifier func(*KindFixture)

func WithClusterName

func WithClusterName(name string) KindFixtureModifier

WithClusterName modifies the KindFixture's cluster name

func WithContext

func WithContext(name string) KindFixtureModifier

WithContext modifies the KindFixture's kubecontext

Jump to

Keyboard shortcuts

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