2021-07-14 10:53:00 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, callPackage }:
|
2021-03-12 11:50:03 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "tfk8s";
|
2021-08-30 21:21:26 +00:00
|
|
|
version = "0.1.7";
|
2021-06-16 07:19:24 +00:00
|
|
|
tag = "v${version}";
|
2021-03-12 11:50:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jrhouston";
|
|
|
|
repo = "tfk8s";
|
2021-06-16 07:19:24 +00:00
|
|
|
rev = tag;
|
2021-08-30 21:21:26 +00:00
|
|
|
sha256 = "0mkfggwjrsp0rzh7ll6nmp9kqcw4fl8q81vk67z5mbd276dkyxrb";
|
2021-03-12 11:50:03 +00:00
|
|
|
};
|
|
|
|
|
2022-01-01 03:40:41 +00:00
|
|
|
vendorSha256 = "sha256-6sMPpizrjM/UIxrAI2KQJy9uxzsjZGrSlQXjvL4wkQg=";
|
2021-03-12 11:50:03 +00:00
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = [
|
2021-03-12 11:50:03 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2021-06-16 07:19:24 +00:00
|
|
|
"-X main.toolVersion=${tag}"
|
2021-03-12 11:50:03 +00:00
|
|
|
"-X main.builtBy=nixpkgs"
|
|
|
|
];
|
|
|
|
|
2021-06-16 07:19:24 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/tfk8s --version | grep ${tag} > /dev/null
|
|
|
|
'';
|
|
|
|
|
2021-07-14 10:53:00 +00:00
|
|
|
passthru.tests = {
|
|
|
|
sample1 = callPackage ./tests/sample1 { };
|
|
|
|
};
|
|
|
|
|
2021-03-12 11:50:03 +00:00
|
|
|
meta = with lib; {
|
2021-06-16 07:19:24 +00:00
|
|
|
description = "An utility to convert Kubernetes YAML manifests to Terraform's HCL format";
|
2021-03-12 11:50:03 +00:00
|
|
|
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/";
|
2021-11-09 23:46:31 +00:00
|
|
|
maintainers = with maintainers; [ bryanasdev000 ];
|
2021-03-12 11:50:03 +00:00
|
|
|
};
|
|
|
|
}
|