openshift

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KindMapping = map[string]string{
		"svc":                   "Service",
		"service":               "Service",
		"route":                 "Route",
		"dc":                    "DeploymentConfig",
		"deploymentconfig":      "DeploymentConfig",
		"bc":                    "BuildConfig",
		"buildconfig":           "BuildConfig",
		"is":                    "ImageStream",
		"imagestream":           "ImageStream",
		"pvc":                   "PersistentVolumeClaim",
		"persistentvolumeclaim": "PersistentVolumeClaim",
		"template":              "Template",
		"cm":                    "ConfigMap",
		"configmap":             "ConfigMap",
		"secret":                "Secret",
		"rolebinding":           "RoleBinding",
		"serviceaccount":        "ServiceAccount",
	}
)

Functions

func DecryptedParams added in v0.9.4

func DecryptedParams(input, privateKey, passphrase string) (string, error)

DecryptedParams is used to edit/reveal secrets

func EncodedParams added in v0.9.4

func EncodedParams(input, privateKey, passphrase string) (string, error)

EncodedParams is used to pass params to oc

func EncryptedParams added in v0.9.4

func EncryptedParams(input, previous, publicKeyDir, privateKey, passphrase string) (string, error)

EncryptedParams is used to save cleartext params to file

func ExportAsTemplateFile added in v0.9.4

func ExportAsTemplateFile(filter *ResourceFilter, exportOptions *cli.ExportOptions) (string, error)

func ExportResources

func ExportResources(filter *ResourceFilter, namespace string) ([]byte, error)

func ProcessTemplate

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

Types

type Change

type Change struct {
	Action       string
	Kind         string
	Name         string
	Patches      []*jsonPatch
	CurrentState string
	DesiredState string
}

func (*Change) Diff added in v0.9.0

func (c *Change) Diff() string

func (*Change) ItemName

func (c *Change) ItemName() string

func (*Change) JsonPatches added in v0.9.0

func (c *Change) JsonPatches(pretty bool) string

type Changeset

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

func NewChangeset

func NewChangeset(platformBasedList, templateBasedList *ResourceList, upsertOnly bool, ignoredPaths []string) (*Changeset, error)

func (*Changeset) Add added in v0.9.0

func (c *Changeset) Add(changes ...*Change)

func (*Changeset) Blank

func (c *Changeset) Blank() bool

type ResourceFilter

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

func NewResourceFilter added in v0.9.4

func NewResourceFilter(kindArg string, selectorFlag string) (*ResourceFilter, error)

NewResourceFilter returns a filter based on kinds and flags. kindArg might be blank, or a list of kinds (e.g. 'pvc,dc') or a kind/name combination (e.g. 'dc/foo'). selectorFlag might be blank or a key and a label, e.g. 'name=foo'.

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 {
	Source                   string
	Kind                     string
	Name                     string
	Labels                   map[string]interface{}
	Annotations              map[string]interface{}
	Paths                    []string
	Config                   map[string]interface{}
	TailorManagedAnnotations []string
}

func NewResourceItem added in v0.9.0

func NewResourceItem(m map[string]interface{}, source string) (*ResourceItem, error)

func (*ResourceItem) ChangesFrom added in v0.9.0

func (templateItem *ResourceItem) ChangesFrom(platformItem *ResourceItem, externallyModifiedPaths []string) ([]*Change, error)

func (*ResourceItem) FullName

func (i *ResourceItem) FullName() string

func (*ResourceItem) RemoveUnmanagedAnnotations added in v0.9.0

func (i *ResourceItem) RemoveUnmanagedAnnotations()

func (*ResourceItem) YamlConfig

func (i *ResourceItem) YamlConfig() string

type ResourceList

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

func NewPlatformBasedResourceList added in v0.9.4

func NewPlatformBasedResourceList(filter *ResourceFilter, inputs ...[]byte) (*ResourceList, error)

func NewTemplateBasedResourceList added in v0.9.4

func NewTemplateBasedResourceList(filter *ResourceFilter, inputs ...[]byte) (*ResourceList, error)

func (*ResourceList) Length added in v0.7.0

func (l *ResourceList) Length() int

Length returns the number of items in the resource list

Jump to

Keyboard shortcuts

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