Documentation ¶
Index ¶
- func PatchForResourceUpdate(client discovery.OpenAPISchemaInterface, ...) ([]byte, types.PatchType, error)
- func Pluck(obj map[string]interface{}, path ...string) (interface{}, bool)
- func PropertiesChanged(oldObj, newObj map[string]interface{}, paths []string) ([]string, error)
- func ValidateAgainstSchema(client discovery.OpenAPISchemaInterface, obj *unstructured.Unstructured) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PatchForResourceUpdate ¶
func PatchForResourceUpdate( client discovery.OpenAPISchemaInterface, lastSubmitted, currentSubmitted, liveOldObj *unstructured.Unstructured, ) ([]byte, types.PatchType, error)
PatchForResourceUpdate introspects on the OpenAPI spec exposed by some client, and attempts to generate a strategic merge patch for use in a resource update. If there is no specification of how to generate a strategic merge patch, we fall back to JSON merge patch.
func Pluck ¶ added in v0.15.0
Pluck obtains the property identified by the string components in `path`. For example, `Pluck(foo, "bar", "baz")` returns `foo.bar.baz`.
func PropertiesChanged ¶ added in v0.16.0
PropertiesChanged compares two versions of an object to see if any path specified in `paths` has been changed. Paths are specified as JSONPaths, e.g., `.spec.accessModes` refers to `{spec: {accessModes: {}}}`.
func ValidateAgainstSchema ¶
func ValidateAgainstSchema( client discovery.OpenAPISchemaInterface, obj *unstructured.Unstructured, ) error
ValidateAgainstSchema validates a document against the schema.
Types ¶
This section is empty.