Documentation ¶
Index ¶
- Variables
- func DecryptedParams(input, privateKey, passphrase string) (string, error)
- func EncodedParams(input, privateKey, passphrase string) (string, error)
- func EncryptedParams(input, previous, publicKeyDir, privateKey, passphrase string) (string, error)
- func ExportAsTemplateFile(filter *ResourceFilter, withAnnotations bool, namespace string, ...) (string, error)
- func ProcessTemplate(templateDir string, name string, paramDir string, ...) ([]byte, error)
- type Change
- type Changeset
- type ResourceFilter
- type ResourceItem
- type ResourceList
Constants ¶
This section is empty.
Variables ¶
var (
KindMapping = map[string]string{
"svc": "Service",
"service": "Service",
"route": "Route",
"dc": "DeploymentConfig",
"deploymentconfig": "DeploymentConfig",
"deployment": "Deployment",
"bc": "BuildConfig",
"buildconfig": "BuildConfig",
"is": "ImageStream",
"imagestream": "ImageStream",
"pvc": "PersistentVolumeClaim",
"persistentvolumeclaim": "PersistentVolumeClaim",
"template": "Template",
"cm": "ConfigMap",
"configmap": "ConfigMap",
"secret": "Secret",
"rolebinding": "RoleBinding",
"serviceaccount": "ServiceAccount",
"cronjob": "CronJob",
"cj": "CronJob",
"limitrange": "LimitRange",
"resourcequota": "ResourceQuota",
"quota": "ResourceQuota",
}
)
Functions ¶
func DecryptedParams ¶
DecryptedParams is used to edit/reveal secrets
func EncodedParams ¶
EncodedParams is used to pass params to oc
func EncryptedParams ¶
EncryptedParams is used to save cleartext params to file
func ExportAsTemplateFile ¶
func ExportAsTemplateFile(filter *ResourceFilter, withAnnotations bool, namespace string, withHardcodedNamespace bool, ocClient cli.OcClientExporter) (string, error)
ExportAsTemplateFile exports resources in template format.
func ProcessTemplate ¶
func ProcessTemplate(templateDir string, name string, paramDir string, compareOptions *cli.CompareOptions, ocClient cli.OcClientProcessor) ([]byte, error)
ProcessTemplate processes template "name" in "templateDir".
Types ¶
type Change ¶
type Change struct { Action string Kind string Name string CurrentState string DesiredState string }
Change is a description of a drift between current and desired state, and the required patches to bring them back in sync.
func NewChange ¶
func NewChange(templateItem *ResourceItem, platformItem *ResourceItem) *Change
NewChange creates a new change for given template/platform item.
type Changeset ¶
func NewChangeset ¶
func (*Changeset) ExactlyOne ¶ added in v1.1.0
ExactlyOne is true when there is just a single change across Create, Update, Delete.
type ResourceFilter ¶
type ResourceFilter struct { Kinds []string Name string Label string ExcludedKinds []string ExcludedNames []string ExcludedLabels []string }
func NewResourceFilter ¶
func NewResourceFilter(kindArg string, selectorFlag string, excludeFlag 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 ¶
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{} AnnotationsPresent bool LastAppliedConfiguration map[string]interface{} LastAppliedAnnotations map[string]interface{} Comparable bool }
func NewResourceItem ¶
func NewResourceItem(m map[string]interface{}, source string) (*ResourceItem, error)
func (*ResourceItem) DesiredConfig ¶ added in v0.10.3
func (i *ResourceItem) DesiredConfig() (string, error)
func (*ResourceItem) FullName ¶
func (i *ResourceItem) FullName() string
func (*ResourceItem) HasLabel ¶
func (i *ResourceItem) HasLabel(label string) bool
func (*ResourceItem) YamlConfig ¶
func (i *ResourceItem) YamlConfig() string
type ResourceList ¶
type ResourceList struct { Filter *ResourceFilter Items []*ResourceItem }
ResourceList is a collection of resources that conform to a filter.
func NewPlatformBasedResourceList ¶
func NewPlatformBasedResourceList(filter *ResourceFilter, inputs ...[]byte) (*ResourceList, error)
NewPlatformBasedResourceList assembles a ResourceList from an input that is treated as coming from an OpenShift cluster (current state).
func NewTemplateBasedResourceList ¶
func NewTemplateBasedResourceList(filter *ResourceFilter, inputs ...[]byte) (*ResourceList, error)
NewTemplateBasedResourceList assembles a ResourceList from an input that is treated as coming from a local template (desired state).
func (*ResourceList) Length ¶
func (l *ResourceList) Length() int
Length returns the number of items in the resource list