mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
Replace remarshal with yq (#26)
Remarshal doesn’t seem to be maintained anymore. It is also affected by upstream bugs like https://github.com/yaml/pyyaml/issues/89 which affects e.g. prometheus-operator CRDs.
This commit is contained in:
parent
0456c92538
commit
e77a3898de
2 changed files with 22 additions and 36 deletions
|
|
@ -6,19 +6,19 @@ with lib; let
|
|||
self = {
|
||||
importYAML = path:
|
||||
importJSON (pkgs.runCommand "yaml-to-json" {} ''
|
||||
${pkgs.remarshal}/bin/remarshal -i ${path} -if yaml -of json > $out
|
||||
${pkgs.yq}/bin/yq -c . ${path} > $out
|
||||
'');
|
||||
|
||||
toYAML = config:
|
||||
builtins.readFile (pkgs.runCommand "to-yaml" {} ''
|
||||
${pkgs.remarshal}/bin/remarshal -i ${pkgs.writeText "to-json" (builtins.toJSON config)} -if json -of yaml > $out
|
||||
${pkgs.yq}/bin/yq -y . ${pkgs.writeText "to-json" (builtins.toJSON config)} > $out
|
||||
'');
|
||||
|
||||
toMultiDocumentYaml = name: documents:
|
||||
pkgs.runCommand name {}
|
||||
(concatMapStringsSep "\necho --- >> $out\n"
|
||||
(
|
||||
d: "${pkgs.remarshal}/bin/remarshal -i ${builtins.toFile "doc" (builtins.toJSON d)} -if json -of yaml >> $out"
|
||||
d: "${pkgs.yq}/bin/yq -y . ${pkgs.writeText "to-json" (builtins.toJSON config)} >> $out"
|
||||
)
|
||||
documents);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue