Documentation ¶
Index ¶
- Constants
- Variables
- func ListAsMap(list List, nameFormat string) (map[string]interface{}, error)
- type ErrorDuplicateName
- type List
- type Manifest
- func (m Manifest) APIVersion() string
- func (m Manifest) IsList() bool
- func (m Manifest) Items() (List, error)
- func (m Manifest) Kind() string
- func (m Manifest) KindName() string
- func (m Manifest) Metadata() Metadata
- func (m Manifest) String() string
- func (m *Manifest) UnmarshalJSON(data []byte) error
- func (m *Manifest) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (m Manifest) Verify() error
- type Metadata
- func (m Metadata) Annotations() map[string]interface{}
- func (m Metadata) GenerateName() string
- func (m Metadata) HasNamespace() bool
- func (m Metadata) Labels() map[string]interface{}
- func (m Metadata) ManagedFields() []interface{}
- func (m Metadata) Name() string
- func (m Metadata) Namespace() string
- func (m Metadata) UID() string
- type SampleString
- type SchemaError
Constants ¶
const DefaultNameFormat = `{{ print .kind "_" .metadata.name | snakecase }}`
DefaultNameFormat to use when no nameFormat is supplied
Variables ¶
var ( ErrInvalidStr = fmt.Errorf("missing or not of string type") ErrInvalidMap = fmt.Errorf("missing or not an object") )
Functions ¶
Types ¶
type ErrorDuplicateName ¶ added in v0.13.0
type ErrorDuplicateName struct {
// contains filtered or unexported fields
}
ErrorDuplicateName means two resources share the same name using the given nameFormat.
func (ErrorDuplicateName) Error ¶ added in v0.13.0
func (e ErrorDuplicateName) Error() string
type List ¶
type List []Manifest
List of individual Manifests
func (List) Namespaces ¶ added in v0.15.1
type Manifest ¶
type Manifest map[string]interface{}
Manifest represents a Kubernetes API object. The fields `apiVersion` and `kind` are required, `metadata.name` should be present as well
func NewFromObj ¶
NewFromObj creates a new Manifest from an objx.Map
func (Manifest) APIVersion ¶
APIVersion returns the version of the API this object uses
func (Manifest) IsList ¶ added in v0.11.0
IsList returns whether the manifest is a List type, containing other manifests as children. Code based on https://github.com/kubernetes/apimachinery/blob/61490fe38e784592212b24b9878306b09be45ab0/pkg/apis/meta/v1/unstructured/unstructured.go#L54
func (Manifest) KindName ¶ added in v0.11.0
KindName returns kind and metadata.name in the `<kind>/<name>` format
func (*Manifest) UnmarshalJSON ¶
UnmarshalJSON validates the Manifest during json parsing
func (*Manifest) UnmarshalYAML ¶
UnmarshalYAML validates the Manifest during yaml parsing
type Metadata ¶
type Metadata map[string]interface{}
Metadata is the metadata object from the Manifest
func (Metadata) Annotations ¶
Annotations of the manifest
func (Metadata) GenerateName ¶ added in v0.27.0
func (Metadata) HasNamespace ¶
HasNamespace returns whether the manifest has a namespace set
func (Metadata) ManagedFields ¶ added in v0.21.0
func (m Metadata) ManagedFields() []interface{}
Managed fields of the manifest
type SampleString ¶ added in v0.11.0
type SampleString string
SampleString is used for displaying code samples for error messages. It truncates the output to 10 lines
func (SampleString) Indent ¶ added in v0.11.0
func (s SampleString) Indent(n int) string
func (SampleString) String ¶ added in v0.11.0
func (s SampleString) String() string
type SchemaError ¶
SchemaError means that some expected fields were missing
func (*SchemaError) Error ¶
func (s *SchemaError) Error() string
Error returns the fields the manifest at the path is missing