Documentation ¶
Index ¶
- Variables
- type ChildResource
- func (resource *ChildResource) CreateFuncName() string
- func (resource *ChildResource) InitFuncName() string
- func (resource *ChildResource) MutateFileName() string
- func (resource *ChildResource) MutateFuncName() string
- func (resource *ChildResource) NameComment() string
- func (resource *ChildResource) NameConstant() string
- func (resource *ChildResource) ProcessResourceMarkers(markerCollection *markers.MarkerCollection) error
- func (resource ChildResource) String() string
- type Manifest
- type Manifests
Constants ¶
This section is empty.
Variables ¶
var ( ErrChildResourceResourceMarkerInspect = errors.New("error inspecting resource markers for child resource") ErrChildResourceResourceMarkerProcess = errors.New("error processing resource markers for child resource") ErrChildResourceRBACGenerate = errors.New("error generating RBAC for child resource") )
var ErrProcessManifest = errors.New("error processing manifest file")
Functions ¶
This section is empty.
Types ¶
type ChildResource ¶
type ChildResource struct { Name string UniqueName string Group string Version string Kind string StaticContent string SourceCode string IncludeCode []string MutateFile string UseStrConv bool RBAC *rbac.Rules }
ChildResource contains attributes for resources created by the custom resource. These definitions are inferred from the resource manifests. They can be thought of as the individual resources which are managed by the controller during reconciliation and represent all resources which are passed in via the `spec.resources` field of the workload configuration.
func NewChildResource ¶
func NewChildResource(object unstructured.Unstructured) (*ChildResource, error)
NewChildResource returns a representation of a ChildResource object given an unstructured Kubernetes object.
func (*ChildResource) CreateFuncName ¶
func (resource *ChildResource) CreateFuncName() string
CreateFuncName returns the create func name for a child resource.
func (*ChildResource) InitFuncName ¶
func (resource *ChildResource) InitFuncName() string
InitFuncName returns the init func name for a child resource.
func (*ChildResource) MutateFileName ¶
func (resource *ChildResource) MutateFileName() string
MutateFileName returns the file name relative to the mutate directory. It is responsible for turning capital letters into lowercase letter prefixed with an underscore.
func (*ChildResource) MutateFuncName ¶
func (resource *ChildResource) MutateFuncName() string
MutateFuncName returns the mutate func name for a child resource.
func (*ChildResource) NameComment ¶
func (resource *ChildResource) NameComment() string
NameComment returns the name of a child resource to be used in generated code for the purposed of comments. It takes into account tags and can return a more friendly value that will strip the tags.
func (*ChildResource) NameConstant ¶
func (resource *ChildResource) NameConstant() string
NameConstant returns the constant which is generated in the code for re-use. It is needed for instances that the metadata.name field is a field marker, in which case we have no way to return the name constant.
func (*ChildResource) ProcessResourceMarkers ¶
func (resource *ChildResource) ProcessResourceMarkers(markerCollection *markers.MarkerCollection) error
func (ChildResource) String ¶
func (resource ChildResource) String() string
type Manifest ¶
type Manifest struct { Content []byte `json:",omitempty" yaml:",omitempty" validate:"omitempty"` Filename string `json:",omitempty" yaml:",omitempty" validate:"omitempty"` SourceFilename string `json:",omitempty" yaml:",omitempty" validate:"omitempty"` ChildResources []ChildResource `json:",omitempty" yaml:",omitempty" validate:"omitempty"` PreferredSourceFileNames []string `json:",omitempty" yaml:",omitempty" validate:"omitempty"` }
Manifest represents a single input manifest for a given config.
func (*Manifest) ExtractManifests ¶
ExtractManifests extracts the manifests as YAML strings from a manifest with existing manifest content.
func (*Manifest) LoadContent ¶
LoadContent sets the Content field of the manifest in raw format as []byte.
type Manifests ¶
type Manifests []*Manifest
Manifests represents a collection of manifests.
func ExpandManifests ¶
ExpandManifests expands manifests from its globbed pattern and return the resultant manifest filenames from the glob.
func (Manifests) FuncNames ¶
FuncNames returns the function names for a set of resources. The function names are derived from the child resource unique names and refer to the functions that actually create the child resource objects in memory for the purposes of shipping to the Kubernetes API for deployment into the cluster.