Skip to content

Commit

Permalink
Format CLUSTERS variable according to SDD. (#301)
Browse files Browse the repository at this point in the history
Replaces separator `,` by space (` `).

https://syn.tools/syn/SDDs/0032-compile-pipeline.html
  • Loading branch information
bastjan authored Jul 31, 2024
1 parent 9021eaf commit 2279641
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/tenant_compile_pipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (r *TenantCompilePipelineReconciler) ensureCiVariables(t *synv1alpha1.Tenan
if pipelineStatus == nil {
pipelineStatus = &synv1alpha1.CompilePipelineStatus{}
}
clusterList := strings.Join(pipelineStatus.Clusters, ",")
clusterList := strings.Join(pipelineStatus.Clusters, " ")

list, ch := updateEnvVarValue(CI_VARIABLE_API_URL, r.ApiUrl, template.CIVariables)
changed = ch
Expand Down
6 changes: 3 additions & 3 deletions controllers/tenant_compile_pipeline_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Test_AddBasicPipelineStatus(t *testing.T) {
assert.Equal(t, "token", mod_tenant.GetGitTemplate().CIVariables[i].ValueFrom.SecretKeyRef.Key)
i = envVarIndex("CLUSTERS", &mod_tenant.GetGitTemplate().CIVariables)
assert.True(t, i >= 0)
assert.Equal(t, "c-cluster1,c-cluster2", mod_tenant.GetGitTemplate().CIVariables[i].Value)
assert.Equal(t, "c-cluster1 c-cluster2", mod_tenant.GetGitTemplate().CIVariables[i].Value)
}
func Test_RemoveBasicPipelineStatus(t *testing.T) {
tenant := &synv1alpha1.Tenant{
Expand Down Expand Up @@ -168,7 +168,7 @@ func Test_UpdateBasicPipelineStatus(t *testing.T) {
assert.Equal(t, "token", mod_tenant.GetGitTemplate().CIVariables[i].ValueFrom.SecretKeyRef.Key)
i = envVarIndex("CLUSTERS", &mod_tenant.GetGitTemplate().CIVariables)
assert.True(t, i >= 0)
assert.Equal(t, "c-cluster1,c-cluster2", mod_tenant.GetGitTemplate().CIVariables[i].Value)
assert.Equal(t, "c-cluster1 c-cluster2", mod_tenant.GetGitTemplate().CIVariables[i].Value)
}

func Test_UpdateBasicPipelineStatus_NoUpdate_IfNoChanges(t *testing.T) {
Expand Down Expand Up @@ -200,7 +200,7 @@ func Test_UpdateBasicPipelineStatus_NoUpdate_IfNoChanges(t *testing.T) {
},
{
Name: "CLUSTERS",
Value: "c-cluster1,c-cluster2",
Value: "c-cluster1 c-cluster2",
},
},
},
Expand Down

0 comments on commit 2279641

Please sign in to comment.