Add workaround for setting correct mcp_version for offline image
Change-Id: I9638719b70132ceb3d2f6c2aee72a4dc48d833d9
diff --git a/packer-image-buid.groovy b/packer-image-buid.groovy
index d608188..c7bd0e5 100644
--- a/packer-image-buid.groovy
+++ b/packer-image-buid.groovy
@@ -156,6 +156,13 @@
extensions : [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'config-drive/model']],
userRemoteConfigs : [[url: model, refspec: extra_vars.get('CLUSTER_MODEL_REF', 'master'), credentialsId: gerritCredentials]]
])
+
+ def clusterName = extra_vars.get('CLUSTER_NAME', '')
+ def mcpVersion = extra_vars.get('MCP_VERSION', '')
+ if (clusterName == 'mcp-offline' && mcpVersion != '') {
+ def filePath = 'classes/cluster/mcp-offline/infra/apt01_dummy.yml'
+ sh "sed -i 's/mcp_version: .*/mcp_version: ${mcpVersion}/' config-drive/model/${filePath}"
+ }
}
def scripts = extra_vars.get('GIT_SALT_FORMULAS_SCRIPTS', '')
if (scripts != "") {