[VOL-3780] Upgrading per-patchset validation to use the new charts
Change-Id: I1858f22032dd7b00215f3af0b2ffb038d1615cc2
diff --git a/vars/loadToKind.groovy b/vars/loadToKind.groovy
new file mode 100644
index 0000000..520aee2
--- /dev/null
+++ b/vars/loadToKind.groovy
@@ -0,0 +1,29 @@
+// loads all the images tagged as citest on a Kind cluster
+
+def call(Map config) {
+ def defaultConfig = [
+ name: "kind-ci"
+ ]
+
+ if (!config) {
+ config = [:]
+ }
+
+ def cfg = defaultConfig + config
+
+ def images = sh (
+ script: 'docker images -f "reference=**/*citest" --format "{{.Repository}}"',
+ returnStdout: true
+ ).trim()
+
+ def list = images.split("\n")
+
+ for(int i = 0;i<list.size();i++) {
+ def image = list[i]
+ println "Loading image ${image} on Kind cluster ${cfg.name}"
+
+ sh """
+ kind load docker-image ${image}:citest --name ${cfg.name} --nodes ${cfg.name}-worker,${cfg.name}-worker2
+ """
+ }
+}