Documentation
¶
Index ¶
- Constants
- func CheckUsingHeuristic(distro string) (bool, error)
- func CheckUsingSecretAnnotation(ctx context.Context, client kubernetes.Interface, ...) (bool, error)
- func EnsureBackingStoreChanges(ctx context.Context, client kubernetes.Interface, ...) error
- func InitAndValidateConfig(ctx context.Context, vConfig *config.VirtualClusterConfig) error
- func InitClientConfig() (*rest.Config, string, error)
- func InitClients(vConfig *config.VirtualClusterConfig) error
- func SetGlobalOwner(ctx context.Context, vConfig *config.VirtualClusterConfig) error
Constants ¶
const ( AnnotationDistro = "vcluster.loft.sh/distro" AnnotationStore = "vcluster.loft.sh/store" )
Variables ¶
This section is empty.
Functions ¶
func CheckUsingHeuristic ¶
CheckUsingHeuristic checks for known file path indicating the existence of a previous distro.
It checks for the existence of the default K3s token path.
func CheckUsingSecretAnnotation ¶
func CheckUsingSecretAnnotation(ctx context.Context, client kubernetes.Interface, name, namespace, distro string, backingStoreType vclusterconfig.StoreType) (bool, error)
CheckUsingSecretAnnotation checks for backend store and distro changes using annotations on the vCluster's secret annotations. Returns true, if both annotations are set and the check was successful, otherwise false.
func EnsureBackingStoreChanges ¶
func EnsureBackingStoreChanges(ctx context.Context, client kubernetes.Interface, name, namespace, distro string, backingStoreType vclusterconfig.StoreType) error
EnsureBackingStoreChanges ensures that only a certain set of allowed changes to the backing store and distro occur.
func InitAndValidateConfig ¶
func InitAndValidateConfig(ctx context.Context, vConfig *config.VirtualClusterConfig) error
func InitClients ¶
func InitClients(vConfig *config.VirtualClusterConfig) error
func SetGlobalOwner ¶
func SetGlobalOwner(ctx context.Context, vConfig *config.VirtualClusterConfig) error
SetGlobalOwner fetches the owning service and populates in translate.Owner if: the vcluster is configured to setOwner is, and if the currentNamespace == targetNamespace (because cross namespace owner refs don't work).
Types ¶
This section is empty.