openshift

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportAsTemplate

func ExportAsTemplate(filter *ResourceFilter, name string, exportOptions *cli.ExportOptions) ([]byte, error)

func ExportResources

func ExportResources(filter *ResourceFilter, compareOptions *cli.CompareOptions) ([]byte, error)

func ProcessTemplate

func ProcessTemplate(templateDir string, name string, paramDir string, compareOptions *cli.CompareOptions) ([]byte, error)

func UpdateRemote

func UpdateRemote(changeset *Changeset, compareOptions *cli.CompareOptions) error

Types

type Change

type Change struct {
	Kind         string
	Name         string
	CurrentState string
	DesiredState string
}

func (*Change) ItemName

func (c *Change) ItemName() string

type Changeset

type Changeset struct {
	Create []*Change
	Update []*Change
	Delete []*Change
	Noop   []*Change
}

func NewChangeset

func NewChangeset(remoteResourceList, localResourceList *ResourceList, upsertOnly bool) *Changeset

func (*Changeset) Blank

func (c *Changeset) Blank() bool

type Config

type Config struct {
	Raw              []byte
	Processed        map[string]interface{}
	NameRegex        string
	PointersToInit   []string
	PointersToDelete []string
	PointersToReset  map[string]string
	ItemPointers     []string
	Items            []*ResourceItem
}

func NewConfigFromList

func NewConfigFromList(input []byte) *Config

func NewConfigFromTemplate

func NewConfigFromTemplate(input []byte) *Config

func (*Config) ExtractResources

func (c *Config) ExtractResources(filter *ResourceFilter) []*ResourceItem

func (*Config) Process

func (c *Config) Process(setOriginalValues bool)

type Param

type Param struct {
	Key       string
	Value     string
	IsSecret  bool
	Decrypted string
}

func (*Param) Process

func (p *Param) Process(dropSuffix bool, decode bool) (string, error)

Returns a string representation in which all .ENC params are decrypted.

func (*Param) Render

func (p *Param) Render(entityList openpgp.EntityList, previousParams Params) (string, error)

Returns a string representation of the param. .ENC params are encrypted.

type Params

type Params []*Param

func NewParams

func NewParams(content, privateKey, passphrase string) (Params, error)

func NewParamsFromFile

func NewParamsFromFile(filename, privateKey, passphrase string) (Params, error)

func NewParamsFromInput

func NewParamsFromInput(content string) (Params, error)

func (Params) Process

func (p Params) Process(dropSuffix bool, decode bool) (string, error)

func (Params) Render

func (p Params) Render(publicKeyDir string, previousParams Params) (string, error)

Encrypt params and create string from them

func (Params) String

func (p Params) String() string

type ResourceFilter

type ResourceFilter struct {
	Kinds []string
	Name  string
	Label string
}

func (*ResourceFilter) ConvertToKinds added in v0.6.0

func (f *ResourceFilter) ConvertToKinds() string

func (*ResourceFilter) ConvertToTarget

func (f *ResourceFilter) ConvertToTarget() string

func (*ResourceFilter) SatisfiedBy

func (f *ResourceFilter) SatisfiedBy(item *ResourceItem) bool

func (*ResourceFilter) String

func (f *ResourceFilter) String() string

type ResourceItem

type ResourceItem struct {
	Kind    string
	Name    string
	Labels  map[string]interface{}
	Pointer string
	Config  interface{}
}

func (*ResourceItem) FullName

func (i *ResourceItem) FullName() string

func (*ResourceItem) YamlConfig

func (i *ResourceItem) YamlConfig() string

type ResourceList

type ResourceList struct {
	Filter *ResourceFilter
	Items  []*ResourceItem
}

func NewResourceList

func NewResourceList(filter *ResourceFilter, config *Config) *ResourceList

func (*ResourceList) AppendItems

func (l *ResourceList) AppendItems(config *Config)

func (*ResourceList) GetItem

func (l *ResourceList) GetItem(kind string, name string) (*ResourceItem, error)

func (*ResourceList) Length added in v0.7.0

func (l *ResourceList) Length() int

Jump to

Keyboard shortcuts

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