Documentation
¶
Index ¶
- func AddRepo(repoName, repoUrl string, settings *cli.EnvSettings) error
- func FieldPath(fieldPath []interface{}) string
- func GetActionConfig(namespace string, settings *cli.EnvSettings) (*action.Configuration, error)
- func HelmSettings() (*cli.EnvSettings, error)
- func Invalid(fieldPath []interface{}, value interface{}, detail string) *field.Error
- func InvalidType(fieldPath []interface{}, value interface{}, validTypes string) *field.Error
- func IsCRD(u *unstructured.Unstructured) bool
- func KyamlNodeToUnstructured(n *yaml.RNode) (*unstructured.Unstructured, error)
- func LookupResourceScope(u *unstructured.Unstructured, crds []*unstructured.Unstructured, ...) (meta.RESTScope, error)
- func NestedField(obj map[string]interface{}, fields ...interface{}) (interface{}, bool, error)
- func NewKustomizePostrenderer(dir string) *kustomizePostrenderer
- func NewRaw(dir string) *raw
- func NotFound(fieldPath []interface{}, value interface{}) *field.Error
- func RemoveAnnotations(n *yaml.RNode, annotations ...kioutil.AnnotationKey) error
- func Render(dir string, svc *console.ServiceDeploymentForAgent, mapper meta.RESTMapper) ([]unstructured.Unstructured, error)
- func UpdateRepos(settings *cli.EnvSettings) error
- type NamespaceMismatchError
- type ReaderOptions
- type Renderer
- type StreamManifestReader
- type Template
- type UnknownTypeError
- type UnknownTypesError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldPath ¶
func FieldPath(fieldPath []interface{}) string
FieldPath formats a list of KRM field keys as a JSONPath expression. The only valid field keys in KRM are strings (map keys) and ints (list keys). Simple strings (see isSimpleString) will be delimited with a period. Complex strings will be wrapped with square brackets and double quotes. Integers will be wrapped with square brackets. All other types will be formatted best-effort within square brackets.
func GetActionConfig ¶
func GetActionConfig(namespace string, settings *cli.EnvSettings) (*action.Configuration, error)
GetActionConfig now receives EnvSettings instead of using a global
func HelmSettings ¶
func HelmSettings() (*cli.EnvSettings, error)
func Invalid ¶
Invalid returns a *Error indicating "invalid value". This is used to report malformed values (e.g. failed regex match, too long, out of bounds).
func InvalidType ¶
InvalidType returns a *Error indicating "invalid value type". This is used to report malformed values (e.g. found int, expected string).
func IsCRD ¶
func IsCRD(u *unstructured.Unstructured) bool
IsCRD returns true if the passed Unstructured object has GroupKind == Extensions/CustomResourceDefinition; false otherwise.
func KyamlNodeToUnstructured ¶
func KyamlNodeToUnstructured(n *yaml.RNode) (*unstructured.Unstructured, error)
KyamlNodeToUnstructured take a resource represented as a kyaml RNode and turns it into an Unstructured object.
func LookupResourceScope ¶
func LookupResourceScope(u *unstructured.Unstructured, crds []*unstructured.Unstructured, mapper meta.RESTMapper) (meta.RESTScope, error)
LookupResourceScope tries to look up the scope of the type of the provided resource, looking at both the types known to the cluster (through the RESTMapper) and the provided CRDs. If no information about the type can be found, an UnknownTypeError wil be returned.
func NestedField ¶
NestedField gets a value from a KRM map, if it exists, otherwise nil. Fields can be string (map key) or int (array index).
func NewKustomizePostrenderer ¶
func NewKustomizePostrenderer(dir string) *kustomizePostrenderer
func NotFound ¶
NotFound returns a *Error indicating "value not found". This is used to report failure to find a requested value (e.g. looking up an ID).
func RemoveAnnotations ¶
func RemoveAnnotations(n *yaml.RNode, annotations ...kioutil.AnnotationKey) error
RemoveAnnotations removes the specified kioutil annotations from the resource.
func Render ¶
func Render(dir string, svc *console.ServiceDeploymentForAgent, mapper meta.RESTMapper) ([]unstructured.Unstructured, error)
func UpdateRepos ¶
func UpdateRepos(settings *cli.EnvSettings) error
UpdateRepos now receives EnvSettings
Types ¶
type NamespaceMismatchError ¶
NamespaceMismatchError is returned if all resources must be in a specific namespace, and resources are found using other namespaces.
func (*NamespaceMismatchError) Error ¶
func (e *NamespaceMismatchError) Error() string
type ReaderOptions ¶
type ReaderOptions struct {
Mapper meta.RESTMapper
Validate bool
Namespace string
EnforceNamespace bool
}
ReaderOptions defines the shared inputs for the different implementations of the ManifestReader interface.
type StreamManifestReader ¶
type StreamManifestReader struct {
ReaderName string
Reader io.Reader
ReaderOptions
}
StreamManifestReader reads manifest from the provided io.Reader and returns them as Info objects. The returned Infos will not have client or mapping set.
func (*StreamManifestReader) Read ¶
func (r *StreamManifestReader) Read() ([]unstructured.Unstructured, error)
Read reads the manifests and returns them as Info objects.
type Template ¶
type Template interface {
Render(svc *console.ServiceDeploymentForAgent, mapper meta.RESTMapper) ([]unstructured.Unstructured, error)
}
func NewKustomize ¶
type UnknownTypeError ¶
type UnknownTypeError struct {
GroupVersionKind schema.GroupVersionKind
}
UnknownTypeError captures information about a type for which no information could be found in the cluster or among the known CRDs.
func (*UnknownTypeError) Error ¶
func (e *UnknownTypeError) Error() string
type UnknownTypesError ¶
type UnknownTypesError struct {
GroupVersionKinds []schema.GroupVersionKind
}
UnknownTypesError captures information about unknown types encountered.
func (*UnknownTypesError) Error ¶
func (e *UnknownTypesError) Error() string