jsonnet-libs icon indicating copy to clipboard operation
jsonnet-libs copied to clipboard

std.native('manifestYamlFromJson') may no longer be required

Open jacobstr opened this issue 3 years ago • 1 comments

Consider this diff:

diff --git a/ksonnet-util/util.libsonnet b/ksonnet-util/util.libsonnet
index a151e8a..683eafc 100644
--- a/ksonnet-util/util.libsonnet
+++ b/ksonnet-util/util.libsonnet
@@ -225,8 +225,7 @@ local util(k) = {
     ]),

   manifestYaml(value):: (
-    local f = std.native('manifestYamlFromJson');
-    f(std.toString(value))
+    std.manifestYamlDoc(value)
   ),

   resourcesRequests(cpu, memory)::

I'm trying to avoid using tanka just for this function. Note that there are some formatting differences - the generated yaml using the built-in likes to quote all key names:

https://github.com/google/jsonnet/issues/821

jacobstr avatar May 05 '22 03:05 jacobstr

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 07:08 stale[bot]