git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #130164 from superherointj/package-tfk8s-v0.1.5
commit07947020838e2f6b5c4c277c388cb06702490f31 authorSandro <sandro.jaeckel@gmail.com> dateTue 20 Jul 2021, 11:19 (5 years ago) parentf0a7983909c6f0
4 files changed+38−4
pkgs/tools/misc/tfk8s/default.nix+8−4 pkgs/tools/misc/tfk8s/tests/sample1/default.nix+11 pkgs/tools/misc/tfk8s/tests/sample1/input.yaml+7 pkgs/tools/misc/tfk8s/tests/sample1/output.tf+12
pkgs/tools/misc/tfk8s/default.nix+8−4
@@ -1,18 +1,18 @@
1−{ lib, buildGoModule, fetchFromGitHub }:
1+{ lib, buildGoModule, fetchFromGitHub, callPackage }:
22
33buildGoModule rec {
44 pname = "tfk8s";
5− version = "0.1.4";
5+ version = "0.1.5";
66 tag = "v${version}";
77
88 src = fetchFromGitHub {
99 owner = "jrhouston";
1010 repo = "tfk8s";
1111 rev = tag;
12− sha256 = "sha256-Ha/F8rCGZqFYqJzfemmKRyEBI5khaSIerJxvf2Pf2ao=";
12+ sha256 = "sha256-T0zM2JOmzk8YyS3+De6yGwiwLgyb6Rwy6hT9b44wNxQ=";
1313 };
1414
15− vendorSha256 = "sha256-wS5diDQFkt8IAp13d8Yeh8ihLvKWdR0Mbw0fMZpqqKE=";
15+ vendorSha256 = "sha256-eLPmghs05pMMtys97Ja7YGdVMZmMmiaFeMwzaWNxW0I=";
1616 runVend = true;
1717
1818 buildFlagsArray = [
@@ -30,6 +30,10 @@ buildGoModule rec {
3030 $out/bin/tfk8s --version | grep ${tag} > /dev/null
3131 '';
3232
33+ passthru.tests = {
34+ sample1 = callPackage ./tests/sample1 { };
35+ };
36+
3337 meta = with lib; {
3438 description = "An utility to convert Kubernetes YAML manifests to Terraform's HCL format";
3539 license = licenses.mit;
pkgs/tools/misc/tfk8s/tests/sample1/default.nixnew file+11
@@ -0,0 +1,11 @@
1+{ runCommandCC, tfk8s }:
2+
3+runCommandCC "tfk8s-test-sample1" {
4+ buildInputs = [
5+ tfk8s
6+ ];
7+ meta.timeout = 60;
8+ }
9+ ''
10+ cmp <(${tfk8s}/bin/tfk8s -f ${./input.yaml}) ${./output.tf} > $out
11+ ''
pkgs/tools/misc/tfk8s/tests/sample1/input.yamlnew file+7
@@ -0,0 +1,7 @@
1+---
2+apiVersion: v1
3+kind: ConfigMap
4+metadata:
5+ name: test
6+data:
7+ TEST: test
pkgs/tools/misc/tfk8s/tests/sample1/output.tfnew file+12
@@ -0,0 +1,12 @@
1+resource "kubernetes_manifest" "configmap_test" {
2+ manifest = {
3+ "apiVersion" = "v1"
4+ "data" = {
5+ "TEST" = "test"
6+ }
7+ "kind" = "ConfigMap"
8+ "metadata" = {
9+ "name" = "test"
10+ }
11+ }
12+}