Documentation ¶
Index ¶
- func ValidateDomainName(v string) error
- func ValidateEmail(v string) error
- func ValidateJSON(data []byte) error
- type Admin
- type Cluster
- type ErrInvalidIgnConfig
- type ErrMissingNodePool
- type ErrMoreThanOneNodePool
- type ErrSharedNodePool
- type ErrUnmatchedNodePool
- type Internal
- type Master
- type Networking
- type NodePool
- type NodePools
- type Platform
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDomainName ¶
ValidateDomainName checks if the given string is a valid domain name and returns an error if not.
func ValidateEmail ¶
ValidateEmail checks if the given string is a valid email address and returns an error if not.
func ValidateJSON ¶
ValidateJSON validates that the given data is valid JSON.
Types ¶
type Admin ¶
type Admin struct { Email string `json:"tectonic_admin_email" yaml:"email,omitempty"` Password string `json:"tectonic_admin_password" yaml:"password,omitempty"` SSHKey string `json:"tectonic_admin_ssh_key,omitempty" yaml:"sshKey,omitempty"` }
Admin converts admin related config.
type Cluster ¶
type Cluster struct { Admin `json:",inline" yaml:"admin,omitempty"` aws.AWS `json:",inline" yaml:"aws,omitempty"` BaseDomain string `json:"tectonic_base_domain,omitempty" yaml:"baseDomain,omitempty"` IgnitionBootstrap string `json:"ignition_bootstrap,omitempty" yaml:"-"` IgnitionMasters []string `json:"ignition_masters,omitempty" yaml:"-"` IgnitionWorker string `json:"ignition_worker,omitempty" yaml:"-"` Internal `json:",inline" yaml:"-"` libvirt.Libvirt `json:",inline" yaml:"libvirt,omitempty"` Master `json:",inline" yaml:"master,omitempty"` Name string `json:"tectonic_cluster_name,omitempty" yaml:"name,omitempty"` Networking `json:",inline" yaml:"networking,omitempty"` NodePools `json:"-" yaml:"nodePools"` openstack.OpenStack `json:",inline" yaml:"openstack,omitempty"` Platform Platform `json:"tectonic_platform" yaml:"platform,omitempty"` PullSecret string `json:"tectonic_pull_secret,omitempty" yaml:"pullSecret,omitempty"` PullSecretPath string `json:"-" yaml:"pullSecretPath,omitempty"` // Deprecated: remove after openshift/release is ported to pullSecret Worker `json:",inline" yaml:"worker,omitempty"` }
Cluster defines the config for a cluster.
func ConvertInstallConfigToTFVars ¶
func ConvertInstallConfigToTFVars(cfg *types.InstallConfig, bootstrapIgn string, masterIgns []string, workerIgn string) (*Cluster, error)
ConvertInstallConfigToTFVars converts the installconfig to the Cluster struct that represents the terraform.tfvar file. TODO(yifan): Clean up the Cluster struct to trim unnecessary fields.
func ParseConfig ¶
ParseConfig parses a yaml string and returns, if successful, a Cluster.
func ParseConfigFile ¶
ParseConfigFile parses a yaml file and returns, if successful, a Cluster.
func (Cluster) NodeCount ¶
NodeCount will return the number of nodes specified in NodePools with matching names. If no matching NodePools are found, then 0 is returned.
func (*Cluster) Validate ¶
Validate ensures that the Cluster is semantically correct and returns an error if not.
func (*Cluster) ValidateAndLog ¶
ValidateAndLog performs cluster configuration validation using `Validate` but rather than return a slice of errors, it logs any errors and returns a single error for convenience.
type ErrInvalidIgnConfig ¶
type ErrInvalidIgnConfig struct {
// contains filtered or unexported fields
}
ErrInvalidIgnConfig is returned when a invalid ign config is given.
func (*ErrInvalidIgnConfig) Error ¶
func (e *ErrInvalidIgnConfig) Error() string
ErrInvalidIgnConfig implements the error interface.
type ErrMissingNodePool ¶
type ErrMissingNodePool struct {
// contains filtered or unexported fields
}
ErrMissingNodePool is returned when a field that requires a nodePool does not specify one.
func (*ErrMissingNodePool) Error ¶
func (e *ErrMissingNodePool) Error() string
ErrMissingNodePool implements the error interface.
type ErrMoreThanOneNodePool ¶
type ErrMoreThanOneNodePool struct {
// contains filtered or unexported fields
}
ErrMoreThanOneNodePool is returned when a field specifies more than one node pool.
func (*ErrMoreThanOneNodePool) Error ¶
func (e *ErrMoreThanOneNodePool) Error() string
ErrMoreThanOneNodePool implements the error interface.
type ErrSharedNodePool ¶
type ErrSharedNodePool struct {
// contains filtered or unexported fields
}
ErrSharedNodePool is returned when two or more fields are defined to use the same nodePool.
func (*ErrSharedNodePool) Error ¶
func (e *ErrSharedNodePool) Error() string
ErrSharedNodePool implements the error interface.
type ErrUnmatchedNodePool ¶
type ErrUnmatchedNodePool struct {
// contains filtered or unexported fields
}
ErrUnmatchedNodePool is returned when a nodePool was specified but not found in the nodePools list.
func (*ErrUnmatchedNodePool) Error ¶
func (e *ErrUnmatchedNodePool) Error() string
ErrUnmatchedNodePool implements the error interface.
type Internal ¶
type Internal struct {
ClusterID string `json:"tectonic_cluster_id,omitempty" yaml:"clusterId"`
}
Internal converts internal related config.
func ParseInternal ¶
ParseInternal parses a yaml string and returns, if successful, an internal.
func ParseInternalFile ¶
ParseInternalFile parses a yaml file and returns, if successful, an internal.
type Master ¶
type Master struct { Count int `json:"tectonic_master_count,omitempty" yaml:"-"` NodePools []string `json:"-" yaml:"nodePools"` }
Master converts master related config.
type Networking ¶
type Networking struct { Type tectonicnetwork.NetworkType `json:"tectonic_networking,omitempty" yaml:"type,omitempty"` MTU string `json:"-" yaml:"mtu,omitempty"` ServiceCIDR string `json:"tectonic_service_cidr,omitempty" yaml:"serviceCIDR,omitempty"` PodCIDR string `json:"tectonic_cluster_cidr,omitempty" yaml:"podCIDR,omitempty"` }
Networking converts networking related config.
type Platform ¶
type Platform string
Platform indicates the target platform of the cluster.
const ( // PlatformAWS is the platform for a cluster launched on AWS. PlatformAWS Platform = "aws" // PlatformLibvirt is the platform for a cluster launched on libvirt. PlatformLibvirt Platform = "libvirt" // PlatformOpenStack is the platform for a cluster launched on OpenStack. PlatformOpenStack Platform = "openstack" )
func (*Platform) UnmarshalYAML ¶
UnmarshalYAML unmarshals and verifies the platform.