about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/kubeone
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2022-09-03 21:07:09 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2022-09-03 21:25:22 -0300
commita7c2c726fbadac66535cd62bdc94e51aa9099760 (patch)
tree09e3ffc575bccf1cd86c423fc92b19b33ef7180a /pkgs/applications/networking/cluster/kubeone
parent7bfe572566e96c3f3a6388262a86afcf47dbf721 (diff)
kubeone: fix version
* Add version test
* Add upstream flags
Diffstat (limited to 'pkgs/applications/networking/cluster/kubeone')
-rw-r--r--pkgs/applications/networking/cluster/kubeone/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/kubeone/default.nix b/pkgs/applications/networking/cluster/kubeone/default.nix
index 60fc4847aa564..22e2f4764ac1a 100644
--- a/pkgs/applications/networking/cluster/kubeone/default.nix
+++ b/pkgs/applications/networking/cluster/kubeone/default.nix
@@ -2,6 +2,8 @@
 , buildGoModule
 , fetchFromGitHub
 , installShellFiles
+, kubeone
+, testers
 }:
 
 buildGoModule rec {
@@ -17,6 +19,12 @@ buildGoModule rec {
 
   vendorSha256 = "sha256-w/uLR7wi28Ub7Nouxxg39NlD1OzyIE2oEP4D88Xbwu0=";
 
+  ldflags = [
+    "-s -w"
+    "-X k8c.io/kubeone/pkg/cmd.version=${version}"
+    "-X k8c.io/kubeone/pkg/cmd.date=unknown"
+  ];
+
   nativeBuildInputs = [
     installShellFiles
   ];
@@ -27,6 +35,11 @@ buildGoModule rec {
       --zsh <($out/bin/kubeone completion zsh)
   '';
 
+  passthru.tests.version = testers.testVersion {
+    package = kubeone;
+    command = "kubeone version";
+  };
+
   meta = {
     description = "Automate cluster operations on all your cloud, on-prem, edge, and IoT environments.";
     homepage = "https://kubeone.io/";