Documentation
¶
Index ¶
- func IsBuiltInClusterScoped(gvk schema.GroupVersionKind) bool
- func IsKnownNamespacedBuiltIn(gvk schema.GroupVersionKind) bool
- type CRDScope
- type CRDScopeEntry
- type CRDScopeRegistry
- type Document
- func DecodeDocumentRoots(path string, reader io.Reader) ([]Document, error)
- func DecodeDocuments(path string, reader io.Reader) ([]Document, error)
- func DecodeGeneratedDocuments(path string, reader io.Reader) ([]Document, error)
- func DecodeYAML12Documents(path string, reader io.Reader) ([]Document, error)
- type Identity
- type ResourceFilter
- type SettingsResourceFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBuiltInClusterScoped ¶ added in v0.1.18
func IsBuiltInClusterScoped(gvk schema.GroupVersionKind) bool
func IsKnownNamespacedBuiltIn ¶ added in v0.1.18
func IsKnownNamespacedBuiltIn(gvk schema.GroupVersionKind) bool
Types ¶
type CRDScope ¶ added in v0.2.1
type CRDScope string
CRDScope is a CustomResourceDefinition spec.scope value.
type CRDScopeEntry ¶ added in v0.2.1
CRDScopeEntry is the scope (and cheaply-captured versions) for one CRD's group/kind. Versions are retained for a later api-version inference plan.
type CRDScopeRegistry ¶ added in v0.2.1
type CRDScopeRegistry map[groupKind]CRDScopeEntry
CRDScopeRegistry maps a custom resource's {group, kind} to its declared scope.
func BuildCRDScopeRegistry ¶ added in v0.2.1
func BuildCRDScopeRegistry(objects []*unstructured.Unstructured) CRDScopeRegistry
BuildCRDScopeRegistry scans rendered objects for CustomResourceDefinition manifests and records each declared {group, kind} -> scope. Objects that are not v1 CRDs or that omit spec.group/spec.names.kind/spec.scope are ignored.
func (CRDScopeRegistry) IsClusterScoped ¶ added in v0.2.1
func (r CRDScopeRegistry) IsClusterScoped(gvk schema.GroupVersionKind) bool
IsClusterScoped consults the registry first, then the built-in cluster-scoped list.
func (CRDScopeRegistry) Scope ¶ added in v0.2.1
func (r CRDScopeRegistry) Scope(gvk schema.GroupVersionKind) (CRDScope, bool)
Scope returns the declared scope for a custom resource's group/kind.
type Document ¶
type Document struct {
Path string
Index int
Object *unstructured.Unstructured
RootObject *unstructured.Unstructured
}
func DecodeDocumentRoots ¶
DecodeDocumentRoots is DecodeDocuments without List flattening.
func DecodeDocuments ¶
DecodeDocuments decodes a YAML or JSON manifest stream the way kubectl and Argo CD's directory source read it (see manifestyaml.Decoder) and flattens List documents into their items.
func DecodeGeneratedDocuments ¶ added in v0.3.3
DecodeGeneratedDocuments decodes helm, kustomize, or config management plugin output the way Argo CD's repo-server splits it with gitops-engine kube.SplitYAML (see manifestyaml.NewGeneratedDecoder).
func DecodeYAML12Documents ¶ added in v0.3.3
DecodeYAML12Documents decodes a manifest stream with YAML 1.2 rules (go.yaml.in/yaml/v3), the reading kustomize gives the resources it transforms: unquoted yes/no/on/off stay strings and timestamps become RFC 3339 strings. kustomize keeps metadata labels and annotations as the text they were written with, which this reading does not reproduce. It exists for manifests drydock hands to kustomize as input; everything Argo CD itself reads goes through DecodeDocuments or DecodeGeneratedDocuments.
type Identity ¶
type Identity struct {
Group string `json:"group" yaml:"group"`
Kind string `json:"kind" yaml:"kind"`
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
Name string `json:"name" yaml:"name"`
}
func IdentityOf ¶
func IdentityOf(obj *unstructured.Unstructured) Identity
type ResourceFilter ¶
ResourceFilter describes rendered Kubernetes resources that should be dropped.
func (ResourceFilter) Drop ¶
func (f ResourceFilter) Drop(obj *unstructured.Unstructured) bool
Drop reports whether obj should be excluded by the filter.
func (ResourceFilter) Empty ¶
func (f ResourceFilter) Empty() bool
Empty reports whether the filter has no effective drop rules.
type SettingsResourceFilter ¶
type SettingsResourceFilter struct {
Exclusions []config.ResourceFilterRule
Inclusions []config.ResourceFilterRule
}