Documentation ¶
Index ¶
- Constants
- func NewInvalidClusterDirError(missingFiles []string) error
- func NewValidationError(msg string, path string) error
- type ApplyAction
- type Cluster
- type ClusterMeta
- func (c ClusterMeta) AppliedConfigPath() string
- func (c ClusterMeta) ConfigDir() string
- func (c ClusterMeta) ContainsAppliedConfig() bool
- func (c ClusterMeta) ContainsKubeconfig() bool
- func (c ClusterMeta) ContainsTfStateConfig() bool
- func (c *ClusterMeta) Destroy() error
- func (c ClusterMeta) InfrastructureConfigPath() string
- func (c ClusterMeta) KubeconfigPath() string
- func (c ClusterMeta) PrivateSshKeyPath() string
- func (c *ClusterMeta) Provisioner() provisioner.Provisioner
- func (c ClusterMeta) TfStatePath() string
- type ClusterMock
Constants ¶
View Source
const ( DefaultConfigDir = "config" DefaultTerraformDir = DefaultConfigDir + "/terraform" DefaultNewConfigFilename = "kubitect.yaml" DefaultAppliedConfigFilename = "kubitect-applied.yaml" DefaultInfraConfigFilename = "infrastructure.yaml" DefaultTerraformStateFilename = "terraform.tfstate" DefaultKubeconfigFilename = "admin.conf" )
Variables ¶
This section is empty.
Functions ¶
func NewValidationError ¶
Types ¶
type ApplyAction ¶
type ApplyAction string
const ( UNKNOWN ApplyAction = "unknown" CREATE ApplyAction = "create" UPGRADE ApplyAction = "upgrade" SCALE ApplyAction = "scale" )
func ToApplyActionType ¶
func ToApplyActionType(a string) (ApplyAction, error)
func (ApplyAction) String ¶
func (a ApplyAction) String() string
type Cluster ¶
type Cluster struct { ClusterMeta NewConfigPath string // Configuration files NewConfig *modelconfig.Config AppliedConfig *modelconfig.Config InfraConfig *modelinfra.Config }
func NewCluster ¶
func NewCluster(ctx app.AppContext, configPath string) (*Cluster, error)
NewCluster returns new Cluster instance with populated general fields. Cluster name and path are extracted from the provided configuration file. Previously applied configuration is also read, if cluster already exists.
func (*Cluster) Apply ¶
Apply either creates new or modifies an existing cluster, based on the provided action.
func (*Cluster) ApplyNewConfig ¶
ApplyNewConfig replaces currently applied config with new one.
func (*Cluster) Provisioner ¶
func (c *Cluster) Provisioner() provisioner.Provisioner
func (*Cluster) StoreNewConfig ¶
StoreNewConfig makes a copy of the provided (new) configuration file in cluster directory.
type ClusterMeta ¶
type ClusterMeta struct { app.AppContext Name string Path string Local bool // contains filtered or unexported fields }
func (ClusterMeta) AppliedConfigPath ¶
func (c ClusterMeta) AppliedConfigPath() string
func (ClusterMeta) ConfigDir ¶
func (c ClusterMeta) ConfigDir() string
func (ClusterMeta) ContainsAppliedConfig ¶
func (c ClusterMeta) ContainsAppliedConfig() bool
func (ClusterMeta) ContainsKubeconfig ¶
func (c ClusterMeta) ContainsKubeconfig() bool
func (ClusterMeta) ContainsTfStateConfig ¶
func (c ClusterMeta) ContainsTfStateConfig() bool
func (*ClusterMeta) Destroy ¶
func (c *ClusterMeta) Destroy() error
Destroy destroys an active cluster and removes cluster's directory. If cluster does not exist or does not contain a terraform state file (is inactive), an error is returned.
func (ClusterMeta) InfrastructureConfigPath ¶
func (c ClusterMeta) InfrastructureConfigPath() string
func (ClusterMeta) KubeconfigPath ¶
func (c ClusterMeta) KubeconfigPath() string
func (ClusterMeta) PrivateSshKeyPath ¶
func (c ClusterMeta) PrivateSshKeyPath() string
func (*ClusterMeta) Provisioner ¶
func (c *ClusterMeta) Provisioner() provisioner.Provisioner
func (ClusterMeta) TfStatePath ¶
func (c ClusterMeta) TfStatePath() string
type ClusterMock ¶
type ClusterMock struct { *Cluster // contains filtered or unexported fields }
func MockCluster ¶
func MockCluster(t *testing.T) *ClusterMock
func MockLocalCluster ¶
func MockLocalCluster(t *testing.T) *ClusterMock
func (*ClusterMock) AppContext ¶
func (m *ClusterMock) AppContext() app.AppContextMock
func (*ClusterMock) Ui ¶
func (m *ClusterMock) Ui() ui.UiMock
Source Files ¶
Click to show internal directories.
Click to hide internal directories.