Documentation ¶
Index ¶
- func LoadClusters(configRepoPath string, versions Versions) (map[string]Cluster, error)
- func LoadEnvironments(configRepoPath string, versions Versions, clusters map[string]Cluster) (map[string]Environment, error)
- func SortReleaseTargets(targets []Target)
- type AppRelease
- type Cluster
- type ClusterRelease
- type Environment
- type Gitops
- type MockSnapshot
- type MockVersions
- type Release
- type ReleaseFilter
- type ReleaseType
- type Target
- type TargetType
- type VersionSet
- type VersionSnapshot
- type Versions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadClusters ¶
LoadClusters scans through the cluster/ subdirectory and build a slice of defined clusters
func LoadEnvironments ¶
func LoadEnvironments(configRepoPath string, versions Versions, clusters map[string]Cluster) (map[string]Environment, error)
LoadEnvironments scans through the environments/ subdirectory and build a slice of defined environments
func SortReleaseTargets ¶
func SortReleaseTargets(targets []Target)
SortReleaseTargets sorts release targets lexicographically by type, by base, and then by name
Types ¶
type AppRelease ¶
type AppRelease interface { AppVersion() string Environment() Environment Release }
type Cluster ¶
func NewCluster ¶
func NewCluster(name string, base string, address string, releases map[string]ClusterRelease) Cluster
NewCluster constructs a new Cluster
type ClusterRelease ¶
type Environment ¶
type Environment interface { // Returns the name of the default cluster for this environment. Eg. "terra-qa" DefaultCluster() string // Returns the namespace for this environment. Eg. "terra-dev" Namespace() string Target }
func NewEnvironment ¶
func NewEnvironment(name string, base string, defaultCluster string, releases map[string]AppRelease) Environment
NewEnvironment constructs a new Environment
type Gitops ¶
type MockSnapshot ¶
func NewMockSnapshot ¶
func NewMockSnapshot() *MockSnapshot
func (*MockSnapshot) AppVersion ¶
func (s *MockSnapshot) AppVersion(releaseName string) string
func (*MockSnapshot) ChartVersion ¶
func (s *MockSnapshot) ChartVersion(releaseName string) string
func (*MockSnapshot) ReleaseDefined ¶
func (s *MockSnapshot) ReleaseDefined(releaseName string) bool
func (*MockSnapshot) UpdateChartVersionIfDefined ¶
func (s *MockSnapshot) UpdateChartVersionIfDefined(releaseName string, newVersion string) error
type MockVersions ¶
func NewMockVersions ¶
func NewMockVersions() *MockVersions
func (*MockVersions) GetSnapshot ¶
func (v *MockVersions) GetSnapshot(releaseType ReleaseType, versionSet VersionSet) VersionSnapshot
type Release ¶
type Release interface { Name() string Type() ReleaseType IsAppRelease() bool IsClusterRelease() bool ChartVersion() string ChartName() string Repo() string Namespace() string ClusterName() string ClusterAddress() string Target() Target // Returns 0 if r == other, -1 if r < other, or +1 if r > other. Compare(Release) int }
type ReleaseFilter ¶
type ReleaseFilter interface { Matches(Release) bool And(ReleaseFilter) ReleaseFilter Or(ReleaseFilter) ReleaseFilter }
func AnyRelease ¶
func AnyRelease() ReleaseFilter
func HasName ¶
func HasName(releaseName string) ReleaseFilter
func HasTarget ¶
func HasTarget(targetName string) ReleaseFilter
type ReleaseType ¶
type ReleaseType int
ReleaseType is an enum type referring to the two types of releases supported by terra-helmfile.
const ( AppReleaseType ReleaseType = iota ClusterReleaseType )
func ReleaseTypes ¶
func ReleaseTypes() []ReleaseType
func (ReleaseType) Compare ¶
func (r ReleaseType) Compare(other ReleaseType) int
Returns 0 if r == other, -1 if r < other, or +1 if r > other.
func (ReleaseType) String ¶
func (r ReleaseType) String() string
func (*ReleaseType) UnmarshalYAML ¶
func (r *ReleaseType) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML is a custom unmarshaler so that the string "app" or "cluster" in a yaml file can be unmarshaled into a ReleaseType
type Target ¶
type Target interface { ConfigDir() string // ConfigDir returns the subdirectory in the terra-helmfile config repo where environments or clusters are defined Type() TargetType // Type is the name of the target type, either "environment" or "cluster", as referenced in the helmfile repo Base() string // Base is the base of the environment or cluster Name() string // Name is the name of the environment or cluster ReleaseType() ReleaseType // ReleaseType returns the types of releases that can be deployed to this target Releases() []Release // Releases returns the set of releases configured for this target IsCluster() bool // Returns true if this target is a cluster IsEnvironment() bool // Returns true if this target is an environment Compare(other Target) int // Returns 0 if t == other, -1 if t < other, or +1 if t > other. }
Target represents where a release is being deployed (environment or cluster)
type TargetType ¶
type TargetType int
TargetType is an enum type referring to the two types of targets supported by terra-helmfile.
const ( EnvironmentTargetType TargetType = iota ClusterTargetType )
func (TargetType) Compare ¶
func (t TargetType) Compare(other TargetType) int
Returns 0 if t == other, -1 if t < other, or +1 if t > other.
func (TargetType) String ¶
func (t TargetType) String() string
func (*TargetType) UnmarshalYAML ¶
func (t *TargetType) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML is a custom unmarshaler so that the string "environment" or "cluster" in a yaml file can be unmarshaled into a TargetType
type VersionSet ¶
type VersionSet int
VersionSet is an enum type representing a version set defined in terra-helmfile
const ( Dev VersionSet = iota Alpha Staging Prod )
func VersionSets ¶
func VersionSets() []VersionSet
func (VersionSet) String ¶
func (s VersionSet) String() string
type VersionSnapshot ¶
type VersionSnapshot interface { // ReleaseDefined returns true if the given release is defined in this snapshot ReleaseDefined(releaseName string) bool // ChartVersion returns the chartVersion for the given release in this snapshot. If the release is not defined, returns "" ChartVersion(releaseName string) string // AppVersion returns the chartVersion for the given release in this snapshot. If the release is not defined, returns "" AppVersion(releaseName string) string // UpdateChartVersionIfDefined sets the chartVersion for the given release to the given version. // If the release is not defined, or if newVersion <= the current chart version, this function does nothing. UpdateChartVersionIfDefined(releaseName string, newVersion string) error }
type Versions ¶
type Versions interface { // GetSnapshot returns a VersionSnapshot reference for the given release type & version set GetSnapshot(releaseType ReleaseType, versionSet VersionSet) VersionSnapshot }
Versions is for manipulating chart release versions in terra-helmfile (eg. versions/app/dev.yaml, versions/cluster/dev.yaml)