Unverified Commit cf16690d authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #215752 from stehessel/helm-fix-darwin-build

kubernetes-helm: fix darwin build
parents bd6ad445 5dd8bf81
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kubernetes-helm }:

buildGoModule rec {
  pname = "kubernetes-helm";
@@ -20,12 +20,13 @@ buildGoModule rec {
    "-X helm.sh/helm/v3/internal/version.gitCommit=${src.rev}"
  ];

  __darwinAllowLocalNetworking = true;

  preCheck = ''
    # skipping version tests because they require dot git directory
    substituteInPlace cmd/helm/version_test.go \
      --replace "TestVersion" "SkipVersion"
  '' + lib.optionalString stdenv.isLinux ''
    # skipping plugin tests on linux
    # skipping plugin tests
    substituteInPlace cmd/helm/plugin_test.go \
      --replace "TestPluginDynamicCompletion" "SkipPluginDynamicCompletion" \
      --replace "TestLoadPlugins" "SkipLoadPlugins"
@@ -41,6 +42,12 @@ buildGoModule rec {
    installShellCompletion helm.{bash,zsh,fish}
  '';

  passthru.tests.version = testers.testVersion {
    package = kubernetes-helm;
    command = "helm version";
    version = "v${version}";
  };

  meta = with lib; {
    homepage = "https://github.com/kubernetes/helm";
    description = "A package manager for kubernetes";