Append kubernetes image to overwrite file if specified

Change-Id: I83c3d24162f5582aa72de7d40a0f4b60726bd9fb
diff --git a/lab-pipeline.groovy b/lab-pipeline.groovy
index 596b15f..23d3443 100644
--- a/lab-pipeline.groovy
+++ b/lab-pipeline.groovy
@@ -35,6 +35,9 @@
  *
  *   TEMPEST_IMAGE_LINK         Tempest image link
  *
+ * optional parameters for overwriting soft params
+ *   KUBERNETES_HYPERKUBE_IMAGE  Docker repository and tag for hyperkube image
+ *
  */
 
 git = new com.mirantis.mk.Git()
@@ -42,6 +45,7 @@
 salt = new com.mirantis.mk.Salt()
 common = new com.mirantis.mk.Common()
 test = new com.mirantis.mk.Test()
+overwriteFile = "/srv/salt/reclass/classes/cluster/overwrite.yml"
 
 timestamps {
     node {
@@ -174,6 +178,11 @@
                 stage('Install Kubernetes infra') {
                     //orchestrate.installOpenstackMcpInfra(saltMaster)
 
+                    // Overwrite Kubernetes vars if specified
+                    if (env.getEnvironment().containsKey("KUBERNETES_HYPERKUBE_IMAGE")) {
+                      salt.runSaltProcessStep(master, 'I@salt:master', 'file.append', overwriteFile, "  kubernetes_hyperkube_image: ${KUBERNETES_HYPERKUBE_IMAGE}")
+                    }
+
                     // Install glusterfs
                     salt.runSaltProcessStep(saltMaster, 'I@glusterfs:server', 'state.sls', ['glusterfs.server.service'])