Documentation
¶
Index ¶
- func FilterObjectsByKind(objs []*unstructured.Unstructured, includeKinds, excludeKinds []string) []*unstructured.Unstructured
- func FirstNonEmpty(vals ...string) string
- func ObjectGVK(u *unstructured.Unstructured) schema.GroupVersionKind
- func PrintObjectsSummary(cmd *cobra.Command, objs []*unstructured.Unstructured)
- type CRDConditionRule
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 ¶
FirstNonEmpty returns the first non-empty string (after TrimSpace), or "".
func ObjectGVK ¶
func ObjectGVK(u *unstructured.Unstructured) schema.GroupVersionKind
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.