@@ -54,6 +54,7 @@ private const val VOLUME_TEMP_PATH = "/usr/tmp"
5454internal const val CSM_ARGO_WORKFLOWS_TIMEOUT = 28800
5555internal const val ALWAYS_PULL_POLICY = " Always"
5656
57+ @Suppress(" LongMethod" )
5758internal fun buildTemplate (
5859 organizationId : String ,
5960 workspaceId : String? ,
@@ -74,8 +75,8 @@ internal fun buildTemplate(
7475 listOf (
7576 V1VolumeMount ()
7677 .name(" coal-config" )
77- .mountPath(VOLUME_COAL_PATH )
78- .subPath(VOLUME_COAL_PATH + " / " + " ${organizationId} - ${workspaceId} - coal-config" )
78+ .mountPath(VOLUME_COAL_PATH + " /coal-config.toml " )
79+ .subPath(" coal-config.toml " )
7980 )
8081 val secretVolumeMount =
8182 csmPlatformProperties.argo.workflows.secrets.map { secret ->
@@ -100,14 +101,11 @@ internal fun buildTemplate(
100101 .mountPath(VOLUME_TEMP_PATH )
101102 .subPath(VOLUME_CLAIM_TEMP_SUBPATH ),
102103 )
103-
104104 val volumeMounts = normalVolumeMount + secretVolumeMount + configMapMount
105105
106106 val sizingInfo = runContainer.runSizing ? : BASIC_SIZING .toContainerResourceSizing()
107-
108107 val imagePullPolicy =
109108 if (alwaysPull) ALWAYS_PULL_POLICY else csmPlatformProperties.argo.imagePullPolicy
110-
111109 val container =
112110 buildContainer(
113111 runContainer,
@@ -118,7 +116,6 @@ internal fun buildTemplate(
118116 organizationId,
119117 workspaceId,
120118 )
121-
122119 if (runContainer.entrypoint != null ) {
123120 container.command(listOf (runContainer.entrypoint))
124121 }
@@ -128,7 +125,6 @@ internal fun buildTemplate(
128125 .name(runContainer.name.lowercase())
129126 .metadata(IoArgoprojWorkflowV1alpha1Metadata ().labels(runContainer.labels))
130127 .container(container)
131-
132128 if (csmPlatformProperties.argo.workflows.ignoreNodeSelector == false ) {
133129 template = template.nodeSelector(runContainer.getNodeLabelSize())
134130 }
@@ -173,6 +169,7 @@ private fun buildContainer(
173169 )
174170}
175171
172+ @Suppress(" LongMethod" )
176173internal fun buildWorkflowSpec (
177174 organizationId : String ,
178175 workspaceId : String? ,
@@ -208,8 +205,11 @@ internal fun buildWorkflowSpec(
208205 .name(" coal-config" )
209206 .configMap(
210207 V1ConfigMapVolumeSource ()
211- .name(" ${organizationId} -${workspaceId} -coal-config" )
212208 .optional(true )
209+ .name(" ${organizationId} -${workspaceId} -coal-config" )
210+ .addItemsItem(
211+ V1KeyToPath ().key(" coal-config.toml" ).path(" coal-config.toml" )
212+ )
213213 )
214214 )
215215
0 commit comments