phase

package
v0.0.0-...-b8e83fa Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// TableOutputFormat table
	TableOutputFormat = "table"
	// YamlOutputFormat yaml
	YamlOutputFormat = "yaml"
)
View Source
const (
	// RenderSourceConfig will render a bundle that comes from site metadata file
	// and contains phase and executor docs
	RenderSourceConfig = "config"

	// RenderSourceExecutor indicates that rendering will be delegated to phase executor
	RenderSourceExecutor = "executor"

	// RenderSourcePhase the source will use kustomize root at phase entry point
	RenderSourcePhase = "phase"
)

Variables

This section is empty.

Functions

func DefaultExecutorRegistry

func DefaultExecutorRegistry() map[schema.GroupVersionKind]ifc.ExecutorFactory

DefaultExecutorRegistry returns map with executor factories

func NewClient

func NewClient(helper ifc.Helper, opts ...Option) ifc.Client

NewClient returns implementation of phase Client interface

func NewHelper

func NewHelper(cfg *config.Config) (ifc.Helper, error)

NewHelper constructs metadata interface based on config

Types

type ClusterListCommand

type ClusterListCommand struct {
	Factory config.Factory
	Writer  io.Writer
	Format  string
}

ClusterListCommand options for cluster list command

func (*ClusterListCommand) RunE

func (c *ClusterListCommand) RunE() error

RunE executes cluster list command

type ExecutorRegistry

type ExecutorRegistry func() map[schema.GroupVersionKind]ifc.ExecutorFactory

ExecutorRegistry returns map with executor factories

type GenericRunFlags

type GenericRunFlags struct {
	DryRun  bool
	Timeout time.Duration
}

GenericRunFlags generic options for run command

type Helper

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

Helper provides functions built around phase bundle to filter and build documents

func (*Helper) ClusterMap

func (helper *Helper) ClusterMap() (clustermap.ClusterMap, error)

ClusterMap associated with the the manifest

func (*Helper) ClusterMapAPIobj

func (helper *Helper) ClusterMapAPIobj() (*v1alpha1.ClusterMap, error)

ClusterMapAPIobj associated with the the manifest

func (*Helper) DocEntryPointPrefix

func (helper *Helper) DocEntryPointPrefix() string

DocEntryPointPrefix returns the prefix which if not empty is prepended to the DocumentEntryPoint field in the phase struct so the full entry point is DocEntryPointPrefix + DocumentEntryPoint

func (*Helper) ExecutorDoc

func (helper *Helper) ExecutorDoc(phaseID ifc.ID) (document.Document, error)

ExecutorDoc returns executor document associated with phase

func (*Helper) Inventory

func (helper *Helper) Inventory() inventoryifc.Inventory

Inventory return inventory interface

func (*Helper) ListPhases

func (helper *Helper) ListPhases(o ifc.ListPhaseOptions) ([]*v1alpha1.Phase, error)

ListPhases returns all phases associated with manifest

func (*Helper) ListPlans

func (helper *Helper) ListPlans() ([]*v1alpha1.PhasePlan, error)

ListPlans returns all phases associated with manifest

func (*Helper) Phase

func (helper *Helper) Phase(phaseID ifc.ID) (*v1alpha1.Phase, error)

Phase returns a phase APIObject based on phase selector

func (*Helper) PhaseBundleRoot

func (helper *Helper) PhaseBundleRoot() string

PhaseBundleRoot returns path to document root with phase documents

func (*Helper) PhaseConfigBundle

func (helper *Helper) PhaseConfigBundle() document.Bundle

PhaseConfigBundle returns bundle based on phaseBundleRoot

func (*Helper) PhaseEntryPointBasePath

func (helper *Helper) PhaseEntryPointBasePath() string

PhaseEntryPointBasePath returns path to current site directory

func (*Helper) PhaseRepoDir

func (helper *Helper) PhaseRepoDir() string

PhaseRepoDir returns the last part of the repo url E.g. http://dummy.org/reponame.git -> reponame

func (*Helper) Plan

func (helper *Helper) Plan(planID ifc.ID) (*v1alpha1.PhasePlan, error)

Plan returns plan associated with a manifest

func (*Helper) TargetPath

func (helper *Helper) TargetPath() string

TargetPath returns manifest root

func (*Helper) WorkDir

func (helper *Helper) WorkDir() string

WorkDir return working directory for airshipctl

