clusters

package
v0.104.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LabelKeyTargetSync     = lsv1alpha1.LandscaperDomain + "/targetsync"
	LabelValueTargetSyncOk = "ok"
)

Variables

This section is empty.

Functions

func BuildOIDCKubeconfig

func BuildOIDCKubeconfig(ctx context.Context, issuerURL, clientID string, target *v1alpha1.Target,
	targetResolver targetresolver.TargetResolver) (string, error)

func GetShootClusterNameFromKubeconfig

func GetShootClusterNameFromKubeconfig(_ context.Context, kubeconfigBytes []byte) (string, error)

GetShootClusterNameFromKubeconfig determines the name of a Gardener shoot cluster from a given kubeconfig.

func HasTargetSyncLabel

func HasTargetSyncLabel(obj metav1.Object) bool

HasTargetSyncLabel returns whether an object has the targetsync label. The targets and secrets that are managed by the targetsync are marked with this label. Moreover, the setting "skipUninstallIfClusterRemoved" of deployitems is only supported for deployitems whose target is managed by the targetsync.

Types

type DefaultSourceClientProvider

type DefaultSourceClientProvider struct{}

func (*DefaultSourceClientProvider) GetSourceClient

func (p *DefaultSourceClientProvider) GetSourceClient(
	ctx context.Context,
	targetSync *lsv1alpha1.TargetSync,
	targetClient client.Client,
	schema *runtime.Scheme) (client.Client, *rest.Config, error)

func (*DefaultSourceClientProvider) GetSourceShootClient

func (p *DefaultSourceClientProvider) GetSourceShootClient(
	ctx context.Context,
	targetSync *lsv1alpha1.TargetSync,
	targetClient client.Client) (*ShootClient, error)

type ShootClient

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

func NewShootClient

func NewShootClient(gardenKubeconfigBytes []byte) (*ShootClient, error)

func NewShootClientFromTarget

func NewShootClientFromTarget(ctx context.Context, gardenTarget *v1alpha1.Target, targetResolver targetresolver.TargetResolver) (*ShootClient, error)

func (*ShootClient) ExistsShoot

func (c *ShootClient) ExistsShoot(ctx context.Context, shootNamespace, shootName string) (bool, error)

func (*ShootClient) GetShoot

func (c *ShootClient) GetShoot(ctx context.Context, shootNamespace, shootName string) (*unstructured.Unstructured, error)

func (*ShootClient) GetShootAdminKubeconfig

func (c *ShootClient) GetShootAdminKubeconfig(ctx context.Context, shootName, shootNamespace string, kubeconfigExpirationSeconds int64) (string, metav1.Time, error)

GetShootAdminKubeconfig returns a short-lived admin kubeconfig for the specified shoot as base64 encoded string.

func (*ShootClient) ListShoots

func (c *ShootClient) ListShoots(ctx context.Context, shootNamespace string) (*unstructured.UnstructuredList, error)

ListShoots returns the list of shoot in the specified namespace

type SourceClientProvider

type SourceClientProvider interface {
	GetSourceClient(
		ctx context.Context,
		targetSync *lsv1alpha1.TargetSync,
		targetClient client.Client,
		schema *runtime.Scheme) (client.Client, *rest.Config, error)

	GetSourceShootClient(
		ctx context.Context,
		targetSync *lsv1alpha1.TargetSync,
		targetClient client.Client) (*ShootClient, error)
}

func NewDefaultSourceClientProvider

func NewDefaultSourceClientProvider() SourceClientProvider

func NewTrivialSourceClientProvider

func NewTrivialSourceClientProvider(sourceClient client.Client, shootClient *ShootClient) SourceClientProvider

type TokenClient

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

func NewTokenClient

func NewTokenClient(kubeconfigBytes []byte) (*TokenClient, error)

func NewTokenClientFromTarget

func NewTokenClientFromTarget(ctx context.Context, target *v1alpha1.Target, targetResolver targetresolver.TargetResolver) (*TokenClient, error)

func (*TokenClient) GetServiceAccountKubeconfig

func (c *TokenClient) GetServiceAccountKubeconfig(ctx context.Context, serviceAccountName, serviceAccountNamespace string,
	expirationSeconds int64) (string, metav1.Time, error)

func (*TokenClient) GetServiceAccountToken

func (c *TokenClient) GetServiceAccountToken(ctx context.Context, serviceAccountName, serviceAccountNamespace string,
	expirationSeconds int64) (string, metav1.Time, error)

type TrivialSourceClientProvider

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

func (*TrivialSourceClientProvider) GetSourceClient

func (*TrivialSourceClientProvider) GetSourceShootClient

Jump to

Keyboard shortcuts

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