stack

package
v0.0.0-...-5a1439f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

* Copyright 2019 The Sugarkube Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildStack

func BuildStack(stackName string, stackFilePath string, cliStackConfig *structs.StackFile) (interfaces.IStack, error)

Loads a stack config from a file. Values are merged with CLI args (which take precedence), and provider variables are loaded and set as a property on the stackConfig. So after this step, stackConfig contains all config values for the entire stack (although it won't have been templated yet so any '{{var_name}}' type strings won't have been interpolated yet.

func MatchesSelector

func MatchesSelector(installable interfaces.IInstallable, selector string) (bool, error)

Returns a boolean indicating whether the installable matches the given selector

func ParseManifestFile

func ParseManifestFile(manifestFilePath string, manifestDescriptor structs.ManifestDescriptor) (interfaces.IManifest, error)

Load a single manifest file and parse the kapps it defines

func SelectInstallables

func SelectInstallables(manifests []interfaces.IManifest, includeSelector []string,
	excludeSelector []string) ([]interfaces.IInstallable, error)

Return installables selected by inclusion/exclusion selectors from the given manifests. Installables will be returned in the order they appear in the manifests regardless of the orders of the selectors.

func ValidateManifest

func ValidateManifest(manifest interfaces.IManifest) error

Validates that there aren't multiple kapps with the same ID in the manifest, or it'll break creating a workspace

Types

type ClusterStatus

type ClusterStatus struct {
	// contains filtered or unexported fields
}

Hold information about the status of the cluster

func (*ClusterStatus) IsOnline

func (c *ClusterStatus) IsOnline() bool

func (*ClusterStatus) IsReady

func (c *ClusterStatus) IsReady() bool

func (*ClusterStatus) SetIsOnline

func (c *ClusterStatus) SetIsOnline(status bool)

func (*ClusterStatus) SetIsReady

func (c *ClusterStatus) SetIsReady(status bool)

func (*ClusterStatus) SetSleepBeforeReadyCheck

func (c *ClusterStatus) SetSleepBeforeReadyCheck(time uint32)

func (*ClusterStatus) SetStartedThisRun

func (c *ClusterStatus) SetStartedThisRun(status bool)

func (*ClusterStatus) SleepBeforeReadyCheck

func (c *ClusterStatus) SleepBeforeReadyCheck() uint32

func (*ClusterStatus) StartedThisRun

func (c *ClusterStatus) StartedThisRun() bool

type Manifest

type Manifest struct {
	// contains filtered or unexported fields
}

func (*Manifest) Id

func (m *Manifest) Id() string

Sets fields to default values

func (*Manifest) Installables

func (m *Manifest) Installables() []interfaces.IInstallable

func (Manifest) IsSequential

func (m Manifest) IsSequential() bool

Return whether the manifest is sequential, i.e. whether each kapp in the manifest depends on the previous one

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

Top-level struct that holds references to instantiations of other objects we need to pass around. This is in its own package to avoid circular dependencies.

func (Stack) GetConfig

func (s Stack) GetConfig() interfaces.IStackConfig

func (Stack) GetProvider

func (s Stack) GetProvider() interfaces.IProvider

func (Stack) GetProvisioner

func (s Stack) GetProvisioner() interfaces.IProvisioner

func (Stack) GetRegistry

func (s Stack) GetRegistry() interfaces.IRegistry

func (Stack) GetStatus

func (s Stack) GetStatus() interfaces.IClusterStatus

func (*Stack) GetTemplatedVars

func (s *Stack) GetTemplatedVars(installableObj interfaces.IInstallable,
	extraVars map[string]interface{}) (map[string]interface{}, error)

Merges and templates vars from all configured sources. If an installable instance is given, data specific to it will be included in the returned map, otherwise only stack-specific variables will be returned.

func (*Stack) LoadInstallables

func (s *Stack) LoadInstallables(workspaceDir string) error

Loads the configs for all installables

func (*Stack) RefreshProviderVars

func (s *Stack) RefreshProviderVars() error

Reload provider vars

type StackConfig

type StackConfig struct {
	// contains filtered or unexported fields
}

The populated config for a stack - all object addresses from the raw stack config have been replaced with actual instances

func (StackConfig) GetAccount

func (s StackConfig) GetAccount() string

func (StackConfig) GetCluster

func (s StackConfig) GetCluster() string

func (*StackConfig) GetDir

func (s *StackConfig) GetDir() string

Returns the directory the stack config was loaded from, or the current working directory. This can be used to build relative paths.

func (*StackConfig) GetIntrinsicData

func (s *StackConfig) GetIntrinsicData() map[string]string

Returns certain stack data that should be exposed as variables when running kapps

func (StackConfig) GetName

func (s StackConfig) GetName() string

func (StackConfig) GetOnlineTimeout

func (s StackConfig) GetOnlineTimeout() uint32

func (StackConfig) GetProfile

func (s StackConfig) GetProfile() string

func (StackConfig) GetProvider

func (s StackConfig) GetProvider() string

func (StackConfig) GetProviderVars

func (s StackConfig) GetProviderVars() map[string]interface{}

Gets provider vars

func (StackConfig) GetProviderVarsDirs

func (s StackConfig) GetProviderVarsDirs() []string

Returns the configured list of provider vars dirs

func (StackConfig) GetProvisioner

func (s StackConfig) GetProvisioner() string

func (StackConfig) GetRegion

func (s StackConfig) GetRegion() string

func (StackConfig) KappVarsDirs

func (s StackConfig) KappVarsDirs() []string

Returns the configured list of provider vars dirs

func (StackConfig) Manifests

func (s StackConfig) Manifests() []interfaces.IManifest

Returns the populated manifests

func (*StackConfig) SetOnlineTimeout

func (s *StackConfig) SetOnlineTimeout(timeout uint32)

Sets the online timeout

func (*StackConfig) SetProviderVars

func (s *StackConfig) SetProviderVars(vars map[string]interface{})

Sets provider vars

func (*StackConfig) SetReadyTimeout

func (s *StackConfig) SetReadyTimeout(timeout uint32)

Sets the ready timeout

func (StackConfig) TemplateDirs

func (s StackConfig) TemplateDirs() []string

Returns the configured list of template dirs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL