Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) Apply(ctx context.Context, resources []byte) error
- func (c *Cluster) ClientFromRestConfig(restConfig *rest.Config) (client.Client, error)
- func (c *Cluster) GetClient() (client.Client, error)
- func (c *Cluster) GetClientSet() (*kubernetes.Clientset, error)
- func (c *Cluster) GetName() string
- func (c *Cluster) GetWorkloadClient(ctx context.Context, namespace, name string) (client.Client, error)
- func (c *Cluster) ImageExists(ctx context.Context, image string) bool
- func (c *Cluster) LoadImage(ctx context.Context, image string) error
- func (c *Cluster) Teardown(_ context.Context)
- func (c *Cluster) Wait(ctx context.Context, args ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Name string KubeconfigPath string Client client.Client Scheme *runtime.Scheme WorkloadClusterKubeconfigs map[string]string }
Cluster represents a Kubernetes cluster used as a management cluster backed by kind.
func NewCluster ¶
func NewCluster(ctx context.Context, name string, scheme *runtime.Scheme, images ...string) (*Cluster, error)
NewCluster sets up a new kind cluster to be used as the management cluster.
func NewClusterWithConfig ¶
func NewClusterWithConfig(ctx context.Context, name, configFile string, scheme *runtime.Scheme, images ...string) (*Cluster, error)
NewClusterWithConfig creates a kind cluster using a kind-config file.
func (*Cluster) Apply ¶
Apply wraps `kubectl apply` and prints the output so we can see what gets applied to the cluster. TODO: Remove this usage of kubectl and replace with a function from apply.go using the controller-runtime client.
func (*Cluster) ClientFromRestConfig ¶
ClientFromRestConfig returns a controller-runtime client from a RESTConfig.
func (*Cluster) GetClient ¶
GetClient returns a controller-runtime client for the management cluster.
func (*Cluster) GetClientSet ¶
func (c *Cluster) GetClientSet() (*kubernetes.Clientset, error)
GetClientSet returns a clientset to the management cluster to be used for object interface expansions such as pod logs.
func (*Cluster) GetWorkloadClient ¶
func (c *Cluster) GetWorkloadClient(ctx context.Context, namespace, name string) (client.Client, error)
GetWorkloadClient returns a controller-runtime client for the workload cluster. TODO Use remote package once it returns a controller runtime client