resource

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package resource implements representations of k8s API resources as "unstructured" objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory added in v1.0.9

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

Factory makes instances of Resource.

func NewFactory added in v1.0.9

func NewFactory(kf ifc.KunstructuredFactory) *Factory

NewFactory makes an instance of Factory.

func (*Factory) FromKunstructured added in v1.0.9

func (rf *Factory) FromKunstructured(
	u ifc.Kunstructured) *Resource

FromKunstructured returns a new instance of Resource.

func (*Factory) FromMap added in v1.0.9

func (rf *Factory) FromMap(m map[string]interface{}) *Resource

FromMap returns a new instance of Resource.

func (*Factory) FromMapAndOption

func (rf *Factory) FromMapAndOption(m map[string]interface{}, args *types.GeneratorArgs, option *types.GeneratorOptions) *Resource

FromMapAndOption returns a new instance of Resource with given options.

func (*Factory) MakeConfigMap added in v1.0.9

func (rf *Factory) MakeConfigMap(args *types.ConfigMapArgs, options *types.GeneratorOptions) (*Resource, error)

MakeConfigMap makes an instance of Resource for ConfigMap

func (*Factory) MakeSecret added in v1.0.9

func (rf *Factory) MakeSecret(args *types.SecretArgs, options *types.GeneratorOptions) (*Resource, error)

MakeSecret makes an instance of Resource for Secret

func (*Factory) Set added in v1.0.9

func (rf *Factory) Set(ldr ifc.Loader)

Set sets the loader for the underlying factory

func (*Factory) SliceFromBytes added in v1.0.9

func (rf *Factory) SliceFromBytes(in []byte) ([]*Resource, error)

SliceFromBytes unmarshalls bytes into a Resource slice.

func (*Factory) SliceFromPatches added in v1.0.9

func (rf *Factory) SliceFromPatches(
	ldr ifc.Loader, paths []patch.StrategicMerge) ([]*Resource, error)

SliceFromPatches returns a slice of resources given a patch path slice from a kustomization file.

type Resource

type Resource struct {
	ifc.Kunstructured
	// contains filtered or unexported fields
}

Resource is map representation of a Kubernetes API resource object paired with a GenerationBehavior.

func (*Resource) Behavior

func (r *Resource) Behavior() types.GenerationBehavior

Behavior returns the behavior for the resource.

func (*Resource) DeepCopy

func (r *Resource) DeepCopy() *Resource

DeepCopy returns a new copy of resource

func (*Resource) Id added in v1.0.2

func (r *Resource) Id() resid.ResId

Id returns the ResId for the resource.

func (*Resource) Merge added in v1.0.2

func (r *Resource) Merge(other *Resource)

Merge performs merge with other resource.

func (*Resource) NeedHashSuffix

func (r *Resource) NeedHashSuffix() bool

NeedAppendHash checks if the resource need a hash suffix

func (*Resource) Replace added in v1.0.2

func (r *Resource) Replace(other *Resource)

Replace performs replace with other resource.

func (*Resource) String added in v1.0.9

func (r *Resource) String() string

String returns resource as JSON.

Jump to

Keyboard shortcuts

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