config

package
v1.8.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultVCPort = "443"

	ProviderConfigMapName = "vsphere.provider.config.vmoperator.vmware.com"

	ContentSourceKey = "ContentSource"

	NetworkConfigMapName = "vmoperator-network-config"
	NameserversKey       = "nameservers"    // Key in the NetworkConfigMapName.
	SearchSuffixesKey    = "searchsuffixes" // Key in the NetworkConfigMapName.
)

Variables

This section is empty.

Functions

func GetDNSInformationFromConfigMap

func GetDNSInformationFromConfigMap(ctx context.Context, client ctrlruntime.Client) ([]string, []string, error)

func ProviderConfigToConfigMap

func ProviderConfigToConfigMap(
	namespace string,
	config *VSphereVMProviderConfig,
	vcCredsSecretName string) *corev1.ConfigMap

ProviderConfigToConfigMap returns the ConfigMap for the config. Used only in testing.

func UpdateVcInConfigMap

func UpdateVcInConfigMap(ctx context.Context, client ctrlruntime.Client, vcPNID, vcPort string) (bool, error)

UpdateVcInConfigMap updates the ConfigMap with the new vCenter PNID and Port. Returns false if no updated needed.

Types

type VSphereVMProviderConfig

type VSphereVMProviderConfig struct {
	VcPNID                      string
	VcPort                      string
	VcCreds                     *credentials.VSphereVMProviderCredentials
	Datacenter                  string
	StorageClassRequired        bool // Always true in WCP env.
	UseInventoryAsContentSource bool // Always false in WCP env.
	CAFilePath                  string
	InsecureSkipTLSVerify       bool // Always false in WCP env.

	// These are Zone and/or Namespace specific.
	ResourcePool string
	Folder       string

	// Only set in simulated testing env.
	Datastore string
	Network   string
}

VSphereVMProviderConfig represents the configuration for a Vsphere VM Provider instance. Contains information enabling integration with a backend vSphere instance for VM management.

func ConfigMapToProviderConfig

func ConfigMapToProviderConfig(
	configMap *corev1.ConfigMap,
	vcCreds *credentials.VSphereVMProviderCredentials) (*VSphereVMProviderConfig, error)

ConfigMapToProviderConfig converts the VM provider ConfigMap to a VSphereVMProviderConfig.

func GetProviderConfig

func GetProviderConfig(
	ctx context.Context,
	client ctrlruntime.Client) (*VSphereVMProviderConfig, error)

GetProviderConfig returns a provider config constructed from vSphere Provider ConfigMap in the VM Operator namespace.

Jump to

Keyboard shortcuts

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