2021-01-25 09:26:54 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2019-09-30 14:01:27 +02:00
|
|
|
|
2022-03-16 18:37:53 +01:00
|
|
|
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
|
|
|
|
|
2019-09-30 14:01:27 +02:00
|
|
|
buildGoModule rec {
|
2020-03-14 16:54:07 +01:00
|
|
|
pname = "berglas";
|
2022-03-16 18:37:53 +01:00
|
|
|
version = "0.6.2";
|
2019-09-30 14:01:27 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GoogleCloudPlatform";
|
2020-03-14 16:54:07 +01:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-03-16 18:37:53 +01:00
|
|
|
sha256 = "sha256-aLsrrK+z080qn7L2zggA8yD+QqLaSRJLTjWQnFKFogQ=";
|
2019-09-30 14:01:27 +02:00
|
|
|
};
|
|
|
|
|
2022-03-16 18:37:53 +01:00
|
|
|
vendorSha256 = "sha256-HjZT0jezJzoEvXuzrjoTv/zSex+xDuGoP1h82CIlX14=";
|
2019-09-30 14:01:27 +02:00
|
|
|
|
2022-03-16 18:37:53 +01:00
|
|
|
postPatch = skipTestsCommand;
|
2020-08-04 02:26:27 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-09-30 14:01:27 +02:00
|
|
|
description = "A tool for managing secrets on Google Cloud";
|
2020-03-14 16:54:07 +01:00
|
|
|
homepage = "https://github.com/GoogleCloudPlatform/berglas";
|
2019-09-30 14:01:27 +02:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2020-07-31 05:58:04 +02:00
|
|
|
}
|