3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #164463 from superherointj/package-berglas-0.6.2

This commit is contained in:
Sandro 2022-03-16 20:26:08 +01:00 committed by GitHub
commit a1507172bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,19 +1,44 @@
{ lib, buildGoModule, fetchFromGitHub }:
let
skipTests = {
access = "Access";
create = "Create";
delete = "Delete";
list = "List";
read = "Read";
replace = "Replace";
resolver = "Resolve";
revoke = "Revoke";
update = "Update";
};
skipTestsCommand =
builtins.foldl' (acc: goFileName:
let testName = builtins.getAttr goFileName skipTests; in
''
${acc}
substituteInPlace pkg/berglas/${goFileName}_test.go \
--replace "TestClient_${testName}_storage" "SkipClient_${testName}_storage" \
--replace "TestClient_${testName}_secretManager" "SkipClient_${testName}_secretManager"
''
) "" (builtins.attrNames skipTests);
in
buildGoModule rec {
pname = "berglas";
version = "0.5.1";
version = "0.6.2";
src = fetchFromGitHub {
owner = "GoogleCloudPlatform";
repo = pname;
rev = "v${version}";
sha256 = "0y393g36h35zzqyf5b10j6qq2jhvz83j17cmasnv6wbyrb3vnn0n";
sha256 = "sha256-aLsrrK+z080qn7L2zggA8yD+QqLaSRJLTjWQnFKFogQ=";
};
vendorSha256 = null;
vendorSha256 = "sha256-HjZT0jezJzoEvXuzrjoTv/zSex+xDuGoP1h82CIlX14=";
doCheck = false;
postPatch = skipTestsCommand;
meta = with lib; {
description = "A tool for managing secrets on Google Cloud";