manifest

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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.

const (
	CRDScopeCluster    CRDScope = "Cluster"
	CRDScopeNamespaced CRDScope = "Namespaced"
)

type CRDScopeEntry added in v0.2.1

type CRDScopeEntry struct {
	Scope    CRDScope
	Versions []string
}

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

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

func DecodeDocumentRoots(path string, reader io.Reader) ([]Document, error)

DecodeDocumentRoots is DecodeDocuments without List flattening.

func DecodeDocuments

func DecodeDocuments(path string, reader io.Reader) ([]Document, error)

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

func DecodeGeneratedDocuments(path string, reader io.Reader) ([]Document, error)

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

func DecodeYAML12Documents(path string, reader io.Reader) ([]Document, error)

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

func (Identity) String

func (i Identity) String() string

type ResourceFilter

type ResourceFilter struct {
	SkipKinds   []string
	SkipCRDs    bool
	SkipSecrets bool
}

ResourceFilter describes rendered Kubernetes resources that should be dropped.

func (ResourceFilter) Drop

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
}

func (SettingsResourceFilter) Drop

func (f SettingsResourceFilter) Drop(id Identity, cluster string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL