clusterstore

package
v0.0.0-...-5cbd3cb Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KCCClusterGVK         = gkeclusterapis.ContainerClusterGVK
	GKEFleetMembershipGVK = gkehubapis.GKEHubMembershipGVK
	KindClusterGVK        = schema.GroupVersionKind{
		Group:   "clusters.gitops.kpt.dev",
		Version: "v1",
		Kind:    "KindCluster",
	}
)

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// Ref is the reference to the target cluster
	Ref    gitopsv1alpha1.ClusterRef
	Labels map[string]string
}

type ClusterStore

type ClusterStore struct {
	// contains filtered or unexported fields
}

func NewClusterStore

func NewClusterStore(client client.Client, config *rest.Config) (*ClusterStore, error)

func (*ClusterStore) GetRESTConfig

func (cs *ClusterStore) GetRESTConfig(ctx context.Context, clusterRef *gitopsv1alpha1.ClusterRef) (*rest.Config, error)

func (*ClusterStore) ListClusters

func (cs *ClusterStore) ListClusters(ctx context.Context, clusterDiscovery *gitopsv1alpha1.ClusterDiscovery, selector *metav1.LabelSelector) ([]Cluster, error)

type ContainerClusterStore

type ContainerClusterStore struct {
	// Config/Client points to the config
	// pointing to where the rollout controller is running
	Config *rest.Config
	client.Client
	WorkloadIdentityHelper
}

ContainerClusterStore represents a store of kubernetes cluster.

func (*ContainerClusterStore) GetRESTConfig

func (cs *ContainerClusterStore) GetRESTConfig(ctx context.Context, name string) (*rest.Config, error)

func (*ContainerClusterStore) Init

func (cs *ContainerClusterStore) Init() error

func (*ContainerClusterStore) ListClusters

func (cs *ContainerClusterStore) ListClusters(ctx context.Context, selector *metav1.LabelSelector) ([]Cluster, error)

type GCPFleetClusterStore

type GCPFleetClusterStore struct {
	// contains filtered or unexported fields
}

func (*GCPFleetClusterStore) GetRESTConfig

func (cs *GCPFleetClusterStore) GetRESTConfig(ctx context.Context, name string) (*rest.Config, error)

func (*GCPFleetClusterStore) ListClusters

func (cs *GCPFleetClusterStore) ListClusters(ctx context.Context, configuration *gitopsv1alpha1.ClusterSourceGCPFleet, labelSelector *metav1.LabelSelector) ([]Cluster, error)

type KindClusterStore

type KindClusterStore struct {
	// Client points to the config
	client.Client
}

func (*KindClusterStore) GetRESTConfig

func (cs *KindClusterStore) GetRESTConfig(ctx context.Context, name string) (*rest.Config, error)

func (*KindClusterStore) ListClusters

func (cs *KindClusterStore) ListClusters(ctx context.Context, selector *metav1.LabelSelector) ([]Cluster, error)

type WorkloadIdentityHelper

type WorkloadIdentityHelper struct {
	// contains filtered or unexported fields
}

WorkloadIdentityHelper is a helper class that does the exchanges needed for workload identity.

func (*WorkloadIdentityHelper) GetGcloudAccessTokenSource

func (r *WorkloadIdentityHelper) GetGcloudAccessTokenSource(ctx context.Context, kubeServiceAccount types.NamespacedName, gcpServiceAccount string) (oauth2.TokenSource, error)

GetGcloudAccessTokenSource does the exchange to get a token for the specified GCP ServiceAccount.

func (*WorkloadIdentityHelper) Init

func (r *WorkloadIdentityHelper) Init(restConfig *rest.Config) error

Init should be called before using a WorkloadIdentityHelper

Jump to

Keyboard shortcuts

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