about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-03-17 23:44:19 +0000
committerJörg Thalheim <joerg@thalheim.io>2020-03-18 09:09:25 +0000
commit9d144b84a339ff38692e4b02b5268be01b2f3e30 (patch)
tree8b07369ca0b4912a74bf4aa53835ed9f91058cc1 /pkgs/applications/networking/cluster
parentbfcb19197b117342da2676652fb5e30fe5323890 (diff)
downloadnixlib-9d144b84a339ff38692e4b02b5268be01b2f3e30.tar
nixlib-9d144b84a339ff38692e4b02b5268be01b2f3e30.tar.gz
nixlib-9d144b84a339ff38692e4b02b5268be01b2f3e30.tar.bz2
nixlib-9d144b84a339ff38692e4b02b5268be01b2f3e30.tar.lz
nixlib-9d144b84a339ff38692e4b02b5268be01b2f3e30.tar.xz
nixlib-9d144b84a339ff38692e4b02b5268be01b2f3e30.tar.zst
nixlib-9d144b84a339ff38692e4b02b5268be01b2f3e30.zip
kubeval: don't build against schema by default
kubeval-schema is a huge 7GB repository that we do not want
to build on hydra. Therefore make it optional.
Diffstat (limited to 'pkgs/applications/networking/cluster')
-rw-r--r--pkgs/applications/networking/cluster/kubeval/default.nix25
-rw-r--r--pkgs/applications/networking/cluster/kubeval/schema.nix15
2 files changed, 15 insertions, 25 deletions
diff --git a/pkgs/applications/networking/cluster/kubeval/default.nix b/pkgs/applications/networking/cluster/kubeval/default.nix
index 84e9b8899431..54be5956040c 100644
--- a/pkgs/applications/networking/cluster/kubeval/default.nix
+++ b/pkgs/applications/networking/cluster/kubeval/default.nix
@@ -1,26 +1,5 @@
 { stdenv, lib, fetchFromGitHub, buildGoModule, makeWrapper }:
 
-let
-
-  # Cache schema as a package so network calls are not
-  # necessary at runtime, allowing use in package builds
-  schema = stdenv.mkDerivation {
-    name = "kubeval-schema";
-    src = fetchFromGitHub {
-      owner = "instrumenta";
-      repo = "kubernetes-json-schema";
-      rev = "6a498a60dc68c5f6a1cc248f94b5cd1e7241d699";
-      sha256 = "1y9m2ma3n4h7sf2lg788vjw6pkfyi0fa7gzc870faqv326n6x2jr";
-    };
-
-    installPhase = ''
-      mkdir -p $out/kubernetes-json-schema/master
-      cp -R . $out/kubernetes-json-schema/master
-    '';
-   };
-
-in
-
 buildGoModule rec {
   pname = "kubeval";
   version = "0.14.0";
@@ -32,12 +11,8 @@ buildGoModule rec {
     sha256 = "0kpwk7bv36m3i8vavm1pqc8l611c6l9qbagcc64v6r85qig4w5xv";
   };
 
-  buildInputs = [ makeWrapper ];
-
   modSha256 = "0y9x44y3bchi8xg0a6jmp2rmi8dybkl6qlywb6nj1viab1s8dd4y";
 
-  postFixup = "wrapProgram $out/bin/kubeval --set KUBEVAL_SCHEMA_LOCATION file:///${schema}/kubernetes-json-schema/master";
-
   meta = with lib; {
     description = "Validate your Kubernetes configuration files";
     homepage = https://github.com/instrumenta/kubeval;
diff --git a/pkgs/applications/networking/cluster/kubeval/schema.nix b/pkgs/applications/networking/cluster/kubeval/schema.nix
new file mode 100644
index 000000000000..370fe9a1cd82
--- /dev/null
+++ b/pkgs/applications/networking/cluster/kubeval/schema.nix
@@ -0,0 +1,15 @@
+{ fetchFromGitHub }:
+# To cache schema as a package so network calls are not
+# necessary at runtime, allowing use in package builds you can use the following:
+
+#   KUBEVAL_SCHEMA_LOCATION="file:///${kubeval-schema}";
+(fetchFromGitHub {
+  name = "kubeval-schema";
+  owner = "instrumenta";
+  repo = "kubernetes-json-schema";
+  rev = "6a498a60dc68c5f6a1cc248f94b5cd1e7241d699";
+  sha256 = "1y9m2ma3n4h7sf2lg788vjw6pkfyi0fa7gzc870faqv326n6x2jr";
+}) // {
+  # the schema is huge (> 7GB), we don't get any benefit from building int on hydra
+  meta.hydraPlatforms = [];
+}