type ListCommand

type ListCommand struct {
	Factory      config.Factory
	Writer       io.Writer
	ClusterName  string
	PlanID       ifc.ID
	OutputFormat string
}

ListCommand phase list command

func (*ListCommand) RunE

func (c *ListCommand) RunE() error

RunE runs a phase list command

type Option

type Option func(*client)

Option allows to add various options to a phase

func InjectRegistry

func InjectRegistry(registry ExecutorRegistry) Option

InjectRegistry is an option that allows to inject executor registry into phase client

type PlanListCommand

type PlanListCommand struct {
	Options PlanListFlags
	Factory config.Factory
	Writer  io.Writer
}

PlanListCommand phase list command

func (*PlanListCommand) RunE

func (c *PlanListCommand) RunE() error

RunE runs a plan list command

type PlanListFlags

type PlanListFlags struct {
	FormatType string
}

PlanListFlags flags given for plan list command

type PlanRunCommand

type PlanRunCommand struct {
	PlanID  ifc.ID
	Options ifc.PlanRunOptions
	Factory config.Factory
}

PlanRunCommand phase run command

func (*PlanRunCommand) RunE

func (c *PlanRunCommand) RunE() error

RunE executes phase plan

type PlanRunFlags

type PlanRunFlags struct {
	GenericRunFlags
	ResumeFromPhase string
}

PlanRunFlags options for phase run command

type PlanValidateCommand

type PlanValidateCommand struct {
	Options PlanValidateFlags
	Factory config.Factory
}

PlanValidateCommand plan validate command

func (*PlanValidateCommand) RunE

func (c *PlanValidateCommand) RunE() error

RunE runs the plan validate command

type PlanValidateFlags

type PlanValidateFlags struct {
	PlanID ifc.ID
}

PlanValidateFlags options for plan validate command

type RenderCommand

type RenderCommand struct {
	// Label filters documents by label string
	Label string
	// Annotation filters documents by annotation string
	Annotation string
	// APIVersion filters documents by API group and version
	APIVersion string
	// Kind filters documents by document kind
	Kind string
	// Source identifies source of the bundle, these can be [phase|config|executor]
	// phase the source will use kustomize root at phase entry point
	// config will render a bundle that comes from site metadata file, and contains phase and executor docs
	// executor means that rendering will be delegated to phase executor
	Source string
	// FailOnDecryptionError makes sure that encrypted documents are getting decrypted by avoiding setting
	// env variable TOLERATE_DECRYPTION_FAILURES=true
	FailOnDecryptionError bool
	PhaseID               ifc.ID
}

RenderCommand holds filters for selector

func (*RenderCommand) RunE

func (fo *RenderCommand) RunE(cfgFactory config.Factory, out io.Writer) error

RunE prints out filtered documents

func (*RenderCommand) Validate

func (fo *RenderCommand) Validate() (err error)

Validate checks if command options are valid

type RunCommand

type RunCommand struct {
	PhaseID ifc.ID
	Options ifc.RunOptions
	Factory config.Factory
}

RunCommand phase run command

func (*RunCommand) RunE

func (c *RunCommand) RunE() error

RunE runs the phase

type RunFlags

type RunFlags struct {
	GenericRunFlags
}

RunFlags options for phase run command

type StatusCommand

type StatusCommand struct {
	Options StatusFlags
	Factory config.Factory
}

StatusCommand is a struct which defines status

func (*StatusCommand) RunE

func (s *StatusCommand) RunE() error

RunE returns the status of the given phase

type StatusFlags

type StatusFlags struct {
	Timeout  time.Duration
	PhaseID  ifc.ID
	Progress bool
}

StatusFlags is a struct to define status type

type TreeCommand

type TreeCommand struct {
	Factory  config.Factory
	PhaseID  ifc.ID
	Writer   io.Writer
	Argument string
}

TreeCommand plan command

func (*TreeCommand) RunE

func (c *TreeCommand) RunE() error

RunE runs the phase tree command

type ValidateCommand

type ValidateCommand struct {
	Options ValidateFlags
	Factory config.Factory
}

ValidateCommand phase validate command

func (*ValidateCommand) RunE

func (c *ValidateCommand) RunE() error

RunE runs the phase validate command

type ValidateFlags

type ValidateFlags struct {
	PhaseID ifc.ID
}

ValidateFlags options for phase validate command

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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