objects

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterObjectsByKind

func FilterObjectsByKind(objs []*unstructured.Unstructured, includeKinds, excludeKinds []string) []*unstructured.Unstructured

FilterObjectsByKind filters the provided unstructured objects by include/exclude kind lists. Both include and exclude accept either plain Kind (e.g. "Deployment") or "group/kind" (e.g. "apps/deployment"). Matching is case-insensitive. If includeKinds is empty, all kinds are considered included unless excluded.

func FirstNonEmpty

func FirstNonEmpty(vals ...string) string

FirstNonEmpty returns the first non-empty string (after TrimSpace), or "".

func ObjectGVK

ObjectGVK returns the parsed GroupVersionKind for the provided unstructured. It tolerates simple/malformed apiVersion values by placing the whole version into Version when parsing fails (same behaviour used elsewhere).

func PrintObjectsSummary

func PrintObjectsSummary(cmd *cobra.Command, objs []*unstructured.Unstructured)

PrintObjectsSummary prints a brief summary of objects to the provided cobra command (so output follows the same writer/format helpers used by CLI). It prints counts grouped by group/kind and the list of namespaces present.

Types

type CRDConditionRule

type CRDConditionRule struct {
	Group     string
	Version   string
	Kind      string
	Condition string
	Expected  string
}

CRDConditionRule describes a readiness rule for a CRD based on status.conditions. Example: Group="external-secrets.io", Version="v1beta1", Kind="ExternalSecret", Condition="Ready", Expected="True".

func ParseCRDConditions

func ParseCRDConditions(rules []string) ([]CRDConditionRule, []error)

ParseCRDConditions parses --crd-condition style mappings.

Expected format for each entry:

group/version,Kind=ConditionType=ExpectedValue

Returns a slice of CRDConditionRule and a slice of non-fatal parse errors.

Jump to

Keyboard shortcuts

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