project

package
v1.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logs

func Logs(namespace, context, kubeConfig, name, containerName string, timeout int) error

Logs .

func Status added in v1.0.2

func Status(namespace, context, kubeConfig, kind, name string) (kubernetes.RsStatus, error)

func Wait

func Wait(namespace, context, kubeConfig, kind, name string, timeout int) error

Wait for pod or job to complete

Types

type Config

type Config struct {
	RootDir         string                 `yaml:"root_dir"`
	Namespace       string                 `yaml:"namespace"`
	Variables       map[string]string      `yaml:"variables"`
	ResourceGroups  []*ResourceGroupConfig `yaml:"resource_groups"`
	DeleteNamespace bool                   `yaml:"delete_namespace"`
}

Config holds configuration data parsed from yaml file

func ReadProjectConfig

func ReadProjectConfig(projectFile string, variables map[string]string) (*Config, error)

ReadProjectConfig .

func (*Config) Write

func (c *Config) Write(w io.Writer) error

type ErrCyclicDependency

type ErrCyclicDependency struct {
	Node string
}

ErrCyclicDependency .

func (ErrCyclicDependency) Error

func (err ErrCyclicDependency) Error() string

type ErrMissingDependency

type ErrMissingDependency struct {
	Child  string
	Parent string
}

ErrMissingDependency .

func (ErrMissingDependency) Error

func (err ErrMissingDependency) Error() string

type ErrWaitFailed

type ErrWaitFailed struct {
	Name string
	Kind string
}

ErrWaitFailed .

func (ErrWaitFailed) Error

func (err ErrWaitFailed) Error() string

type ErrWaitTimeout

type ErrWaitTimeout struct {
	Name string
	Kind string
}

ErrWaitTimeout .

func (ErrWaitTimeout) Error

func (err ErrWaitTimeout) Error() string

type FilterFunc added in v1.1.3

type FilterFunc func(*ResourceGroup) bool

FilterFunc criteria if a resource group should be process by Walk function

type Formatter added in v1.1.1

type Formatter interface {
	Format(p *Project)
}

type Project

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

Project holds configuration for a rivendell task

func ReadProject

func ReadProject(projectFile, namespace, context, kubeConfig string, variables map[string]string, variableFiles []string, includeResources []string, excludeResources []string) (*Project, error)

ReadProject reads a project from file

func (*Project) Debug

func (p *Project) Debug(f Formatter)

Debug .

func (*Project) Down

func (p *Project) Down(deleteNS, deletePVC bool) error

Down .

func (*Project) GetServicePods added in v1.0.8

func (p *Project) GetServicePods() ([]string, error)

GetServicePods

func (*Project) PrintCommonInfo

func (p *Project) PrintCommonInfo()

PrintCommonInfo .

func (*Project) PrintConfig added in v1.1.6

func (p *Project) PrintConfig()

func (*Project) PrintDownPlan

func (p *Project) PrintDownPlan()

PrintDownPlan .

func (*Project) PrintRestartPlan added in v1.0.8

func (p *Project) PrintRestartPlan(pods []string)

PrintRestartPlan .

func (*Project) PrintUpPlan

func (p *Project) PrintUpPlan()

PrintUpPlan .

func (*Project) PrintUpdatePlan

func (p *Project) PrintUpdatePlan()

PrintUpdatePlan .

func (*Project) Restart added in v1.0.8

func (p *Project) Restart(pods []string) error

Restart .

func (*Project) SetFilter added in v1.1.3

func (p *Project) SetFilter(fn func(*ResourceGroup) bool) *Project

func (*Project) Up

func (p *Project) Up() error

Up .

func (*Project) Update

func (p *Project) Update() error

Update .

func (*Project) Upgrade

func (p *Project) Upgrade() error

Upgrade .

func (*Project) WalkForward added in v1.1.1

func (p *Project) WalkForward(fn func(g *ResourceGroup) error) error

type Resource

type Resource struct {
	Filepath   string
	Name       string
	Kind       string
	RawContent string
}

Resource holds configuration for a single resource

type ResourceFile

type ResourceFile struct {
	Source          string
	ContextDir      string
	Resources       []*Resource
	RawContent      string
	ExpandedContent string
}

ResourceFile holds configuration for a single resource file. There are maybe multiple resources in a resource file

type ResourceFileProcessor added in v1.1.8

type ResourceFileProcessor interface {
	Process(f *ResourceFile) error
}

type ResourceFileProcessorFunc added in v1.1.8

type ResourceFileProcessorFunc func(*ResourceFile) error

func (ResourceFileProcessorFunc) Process added in v1.1.8

type ResourceGraph

type ResourceGraph struct {
	ResourceGroups map[string]*ResourceGroup
	RootNodes      []string
	LeafNodes      []string
}

ResourceGraph .

func ReadResourceGraph

func ReadResourceGraph(rootDir string, resourceGroupConfigs []*ResourceGroupConfig, variables map[string]string, includeResources []string, excludeResources []string) (*ResourceGraph, error)

ReadResourceGraph .

func (*ResourceGraph) WalkBackward

func (rg *ResourceGraph) WalkBackward(f func(g *ResourceGroup) error) error

WalkBackward through the graph, BFS style

func (*ResourceGraph) WalkBackwardWithWait

func (rg *ResourceGraph) WalkBackwardWithWait(f func(g *ResourceGroup) error, readyFunc func(r *Resource, g *ResourceGroup) error) error

WalkBackwardWithWait from leaf nodes

func (*ResourceGraph) WalkForward

func (rg *ResourceGraph) WalkForward(f func(g *ResourceGroup) error) error

WalkForward through the graph, BFS style

func (*ResourceGraph) WalkForwardWithWait

func (rg *ResourceGraph) WalkForwardWithWait(f func(g *ResourceGroup) error, readyFunc func(r *Resource, g *ResourceGroup) error, waitFunc func(name, kind string) error) error

WalkForwardWithWait from root nodes

func (*ResourceGraph) WalkResourceBackward

func (rg *ResourceGraph) WalkResourceBackward(f func(r *Resource, g *ResourceGroup) error, readyFunc func(r *Resource, g *ResourceGroup) error) error

WalkResourceBackward with waiting

func (*ResourceGraph) WalkResourceForward

func (rg *ResourceGraph) WalkResourceForward(f func(r *Resource, g *ResourceGroup) error, readyFunc func(r *Resource, g *ResourceGroup) error, waitFunc func(name, kind string) error) error

WalkResourceForward with waiting

type ResourceGroup

type ResourceGroup struct {
	Name          string
	Templater     string
	ResourceFiles []*ResourceFile
	Depend        []string
	Wait          []*WaitConfig
	Children      []string
}

ResourceGroup holds configuration for a resource group

type ResourceGroupConfig

type ResourceGroupConfig struct {
	Name      string        `yaml:"name"`
	Resources []string      `yaml:"resources"`
	Excludes  []string      `yaml:"excludes"`
	Depend    []string      `yaml:"depend"`
	Wait      []*WaitConfig `yaml:"wait"`
}

ResourceGroupConfig holds configuration for resource group

type WaitConfig

type WaitConfig struct {
	Name    string `yaml:"name"`
	Kind    string `yaml:"kind"`
	Timeout int    `yaml:"timeout"`
}

WaitConfig .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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