Utility FunctionsΒΆ

These functions are useful when writing playbooks that deal with Kubernetes objects:


Parse a date/time related field in a Kubernetes object and convert it from string to a python datetime object

Return type:ΒΆ


duplicate_without_fields(obj, omitted_fields)[source]ΒΆ

Duplicate a hikaru object, omitting the specified fields

This is useful when you want to compare two versions of an object and first "cleanup" fields that shouldn't be compared.

obj : HikaruBaseΒΆ

A kubernetes object

omitted_fields : List[str]ΒΆ

List of fields to be omitted. Field name format should be '.' separated For example: ["status", "metadata.generation"]