Expose basic cluster information to jsonnet
This change adds two new jsonnet native functions:
-
kubernetesVersionreturns (eg)[1, 7]for a K8s 1.7 server. -
kubernetesGroupVersionSupportedreturns a bool indicating whether a given GroupVersion is supported by the current server
Note the latter does not provide a way to iterate over all supported GroupVersions, for privacy.
Discuss. In particular:
-
I'm not crazy about the length of the name
kubernetesGroupVersionSupported -
I made
kubernetesVersionreturn [int, int] (rather than the native [str, str] which k8s exposes) since I thought doing less-than/greater-than comparisons would be common. The problem with this is that it's actually [float, float] because jsonnet inherits json's types - and I'm mildly concerned this is theoretically not comparable for equality (also a common expected operation).
Obviously this opens up a whole lot of interesting possibilities for portable configs.
oh, and the first of the two commits rewrites show_test.go as an integration test. Fixes #99