hall / kubenix

Kubernetes management with Nix
https://kubenix.org/
MIT License
319 stars 30 forks source link

Patch bug in remarshal #25

Closed felixscheinost closed 1 year ago

felixscheinost commented 1 year ago

This bug prevents import of Prometheus operator CRDs, as some list contains a =.

remarshal doesn't seem to be actively maintained anymore. I think it is sensible to patch it here, as it is merely an implementation detail of importYAML.

adrian-gierakowski commented 1 year ago

instead of patching unmaintained software I'd recommend switching to yq:

let
  importYAML = path: lib.importJSON (runCommand "yaml-to-json" {}
    ''
      ${yq}/bin/yq -c . ${builtins.path { inherit path; }} > $out
    ''
  );

  toYAMLFile = attrs: runCommand "to-yaml" {}
    ''
      ${yq}/bin/yq -y . ${writeText "to-json" (builtins.toJSON attrs)} > $out
    ''
  ;
felixscheinost commented 1 year ago

A cool! I tried searching for alternatives, I even tried switching to yaml2json, which is equivally as unmaintained and which has bugs that I quickly stumbled across as well. But yeah, that definitely makes more sense.

hall commented 1 year ago

Thanks both :100: closing in preference of #26.