Unverified Commit ee3ba473 authored by Paul Meyer's avatar Paul Meyer Committed by GitHub
Browse files

kubevpn: 2.8.0 -> 2.8.1 (#425740)

parents 8777ce52 3860892d
Loading
Loading
Loading
Loading
+34 −21
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildGoModule,
  fetchFromGitHub,
  go,
  versionCheckHook,
}:

buildGoModule rec {
buildGoModule (finalAttrs: {
  pname = "kubevpn";
  version = "2.8.0";
  version = "2.8.1";

  src = fetchFromGitHub {
    owner = "KubeNetworks";
    repo = "kubevpn";
    rev = "v${version}";
    hash = "sha256-iVQzdYWmJOsLP2Za8nGZbxlbgxJdSkKWMXnl4Tijmkg=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-+TyaujgbeQXApxmjYvLnmhBZZUeIZMidzS7mL+Ach3o=";
  };

  vendorHash = null;
@@ -23,7 +25,7 @@ buildGoModule rec {
  ];

  ldflags = [
    "-X github.com/wencaiwulue/kubevpn/v2/pkg/config.Version=v${version}"
    "-X github.com/wencaiwulue/kubevpn/v2/pkg/config.Version=v${finalAttrs.version}"
    "-X github.com/wencaiwulue/kubevpn/v2/cmd/kubevpn/cmds.OsArch=${go.GOOS}/${go.GOARCH}"
  ];

@@ -32,26 +34,37 @@ buildGoModule rec {
    export HOME=$(mktemp -d)
  '';

  checkFlags =
    let
      skippedTests = [
        # Disable network tests
  checkFlags = [
    "-skip=^Test(Route|Functions|ByDumpClusterInfo|ByCreateSvc|Elegant)$"
        "TestRoute"
        "TestFunctions"
        "TestByDumpClusterInfo"
        "TestByCreateSvc"
        "TestElegant"
      ]
      ++ lib.optionals stdenv.hostPlatform.isDarwin [
        # Not sure why these test fail on darwin with __darwinAllowLocalNetworking.
        "TestHttpOverUnix"
        "TestConnectionRefuse"
      ];
    in
    [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];

  doInstallCheck = true;
  __darwinAllowLocalNetworking = true;

  installCheckPhase = ''
    runHook preInstallCheck
    $out/bin/kubevpn help
    $out/bin/kubevpn version | grep -e "Version: v${version}"
    runHook postInstallCheck
  '';
  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckKeepEnvironment = [ "HOME" ];
  versionCheckProgramArg = "version";

  meta = with lib; {
    changelog = "https://github.com/KubeNetworks/kubevpn/releases/tag/${src.rev}";
  meta = {
    changelog = "https://github.com/KubeNetworks/kubevpn/releases/tag/${finalAttrs.src.rev}";
    description = "Create a VPN and connect to Kubernetes cluster network, access resources, and more";
    mainProgram = "kubevpn";
    homepage = "https://github.com/KubeNetworks/kubevpn";
    license = licenses.mit;
    maintainers = with maintainers; [ mig4ng ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ mig4ng ];
  };
}
})