I'm trying to add a custom function In Go template for parsing the time in PodStatus and getting the absolute time for it.
Example for the custom function:
PodScheduled, _ := time.Parse(time.RFC3339, "2021-12- 23T20:20:36Z")
Ready, _ := time.Parse(time.RFC3339, "2021-12-31T07:36:11Z")
difference := Ready.Sub(PodScheduled)
fmt.Printf("difference = %v\n", difference)
I can use the built-in functions.
How I can use a custom function with the kubectl?
For example this lib: https://github.com/Masterminds/sprig
Thanks :)