controllers

package
v0.3.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MPL-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// A finalizer that is added to the VCluster CR to ensure that helm delete is executed.
	CleanupFinalizer = "vcluster.loft.sh/cleanup"

	// DefaultControlPlanePort is the default port for the control plane.
	DefaultControlPlanePort = 443

	// KubeconfigDataName is the key used to store a Kubeconfig in the secret's data field.
	KubeconfigDataName = "value"

	// TLSKeyDataName is the key used to store a TLS private key in the secret's data field.
	TLSKeyDataName = "tls.key"

	// TLSCrtDataName is the key used to store a TLS certificate in the secret's data field.
	TLSCrtDataName = "tls.crt"
)

Variables

This section is empty.

Functions

func DiscoverHostFromService

func DiscoverHostFromService(ctx context.Context, client client.Client, vCluster GenericVCluster) (string, error)

func EnsureFinalizer

func EnsureFinalizer(ctx context.Context, client client.Client, obj client.Object, finalizer string) error

func GetVClusterKubeConfig

func GetVClusterKubeConfig(ctx context.Context, clusterClient client.Client, vCluster GenericVCluster) (*api.Config, error)

func RemoveFinalizer

func RemoveFinalizer(ctx context.Context, client client.Client, obj client.Object, finalizer string) error

Types

type ClientConfigGetter

type ClientConfigGetter interface {
	NewForConfig(restConfig *rest.Config) (kubernetes.Interface, error)
}

func NewClientConfigGetter

func NewClientConfigGetter() ClientConfigGetter

type Credentials

type Credentials struct {
	ClientCert []byte
	ClientKey  []byte
}

func GetVClusterCredentials

func GetVClusterCredentials(ctx context.Context, clusterClient client.Client, vCluster GenericVCluster) (*Credentials, error)

type GenericReconciler

type GenericReconciler struct {
	Client             client.Client
	HelmClient         helm.Client
	HelmSecrets        *helm.Secrets
	Log                logr.Logger
	Scheme             *runtime.Scheme
	ClientConfigGetter ClientConfigGetter
	HTTPClientGetter   HTTPClientGetter
	ControllerName     string

	New func() GenericVCluster
	// contains filtered or unexported fields
}

GenericReconciler reconciles a VCluster object

func (*GenericReconciler) Reconcile

func (r *GenericReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

func (*GenericReconciler) SetupWithManager

func (r *GenericReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type GenericVCluster

type GenericVCluster interface {
	conditions.Setter

	GetSpec() *infrastructurev1alpha1.VClusterSpec
	GetStatus() *infrastructurev1alpha1.VClusterStatus
}

type HTTPClientGetter

type HTTPClientGetter interface {
	ClientFor(r http.RoundTripper, timeout time.Duration) *http.Client
}

func NewHTTPClientGetter

func NewHTTPClientGetter() HTTPClientGetter

Jump to

Keyboard shortcuts

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