From be58b0e94e47f6524faa22d6a710e9a568bf66f4 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 29 Apr 2021 16:23:32 -0500 Subject: [PATCH] fix helm test --- .gitignore | 2 +- tests/helm/simple.nix | 45 +++++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index b2be92b..fcfc4a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -result +result* diff --git a/tests/helm/simple.nix b/tests/helm/simple.nix index 89e53cf..8d05044 100644 --- a/tests/helm/simple.nix +++ b/tests/helm/simple.nix @@ -11,22 +11,25 @@ let postgresql = pullImage { imageName = "docker.io/bitnami/postgresql"; imageDigest = "sha256:ec16eb9ff2e7bf0669cfc52e595f17d9c52efd864c3f943f404d525dafaaaf96"; - sha256 = "1idl8amp2jifc71lq8ymyns41d76cnasqbxyaild0gjzlpxmsn9n"; + sha256 = "12jr8pzvj1qglrp7sh857a5mv4nda67hw9si6ah2bl6y1ff19l65"; + finalImageName = "docker.io/bitnami/postgresql"; finalImageTag = "11.7.0-debian-10-r55"; }; postgresqlExporter = pullImage { imageName = "docker.io/bitnami/postgres-exporter"; - imageDigest = "sha256:08ab46104b83834760a5e0329af11de23ccf920b4beffd27c506f34421920313"; - sha256 = "14yw8fp6ja7x1wn3lyw8ws5lc5z9jz54vdc5ad5s7yxjfs0jvk6d"; - finalImageTag = "0.8.0-debian-10-r66"; + imageDigest = "sha256:373ba8ac1892291b4121591d1d933b7f9501ae45b9b8d570d7deb4900f91cfe9"; + sha256 = "0icrqmlj8127jhmiy3vh419cv7hwnw19xdn89hxxyj2l6a1chryh"; + finalImageName = "docker.io/bitnami/postgres-exporter"; + finalImageTag = "0.9.0-debian-10-r43"; }; - minideb = pullImage { - imageName = "docker.io/bitnami/minideb"; - imageDigest = "sha256:2f430acaa0ffd88454ac330a6843840f1e1204007bf92f8ce7b654fd3b558d68"; - sha256 = "1h589digi99jvpdzn3azx4p8hlh7plci04him9vfmx2vfa5zxq4i"; - finalImageTag = "buster"; + bitnamiShell = pullImage { + imageName = "docker.io/bitnami/bitnami-shell"; + imageDigest = "sha256:58ba68e1f1d9a55c1234ae5b439bdcf0de1931e4aa1bac7bd0851b66de14fd97"; + sha256 = "00lmphm3ds17apbmh2m2r7cz05jhp4dc3ynswrj0pbpq0azif4zn"; + finalImageName = "docker.io/bitnami/bitnami-shell"; + finalImageTag = "10"; }; in { imports = [ kubenix.modules.test kubenix.modules.helm kubenix.modules.k8s ]; @@ -37,22 +40,22 @@ in { assertions = [{ message = "should have generated resources"; assertion = - appsv1.StatefulSet ? "app-psql-postgresql-master" && - appsv1.StatefulSet ? "app-psql-postgresql-slave" && + appsv1.StatefulSet ? "app-psql-postgresql-primary" && + appsv1.StatefulSet ? "app-psql-postgresql-read" && corev1.Secret ? "app-psql-postgresql" && corev1.Service ? "app-psql-postgresql-headless" ; } { message = "should have values passed"; - assertion = appsv1.StatefulSet.app-psql-postgresql-slave.spec.replicas == 2; + assertion = appsv1.StatefulSet.app-psql-postgresql-read.spec.replicas == 2; } { message = "should have namespace defined"; assertion = - appsv1.StatefulSet.app-psql-postgresql-master.metadata.namespace == "test"; + appsv1.StatefulSet.app-psql-postgresql-primary.metadata.namespace == "test"; }]; testScript = '' kube.wait_until_succeeds("docker load < ${postgresql}") kube.wait_until_succeeds("docker load < ${postgresqlExporter}") - kube.wait_until_succeeds("docker load < ${minideb}") + kube.wait_until_succeeds("docker load < ${bitnamiShell}") kube.wait_until_succeeds("kubectl apply -f ${config.kubernetes.result}") kube.wait_until_succeeds("PGPASSWORD=postgres ${pkgs.postgresql}/bin/psql -h app-psql-postgresql.test.svc.cluster.local -U postgres -l") ''; @@ -67,24 +70,24 @@ in { chart = helm.fetch { repo = "https://charts.bitnami.com/bitnami"; chart = "postgresql"; - version = "8.6.13"; - sha256 = "pYJuxr5Ec6Yjv/wFn7QAA6vCiVjNTz1mWoexdxwiEzE="; + version = "10.3.8"; + sha256 = "sha256-0hJ5pNIivpXeRal1DwJ2VSD3Yxtw2omOoIYGZKGtu9I="; }; values = { image = { repository = "bitnami/postgresql"; - tag = "10.7.0"; + tag = "11.11.0-debian-10-r71"; pullPolicy = "IfNotPresent"; }; volumePermissions.image = { - repository = "bitnami/minideb"; - tag = "latest"; + repository = "bitnami/bitnami-shell"; + tag = "10"; pullPolicy = "IfNotPresent"; }; metrics.image = { - repository = "wrouesnel/postgres_exporter"; - tag = "v0.4.7"; + repository = "bitnami/postgres-exporter"; + tag = "0.9.0-debian-10-r43"; pullPolicy = "IfNotPresent"; }; replication.enabled = true;