Merge pull request #130164 from superherointj/package-tfk8s-v0.1.5
This commit is contained in:
commit
0794702083
|
@ -1,18 +1,18 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
{ lib, buildGoModule, fetchFromGitHub, callPackage }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "tfk8s";
|
||||
version = "0.1.4";
|
||||
version = "0.1.5";
|
||||
tag = "v${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jrhouston";
|
||||
repo = "tfk8s";
|
||||
rev = tag;
|
||||
sha256 = "sha256-Ha/F8rCGZqFYqJzfemmKRyEBI5khaSIerJxvf2Pf2ao=";
|
||||
sha256 = "sha256-T0zM2JOmzk8YyS3+De6yGwiwLgyb6Rwy6hT9b44wNxQ=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-wS5diDQFkt8IAp13d8Yeh8ihLvKWdR0Mbw0fMZpqqKE=";
|
||||
vendorSha256 = "sha256-eLPmghs05pMMtys97Ja7YGdVMZmMmiaFeMwzaWNxW0I=";
|
||||
runVend = true;
|
||||
|
||||
buildFlagsArray = [
|
||||
|
@ -30,6 +30,10 @@ buildGoModule rec {
|
|||
$out/bin/tfk8s --version | grep ${tag} > /dev/null
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
sample1 = callPackage ./tests/sample1 { };
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "An utility to convert Kubernetes YAML manifests to Terraform's HCL format";
|
||||
license = licenses.mit;
|
||||
|
|
11
pkgs/tools/misc/tfk8s/tests/sample1/default.nix
Normal file
11
pkgs/tools/misc/tfk8s/tests/sample1/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ runCommandCC, tfk8s }:
|
||||
|
||||
runCommandCC "tfk8s-test-sample1" {
|
||||
buildInputs = [
|
||||
tfk8s
|
||||
];
|
||||
meta.timeout = 60;
|
||||
}
|
||||
''
|
||||
cmp <(${tfk8s}/bin/tfk8s -f ${./input.yaml}) ${./output.tf} > $out
|
||||
''
|
7
pkgs/tools/misc/tfk8s/tests/sample1/input.yaml
Normal file
7
pkgs/tools/misc/tfk8s/tests/sample1/input.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: test
|
||||
data:
|
||||
TEST: test
|
12
pkgs/tools/misc/tfk8s/tests/sample1/output.tf
Normal file
12
pkgs/tools/misc/tfk8s/tests/sample1/output.tf
Normal file
|
@ -0,0 +1,12 @@
|
|||
resource "kubernetes_manifest" "configmap_test" {
|
||||
manifest = {
|
||||
"apiVersion" = "v1"
|
||||
"data" = {
|
||||
"TEST" = "test"
|
||||
}
|
||||
"kind" = "ConfigMap"
|
||||
"metadata" = {
|
||||
"name" = "test"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue