Unverified Commit b16a3ec9 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

k3d: 5.7.4 -> 5.8.1 (#375073)

parents 8e620b04 1b328442
Loading
Loading
Loading
Loading
+29 −12
Original line number Diff line number Diff line
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, k3sVersion ? null
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
  k3sVersion ? null,
}:

let
@@ -15,13 +16,13 @@ let
in
buildGoModule rec {
  pname = "k3d";
  version = "5.7.4";
  version = "5.8.1";

  src = fetchFromGitHub {
    owner = "k3d-io";
    repo = "k3d";
    tag = "v${version}";
    hash = "sha256-z+7yeX0ea/6+4aWbA5NYW/HzvVcJiSkewOvo+oXp9bE=";
    hash = "sha256-o56kBcuTOrDG8ZovGsIK+LIMi2Wps3kYJrqQuJHMd+A=";
  };

  vendorHash = "sha256-lFmIRtkUiohva2Vtg4AqHaB5McVOWW5+SFShkNqYVZ8=";
@@ -29,16 +30,26 @@ buildGoModule rec {

  nativeBuildInputs = [ installShellFiles ];

  excludedPackages = [ "tools" "docgen" ];
  excludedPackages = [
    "tools"
    "docgen"
  ];

  ldflags =
    let t = "github.com/k3d-io/k3d/v${lib.versions.major version}/version"; in
    [ "-s" "-w" "-X ${t}.Version=v${version}" ] ++ lib.optionals k3sVersionSet [ "-X ${t}.K3sVersion=v${k3sVersion}" ];
    let
      t = "github.com/k3d-io/k3d/v${lib.versions.major version}/version";
    in
    [
      "-s"
      "-w"
      "-X ${t}.Version=v${version}"
    ]
    ++ lib.optionals k3sVersionSet [ "-X ${t}.K3sVersion=v${k3sVersion}" ];

  preCheck = ''
    # skip test that uses networking
    substituteInPlace version/version_test.go \
      --replace "TestGetK3sVersion" "SkipGetK3sVersion"
      --replace-fail "TestGetK3sVersion" "SkipGetK3sVersion"
  '';

  postInstall = ''
@@ -70,7 +81,13 @@ buildGoModule rec {
      multi-node k3s cluster on a single machine using docker.
    '';
    license = licenses.mit;
    maintainers = with maintainers; [ kuznero jlesquembre ngerstle jk ricochet ];
    maintainers = with maintainers; [
      kuznero
      jlesquembre
      ngerstle
      jk
      ricochet
    ];
    platforms = platforms.linux ++ platforms.darwin;
  };
}