config

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultHostsRewriteImage = "library/alpine:3.20"
)
View Source
const (
	// HybridSchedulingNoEffectWarning is displayed when both the virtual scheduler and the hybrid
	// scheduling are enabled, but no host schedulers have been added.
	HybridSchedulingNoEffectWarning = "You have enabled both the virtual scheduler and the hybrid scheduling, " +
		"but you have not added any host scheduler to sync.toHost.pods.hybridScheduling.hostSchedulers config, " +
		"so all the pods will be scheduled by the default scheduler in the virtual cluster. Enabling " +
		"the hybrid scheduling does not have any effect here. Consider either adding at least one host " +
		"scheduler to sync.toHost.pods.hybridScheduling.hostSchedulers, or disable the hybrid scheduling."
)

Variables

View Source
var ProValidateConfig = func(_ *VirtualClusterConfig) error {
	return nil
}

Functions

func GetLocalCacheOptionsFromConfigMappings added in v0.23.0

func GetLocalCacheOptionsFromConfigMappings(mappings map[string]string, vClusterNamespace string) (cache.Options, bool)

func Lint added in v0.26.0

func Lint(config config.Config) []string

Lint checks the virtual cluster config and returns warnings for the parts of the config that should be probably corrected, but are not breaking any functionality in the cluster.

func ValidateAllSyncPatches added in v0.25.0

func ValidateAllSyncPatches(sync config.Sync) error

ValidateAllSyncPatches validates all sync patches

func ValidateConfigAndSetDefaults added in v0.20.0

func ValidateConfigAndSetDefaults(vConfig *VirtualClusterConfig) error

func ValidatePlatformProject added in v0.28.0

func ValidatePlatformProject(ctx context.Context, config *config.Config, loadedConfig *cliconfig.CLI) error

func ValidateSyncFromHostClasses added in v0.26.0

func ValidateSyncFromHostClasses(fromHost config.SyncFromHost) error

Types

type VirtualClusterConfig added in v0.20.0

type VirtualClusterConfig struct {
	// Holds the vCluster config
	config.Config `json:",inline"`

	// Name is the name of the vCluster
	Name string `json:"name"`

	// HostTargetNamespace is the namespace of the host cluster where the workloads should get created in
	HostTargetNamespace string `json:"hostTargetNamespace,omitempty"`

	// HostNamespace is the namespace in the host cluster where the vCluster is running
	HostNamespace string `json:"hostNamespace,omitempty"`

	// Path is the path to the vCluster config
	Path string `json:"path,omitempty"`

	// HostConfig is the config to access the host cluster
	HostConfig *rest.Config `json:"-"`

	// HostClient is the client to access the host cluster
	HostClient kubernetes.Interface `json:"-"`
}

VirtualClusterConfig wraps the config and adds extra info such as name, serviceName and targetNamespace

func ParseConfig added in v0.20.0

func ParseConfig(path, name string, setValues []string) (*VirtualClusterConfig, error)

func ParseConfigBytes added in v0.28.1

func ParseConfigBytes(data []byte, name string, setValues []string) (*VirtualClusterConfig, error)

func (VirtualClusterConfig) DisableMissingAPIs added in v0.20.0

func (v VirtualClusterConfig) DisableMissingAPIs(discoveryClient discovery.DiscoveryInterface) error

DisableMissingAPIs checks if the apis are enabled, if any are missing, disable the syncer and print a log

func (VirtualClusterConfig) LegacyOptions added in v0.20.0

LegacyOptions converts the config to the legacy cluster options

func (VirtualClusterConfig) SchedulingInVirtualClusterEnabled added in v0.26.0

func (v VirtualClusterConfig) SchedulingInVirtualClusterEnabled() bool

SchedulingInVirtualClusterEnabled returns true if the virtual scheduler or the hybrid scheduling is enabled.

func (VirtualClusterConfig) VirtualClusterKubeConfig added in v0.20.0

func (v VirtualClusterConfig) VirtualClusterKubeConfig() config.VirtualClusterKubeConfig

Jump to

Keyboard shortcuts

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