Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jacobstr opened this issue May 5, 2022 · 1 comment
Open

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

jacobstr opened this issue May 5, 2022 · 1 comment
Labels

Comments

@jacobstr
Copy link

jacobstr commented May 5, 2022

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:

google/jsonnet#821

@stale
Copy link

stale bot commented Aug 13, 2022

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 stale bot added the stale label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant