Add secrets for archive-box, webhook-bridge, and tekton.
This commit is contained in:
@@ -16,19 +16,29 @@
|
||||
secret_name,
|
||||
secret_namespace,
|
||||
secret_values ? { },
|
||||
secret_type ? null,
|
||||
secret_annotations ? null,
|
||||
...
|
||||
}:
|
||||
let
|
||||
toBase64 = (pkgs.callPackage ../../contrib/base64/package.nix { inherit lib; }).toBase64;
|
||||
metadata = {
|
||||
name = "${secret_name}";
|
||||
namespace = "${secret_namespace}";
|
||||
}
|
||||
// lib.optionalAttrs (secret_annotations != null) {
|
||||
"annotations" = secret_annotations;
|
||||
};
|
||||
secret_yaml = {
|
||||
apiVersion = "v1";
|
||||
kind = "Secret";
|
||||
metadata = {
|
||||
name = "${secret_name}";
|
||||
namespace = "${secret_namespace}";
|
||||
};
|
||||
metadata = metadata;
|
||||
data = (builtins.mapAttrs (key: val: (toBase64 val)) secret_values);
|
||||
}
|
||||
// lib.optionalAttrs (secret_type != null) {
|
||||
"type" = secret_type;
|
||||
};
|
||||
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
yaml_body = settingsFormat.generate "${secret_name}.yaml" secret_yaml;
|
||||
yaml_file = pkgs.writeTextFile {
|
||||
|
||||
Reference in New Issue
Block a user