Documentation ¶
Overview ¶
Package tkgconfigupdater provides utilities to update tkg configs
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfigMap = map[string]string{ constants.KeyCertManagerTimeout: constants.DefaultCertmanagerDeploymentTimeout.String(), }
DefaultConfigMap default configuration map
View Source
var KeysToEncode = []string{ constants.ConfigVariableVspherePassword, constants.ConfigVariableAWSAccessKeyID, constants.ConfigVariableAWSSecretAccessKey, constants.ConfigVariableAzureClientID, constants.ConfigVariableAzureClientSecret, constants.ConfigVariableNsxtPassword, constants.ConfigVariableAviPassword, constants.ConfigVariableLDAPBindPassword, constants.ConfigVariableOIDCIdentiryProviderClientSecret, }
KeysToEncode all keys to encode
View Source
var KeysToNeverPersist = []string{ constants.ConfigVariableAWSAccessKeyID, constants.ConfigVariableAWSSecretAccessKey, constants.ConfigVariableAWSSessionToken, constants.ConfigVariableAWSB64Credentials, }
KeysToNeverPersist are all keys that should never be persisted
Functions ¶
func GetNodeIndex ¶
GetNodeIndex returns index of the node
func SaveConfig ¶
func SaveConfig(clusterConfigPath string, rw tkgconfigreaderwriter.TKGConfigReaderWriter, configObj interface{}) error
SaveConfig saves and updates key-value pairs in existing config file
func SetVariableInConfig ¶
SetVariableInConfig allows to explicit override of config value with updating the value in provided tkg-config file i.e. it will add the "key: value" in the tkg-config file if key is not present if key is present it will update the value of the key in the file
Types ¶
type Client ¶
type Client interface { // EnsureTKGConfigFile ensures creating settings file EnsureTKGConfigFile() (string, error) // EnsureConfigImages ensures that `images:“ config exists and is up-to-date in tkg settings file // images: // all: // repository: projects-stg.registry.vmware.com/tkg/cluster-api // cert-manager: // repository: projects-stg.registry.vmware.com/tkg // tag: v0.16.1_vmware.1 EnsureConfigImages() error // DecodeCredentialsInViper decode the credentials stored in viper DecodeCredentialsInViper() error CheckInfrastructureVersion(providerName string) (string, error) GetDefaultInfrastructureVersion(providerName string) (string, error) EnsureProviderTemplates() error SetDefaultConfiguration() // CheckProviderTemplatesNeedUpdate checks if .tkg/providers is up-to-date. CheckProviderTemplatesNeedUpdate() (bool, error) // CheckBOMsNeedUpdate checks if bom files are up-to-date. // returns true if $HOME/.tkg/bom directory exists, not empty and doesn't contain the defaultBoM file CheckBOMsNeedUpdate() (bool, error) // EnsureBOMFiles ensures the local BOM files. If forceUpdate option is set, TKG compatibility file would fetched // from the registry and would update BOM files if the latest TKG compatibility file version points to new BOM files EnsureBOMFiles(forceUpdate bool) error // EnsureTKGCompatibilityFile ensures the TKG compatibility file. If forceUpdate option is set,TKG compatibility would fetched // TKG compatibility file would fetched from the registry though local copy exists EnsureTKGCompatibilityFile(forceUpdate bool) error // EnsureCredEncoding ensures the credentials encoding EnsureCredEncoding(tkgConfigNode *yaml.Node) EnsureImages(needUpdate bool, tkgConfigNode *yaml.Node) error // EnsureProvidersInConfig ensures the providers section in tkgconfig exisits and it is synchronized with the latest providers EnsureProvidersInConfig(needUpdate bool, tkgConfigNode *yaml.Node) error // EnsureTemplateFiles ensures that $HOME/.tkg/providers exists and it is up-to-date EnsureTemplateFiles() (bool, error) }
Client implements TKG configuration updater functions
func New ¶
func New(configDir string, providerGetter providerinterface.ProviderInterface, tkgConfigReaderWriter tkgconfigreaderwriter.TKGConfigReaderWriter) Client
New creates new tkgconfig updater client
Click to show internal directories.
Click to hide internal directories.