3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/tfk8s/default.nix

51 lines
1.4 KiB
Nix
Raw Normal View History

2021-07-14 11:53:00 +01:00
{ lib, buildGoModule, fetchFromGitHub, callPackage }:
buildGoModule rec {
pname = "tfk8s";
2021-07-14 11:51:48 +01:00
version = "0.1.5";
2021-06-16 08:19:24 +01:00
tag = "v${version}";
src = fetchFromGitHub {
owner = "jrhouston";
repo = "tfk8s";
2021-06-16 08:19:24 +01:00
rev = tag;
2021-07-14 11:51:48 +01:00
sha256 = "sha256-T0zM2JOmzk8YyS3+De6yGwiwLgyb6Rwy6hT9b44wNxQ=";
};
2021-07-14 11:51:48 +01:00
vendorSha256 = "sha256-eLPmghs05pMMtys97Ja7YGdVMZmMmiaFeMwzaWNxW0I=";
runVend = true;
buildFlagsArray = [
"-ldflags="
"-s"
"-w"
2021-06-16 08:19:24 +01:00
"-X main.toolVersion=${tag}"
"-X main.builtBy=nixpkgs"
];
2021-06-16 08:19:24 +01:00
doCheck = true;
doInstallCheck = true;
installCheckPhase = ''
$out/bin/tfk8s --version | grep ${tag} > /dev/null
'';
2021-07-14 11:53:00 +01:00
passthru.tests = {
sample1 = callPackage ./tests/sample1 { };
};
meta = with lib; {
2021-06-16 08:19:24 +01:00
description = "An utility to convert Kubernetes YAML manifests to Terraform's HCL format";
license = licenses.mit;
longDescription = ''
tfk8s is a tool that makes it easier to work with the Terraform Kubernetes Provider.
If you want to copy examples from the Kubernetes documentation or migrate existing YAML manifests and use them with Terraform without having to convert YAML to HCL by hand, this tool is for you.
Features:
* Convert a YAML file containing multiple manifests.
* Strip out server side fields when piping kubectl get $R -o yaml | tfk8s --strip
'';
homepage = "https://github.com/jrhouston/tfk8s/";
maintainers = with maintainers; [ superherointj ];
};
}