Documentation ¶
Index ¶
- Constants
- Variables
- func ReadClusterEnvironmentVariables() (envVars map[ClusterType]map[ClusterEnvVar]string, errs []error)
- type ClusterEnvVar
- type ClusterType
- type EnvVarRestriction
- type ResourceTFConfigBuilder
- func (builder *ResourceTFConfigBuilder) BuildNodePools(workerClass string, overrides string, osImageName string, ...) string
- func (builder *ResourceTFConfigBuilder) GetTKGMClusterConfig(tkgmEnvVars map[ClusterEnvVar]string, nodePoolsNum int) string
- func (builder *ResourceTFConfigBuilder) GetTKGSClusterConfig(tkgsEnvVars map[ClusterEnvVar]string, nodePoolsNum int) string
Constants ¶
View Source
const ( TKGMClusterResourceName = "test_tkgm_cluster" TKGSClusterResourceName = "test_tkgs_cluster" )
Variables ¶
View Source
var ( TKGMClusterResourceFullName = fmt.Sprintf("%s.%s", tanzukubernetesclusteres.ResourceName, TKGMClusterResourceName) TKGSClusterResourceFullName = fmt.Sprintf("%s.%s", tanzukubernetesclusteres.ResourceName, TKGSClusterResourceName) TKGMClusterName = acctest.RandomWithPrefix("test-tkgm-cls") TKGSClusterName = acctest.RandomWithPrefix("test-tkgs-cls") )
View Source
var ( ClusterEnvironmentVariables = map[ClusterType]map[EnvVarRestriction]map[ClusterEnvVar]bool{ TKGMClusterType: { RequiredEnvVar: { TKGMManagementClusterNameEnv: true, TKGMProvisionerNameEnv: true, TKGMClusterVersionEnv: true, TKGMClusterClassEnv: true, TKGMClusterVariablesEnv: true, TKGMOSImageNameEnv: true, TKGMOSImageVersionEnv: true, TKGMOSImageArchEnv: true, TKGMWorkerClassEnv: true, }, OptionalEnvVar: { TKGMNodePoolOverridesEnv: true, }, }, TKGSClusterType: { RequiredEnvVar: { TKGSManagementClusterNameEnv: true, TKGSProvisionerNameEnv: true, TKGSClusterVersionEnv: true, TKGSClusterClassEnv: true, TKGSClusterVariablesEnv: true, TKGSOSImageNameEnv: true, TKGSOSImageVersionEnv: true, TKGSOSImageArchEnv: true, TKGSWorkerClassEnv: true, }, OptionalEnvVar: { TKGSNodePoolOverridesEnv: true, }, }, } )
Functions ¶
func ReadClusterEnvironmentVariables ¶
func ReadClusterEnvironmentVariables() (envVars map[ClusterType]map[ClusterEnvVar]string, errs []error)
Types ¶
type ClusterEnvVar ¶
type ClusterEnvVar string
const ( // TKGM Env Vars. TKGMManagementClusterNameEnv ClusterEnvVar = "TKGM_MANAGEMENT_CLUSTER_NAME" TKGMProvisionerNameEnv ClusterEnvVar = "TKGM_PROVISIONER_NAME" TKGMClusterVersionEnv ClusterEnvVar = "TKGM_CLUSTER_VERSION" TKGMClusterClassEnv ClusterEnvVar = "TKGM_CLUSTER_CLASS" TKGMClusterVariablesEnv ClusterEnvVar = "TKGM_CLUSTER_VARIABLES" TKGMOSImageNameEnv ClusterEnvVar = "TKGM_OS_IMAGE_NAME" TKGMOSImageVersionEnv ClusterEnvVar = "TKGM_OS_IMAGE_VERSION" TKGMOSImageArchEnv ClusterEnvVar = "TKGM_OS_IMAGE_ARCH" TKGMWorkerClassEnv ClusterEnvVar = "TKGM_WORKER_CLASS" TKGMNodePoolOverridesEnv ClusterEnvVar = "TKGM_NODE_POOL_OVERRIDES" // TKGS Env Vars. TKGSManagementClusterNameEnv ClusterEnvVar = "TKGS_MANAGEMENT_CLUSTER_NAME" TKGSProvisionerNameEnv ClusterEnvVar = "TKGS_PROVISIONER_NAME" TKGSClusterVersionEnv ClusterEnvVar = "TKGS_CLUSTER_VERSION" TKGSClusterClassEnv ClusterEnvVar = "TKGS_CLUSTER_CLASS" TKGSClusterVariablesEnv ClusterEnvVar = "TKGS_CLUSTER_VARIABLES" TKGSOSImageNameEnv ClusterEnvVar = "TKGS_OS_IMAGE_NAME" TKGSOSImageVersionEnv ClusterEnvVar = "TKGS_OS_IMAGE_VERSION" TKGSOSImageArchEnv ClusterEnvVar = "TKGS_OS_IMAGE_ARCH" TKGSWorkerClassEnv ClusterEnvVar = "TKGS_WORKER_CLASS" TKGSNodePoolOverridesEnv ClusterEnvVar = "TKGS_NODE_POOL_OVERRIDES" )
type ClusterType ¶
type ClusterType string
const ( TKGMClusterType ClusterType = "TKGM" TKGSClusterType ClusterType = "TKGS" )
type EnvVarRestriction ¶
type EnvVarRestriction string
const ( RequiredEnvVar EnvVarRestriction = "Required" OptionalEnvVar EnvVarRestriction = "Optional" )
type ResourceTFConfigBuilder ¶
type ResourceTFConfigBuilder struct {
NodePoolDefinition string
}
func InitResourceTFConfigBuilder ¶
func InitResourceTFConfigBuilder() *ResourceTFConfigBuilder
func (*ResourceTFConfigBuilder) BuildNodePools ¶
func (*ResourceTFConfigBuilder) GetTKGMClusterConfig ¶
func (builder *ResourceTFConfigBuilder) GetTKGMClusterConfig(tkgmEnvVars map[ClusterEnvVar]string, nodePoolsNum int) string
func (*ResourceTFConfigBuilder) GetTKGSClusterConfig ¶
func (builder *ResourceTFConfigBuilder) GetTKGSClusterConfig(tkgsEnvVars map[ClusterEnvVar]string, nodePoolsNum int) string
Click to show internal directories.
Click to hide internal directories.