cluster

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecretFromCluster

func SecretFromCluster(cluster Cluster) (*corev1.Secret, error)

SecretFromCluster returns a Secret containing cluster data.

Types

type Client

type Client struct {
	Client client.Client

	// Labels is the set of labels that is required.
	Labels labels.Set
}

Client is used to access Secrets containing cluster data.

func (Client) Create

func (cl Client) Create(ctx context.Context, namespace string, clusters []Cluster) error

Create creates a Secret for each item in clusters.

func (Client) Delete

func (cl Client) Delete(ctx context.Context, namespace string, clusters []Cluster) error

Delete deletes Secrets corresponding to clusters.

func (Client) List

func (cl Client) List(ctx context.Context, namespace string) ([]Cluster, error)

List reads cluster Secrets and returns a []Cluster.

func (Client) Update

func (cl Client) Update(ctx context.Context, namespace string, clusters []Cluster) error

Update updates Secrets with clusters.

type Cluster

type Cluster struct {
	// Environment in which the cluster is located (K8sEnvironment eu41d)
	Environment string
	// Name of the cluster (K8sCluster one)
	Name string
	// Domain is the DNS domain (K8sDomain example inf.iitech.dk)
	Domain string
	// Provider Cloud provider (K8sProvider aks)
	Provider string
	// Config contains a kubeconfig to access the cluster.
	Config []byte
}

Cluster contains the data to access a k8s cluster in an environment.

func Diff

func Diff(current, desired []Cluster) (create, update, delete []Cluster)

Diff compares current with desired state and returns clusters to create, update, delete.

func SecretToCluster

func SecretToCluster(secret corev1.Secret) (*Cluster, error)

SecretToCluster returns the cluster data contained by secret.

func (Cluster) Equal

func (lhs Cluster) Equal(rhs Cluster) bool

Equal returns true if lhs and rhs are equal.

Jump to

Keyboard shortcuts

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