|
2 | 2 | (:require [clj-yaml.core :as yaml]
|
3 | 3 | [clojure.string :as str]
|
4 | 4 | [clojure.tools.logging :refer [info]]
|
| 5 | + [environ.core :refer [env]] |
5 | 6 | [jepsen
|
6 | 7 | [control :as c]
|
7 | 8 | [db :as db]]
|
8 | 9 | [scalardb.nemesis.cluster :as n])
|
9 | 10 | (:import (java.io File)))
|
10 | 11 |
|
11 |
| -(def ^:private ^:const DEFAULT_VERSION "3.14.0") |
12 | 12 | (def ^:private ^:const CLUSTER_VALUES_YAML "scalardb-cluster-custom-values.yaml")
|
13 | 13 | (def ^:private ^:const DEFAULT_CHAOS_MESH_VERSION "2.7.1")
|
14 | 14 |
|
|
58 | 58 | (c/exec :helm :repo :add
|
59 | 59 | "scalar-labs" "https://scalar-labs.github.io/helm-charts")
|
60 | 60 | ;; Chaos mesh
|
61 |
| - (c/exec :helm :repo :add "chaos-mesh" "https://charts.chaos-mesh.org")) |
| 61 | + (c/exec :helm :repo :add "chaos-mesh" "https://charts.chaos-mesh.org") |
| 62 | + |
| 63 | + (c/exec :helm :repo :update)) |
62 | 64 |
|
63 | 65 | (defn- configure!
|
64 | 66 | [test]
|
|
98 | 100 | :--set "primary.service.type=LoadBalancer")
|
99 | 101 |
|
100 | 102 | ;; ScalarDB cluster
|
101 |
| - (let [chart-version (->> (c/exec :helm :search |
| 103 | + (let [version (env :scalardb-cluster-version) |
| 104 | + chart-version (->> (c/exec :helm :search |
102 | 105 | :repo "scalar-labs/scalardb-cluster" :-l)
|
103 | 106 | str/split-lines
|
104 |
| - (filter #(str/includes? % DEFAULT_VERSION)) |
| 107 | + (filter #(str/includes? % version)) |
105 | 108 | (map #(nth (str/split % #"\s+") 1))
|
106 | 109 | (sort #(compare %2 %1))
|
107 | 110 | first)]
|
|
129 | 132 | seq
|
130 | 133 | (apply c/exec :rm :-f)))
|
131 | 134 | (info "wiping the pods...")
|
132 |
| - (c/exec :helm :uninstall :scalardb-cluster :postgresql-scalardb-cluster) |
| 135 | + (c/exec :helm :uninstall :postgresql-scalardb-cluster) |
| 136 | + (c/exec :helm :uninstall :scalardb-cluster) |
133 | 137 | (c/exec :helm :uninstall :chaos-mesh :-n "chaos-mesh")
|
134 | 138 | (catch Exception _ nil)))
|
135 | 139 |
|
|
0 commit comments