Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5-internal/helm-test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts: Mark all test resources to be only created while running tests
4 changes: 3 additions & 1 deletion charts/brig/templates/tests/brig-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: Service
metadata:
name: "brig-integration"
annotations:
"helm.sh/hook": test
labels:
app: brig-integration
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Expand All @@ -19,7 +21,7 @@ kind: Pod
metadata:
name: "{{ .Release.Name }}-brig-integration"
annotations:
"helm.sh/hook": test-success
"helm.sh/hook": test
labels:
app: brig-integration
release: {{ .Release.Name }}
Expand Down
2 changes: 2 additions & 0 deletions charts/brig/templates/tests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: "brig-integration"
annotations:
"helm.sh/hook": test
data:
integration.yaml: |
brig:
Expand Down
2 changes: 2 additions & 0 deletions charts/brig/templates/tests/nginz-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ apiVersion: v1
kind: Service
metadata:
name: nginz-integration-http
annotations:
"helm.sh/hook": test
spec:
type: ClusterIP
ports:
Expand Down
2 changes: 2 additions & 0 deletions charts/brig/templates/tests/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: brig-integration-secrets
annotations:
"helm.sh/hook": test
data:
# These "secrets" are only used in tests and are therefore safe to be stored unencrypted
provider-privatekey.pem: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
metadata:
name: "{{ .Release.Name }}-cargohold-integration"
annotations:
"helm.sh/hook": test-success
"helm.sh/hook": test
spec:
volumes:
- name: "cargohold-integration"
Expand Down
2 changes: 2 additions & 0 deletions charts/cargohold/templates/tests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: "cargohold-integration"
annotations:
"helm.sh/hook": test
data:
integration.yaml: |
cargohold:
Expand Down
2 changes: 2 additions & 0 deletions charts/federator/templates/tests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: "federator-integration"
annotations:
"helm.sh/hook": test
data:
integration.yaml: |
federatorInternal:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
metadata:
name: "{{ .Release.Name }}-federator-integration"
annotations:
"helm.sh/hook": test-success
"helm.sh/hook": test
spec:
volumes:
- name: "federator-integration"
Expand Down
2 changes: 2 additions & 0 deletions charts/galley/templates/tests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: "galley-integration"
annotations:
"helm.sh/hook": test
data:
integration.yaml: |
galley:
Expand Down
4 changes: 3 additions & 1 deletion charts/galley/templates/tests/galley-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: Service
metadata:
name: "galley-integration"
annotations:
"helm.sh/hook": test
labels:
app: galley-integration
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Expand All @@ -19,7 +21,7 @@ kind: Pod
metadata:
name: "{{ .Release.Name }}-galley-integration"
annotations:
"helm.sh/hook": test-success
"helm.sh/hook": test
labels:
app: galley-integration
release: {{ .Release.Name }}
Expand Down
2 changes: 2 additions & 0 deletions charts/galley/templates/tests/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: galley-integration-secrets
annotations:
"helm.sh/hook": test
data:
# These "secrets" are only used in tests and are therefore safe to be stored unencrypted
provider-privatekey.pem: |
Expand Down
2 changes: 2 additions & 0 deletions charts/gundeck/templates/tests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: "gundeck-integration"
annotations:
"helm.sh/hook": test
data:
integration.yaml: |
gundeck:
Expand Down
2 changes: 1 addition & 1 deletion charts/gundeck/templates/tests/gundeck-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
metadata:
name: "{{ .Release.Name }}-gundeck-integration"
annotations:
"helm.sh/hook": test-success
"helm.sh/hook": test
spec:
volumes:
- name: "gundeck-integration"
Expand Down
2 changes: 2 additions & 0 deletions charts/spar/templates/tests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: "spar-integration"
annotations:
"helm.sh/hook": test
data:
integration.yaml: |
brig:
Expand Down
2 changes: 1 addition & 1 deletion charts/spar/templates/tests/spar-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Pod
metadata:
name: "{{ .Release.Name }}-spar-integration"
annotations:
"helm.sh/hook": test-success
"helm.sh/hook": test
labels:
app: spar-integration
release: {{ .Release.Name }}
Expand Down
13 changes: 1 addition & 12 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,7 @@ self: super: {
inherit (super) stdenv fetchurl;
};

helm = staticBinaryInTarball {
pname = "helm";
version = "3.6.3";

darwinAmd64Url = "https://get.helm.sh/helm-v3.6.3-darwin-amd64.tar.gz";
darwinAmd64Sha256 = "0djjvgla8cw27h8s4y6jby19f74j58byb2vfv590cd03vlbzz8c4";

linuxAmd64Url = "https://get.helm.sh/helm-v3.6.3-linux-amd64.tar.gz";
linuxAmd64Sha256 = "0qp28fq137b07haz4vsdbc5biagh60dcs29jj70ksqi5k6201h87";

inherit (super) stdenv fetchurl;
};
helm = super.callPackage ./pkgs/helm {};

helmfile = staticBinary {
pname = "helmfile";
Expand Down
52 changes: 52 additions & 0 deletions nix/pkgs/helm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copied from nixpkgs and modified because it seems too complicated to override
# buildGoModule packages.
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:

buildGoModule rec {
pname = "kubernetes-helm";
version = "3.11.0-patched";

src = fetchFromGitHub {
owner = "wireapp";
repo = "helm";
rev = "949de3195be5b3d21ed707da18ee3bcb2a9a2af8";
sha256 = "sha256-alyR6+gm7WEvFfJxHl9a0jpC3+457Kg6aRHcidA0RZg=";
};
vendorSha256 = "sha256-LRMDrBSl5EGQqQt5FUU4JJHqdwfYt5qsVpe76jUQBVI=";

subPackages = [ "cmd/helm" ];
ldflags = [
"-w"
"-s"
"-X helm.sh/helm/v3/internal/version.version=v${version}"
"-X helm.sh/helm/v3/internal/version.gitCommit=${src.rev}"
];

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
substituteInPlace cmd/helm/plugin_test.go \
--replace "TestPluginDynamicCompletion" "SkipPluginDynamicCompletion" \
--replace "TestLoadPlugins" "SkipLoadPlugins"
substituteInPlace cmd/helm/helm_test.go \
--replace "TestPluginExitCode" "SkipPluginExitCode"
'';

nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$out/bin/helm completion bash > helm.bash
$out/bin/helm completion zsh > helm.zsh
installShellCompletion helm.{bash,zsh}
'';

meta = with lib; {
homepage = "https://github.com/kubernetes/helm";
description = "A package manager for kubernetes";
mainProgram = "helm";
license = licenses.asl20;
maintainers = with maintainers; [ rlupton20 edude03 saschagrunert Frostman Chili-Man techknowlogick ];
};
}
3 changes: 2 additions & 1 deletion nix/wire-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ let
pkgs.ormolu
pkgs.shellcheck
pkgs.treefmt
pkgs.gawk
pkgs.cfssl
(hlib.justStaticExecutables pkgs.haskellPackages.cabal-fmt)
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.skopeo
Expand Down Expand Up @@ -365,7 +367,6 @@ in
paths = commonTools ++ [
(pkgs.haskell-language-server.override { supportedGhcVersions = [ "92" ]; })
pkgs.ghcid
pkgs.cfssl
pkgs.kind
pkgs.netcat
pkgs.niv
Expand Down