Help us shape the future of Go! Take the 2026 Go Developer Survey

sanitize

package
v0.15.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeObject

func SanitizeObject(obj client.Object, scheme *runtime.Scheme, opts SanitizeOptions) error

SanitizeObject removes metadata (and optionally status) from a client.Object in-place. For StripStatus it converts to unstructured and back (generic, but only when needed).

func SanitizeUnstructured

func SanitizeUnstructured(obj *unstructured.Unstructured, opts SanitizeOptions)

SanitizeUnstructured Removes additional metadata we might not need when loading unstructured items into a context.

Types

type SanitizeOptions

type SanitizeOptions struct {
	StripResourceVersion bool
	StripOwnerreferences bool
	StripGeneration      bool
	StripUID             bool
	StripManagedFields   bool
	StripLastApplied     bool
	StripStatus          bool
}

func DefaultSanitizeOptions

func DefaultSanitizeOptions() SanitizeOptions

Jump to

Keyboard shortcuts

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