package resource
import "sigs.k8s.io/kustomize/pkg/resource"
Package resource implements representations of k8s API resources as "unstructured" objects.
Index ¶
- type Factory
- func NewFactory(kf ifc.KunstructuredFactory) *Factory
- func (rf *Factory) FromKunstructured( u ifc.Kunstructured) *Resource
- func (rf *Factory) FromMap(m map[string]interface{}) *Resource
- func (rf *Factory) MakeConfigMap(args *types.ConfigMapArgs, options *types.GeneratorOptions) (*Resource, error)
- func (rf *Factory) MakeSecret(args *types.SecretArgs, options *types.GeneratorOptions) (*Resource, error)
- func (rf *Factory) Set(fs fs.FileSystem, ldr ifc.Loader)
- func (rf *Factory) SliceFromBytes(in []byte) ([]*Resource, error)
- func (rf *Factory) SliceFromPatches( ldr ifc.Loader, paths []patch.StrategicMerge) ([]*Resource, error)
- type Resource
- func (r *Resource) Behavior() ifc.GenerationBehavior
- func (r *Resource) Id() resid.ResId
- func (r *Resource) IsGenerated() bool
- func (r *Resource) Merge(other *Resource)
- func (r *Resource) Replace(other *Resource)
- func (r *Resource) SetBehavior(b ifc.GenerationBehavior) *Resource
- func (r *Resource) String() string
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory makes instances of Resource.
func NewFactory ¶
func NewFactory(kf ifc.KunstructuredFactory) *Factory
NewFactory makes an instance of Factory.
func (*Factory) FromKunstructured ¶
func (rf *Factory) FromKunstructured( u ifc.Kunstructured) *Resource
FromKunstructured returns a new instance of Resource.
func (*Factory) FromMap ¶
FromMap returns a new instance of Resource.
func (*Factory) MakeConfigMap ¶
func (rf *Factory) MakeConfigMap(args *types.ConfigMapArgs, options *types.GeneratorOptions) (*Resource, error)
MakeConfigMap makes an instance of Resource for ConfigMap
func (*Factory) MakeSecret ¶
func (rf *Factory) MakeSecret(args *types.SecretArgs, options *types.GeneratorOptions) (*Resource, error)
MakeSecret makes an instance of Resource for Secret
func (*Factory) Set ¶
func (rf *Factory) Set(fs fs.FileSystem, ldr ifc.Loader)
Set sets the filesystem and loader for the underlying factory
func (*Factory) SliceFromBytes ¶
SliceFromBytes unmarshalls bytes into a Resource slice.
func (*Factory) SliceFromPatches ¶
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() ifc.GenerationBehavior
Behavior returns the behavior for the resource.
func (*Resource) Id ¶
Id returns the ResId for the resource.
func (*Resource) IsGenerated ¶
IsGenerated checks if the resource is generated from a generator
func (*Resource) Merge ¶
Merge performs merge with other resource.
func (*Resource) Replace ¶
Replace performs replace with other resource.
func (*Resource) SetBehavior ¶
func (r *Resource) SetBehavior(b ifc.GenerationBehavior) *Resource
SetBehavior changes the resource to the new behavior
func (*Resource) String ¶
String returns resource as JSON.
Source Files ¶
factory.go resource.go
- Version
- v1.0.11 (latest)
- Published
- Nov 29, 2018
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 2 hours ago –
Tools for package owners.