@@ -339,6 +339,14 @@ func (r *AzureResourceGraphReconciler) getReconcilersDataFromChildKalypsoObjects
339339 return nil , err
340340 }
341341 }
342+ var environmentName string
343+ var workspace string
344+ var application string
345+ var workloadName string
346+ var deploymentTargetName string
347+
348+ workspace = os .Getenv ("WORKSPACE" )
349+ application = os .Getenv ("APPLICATION" )
342350
343351 fluxConfigurationDetal := res .FluxConfiguration
344352 // iteretae over the statuses and log them
@@ -347,17 +355,20 @@ func (r *AzureResourceGraphReconciler) getReconcilersDataFromChildKalypsoObjects
347355 continue
348356 }
349357
350- //TODO Update Kalypso: name deployment target as workload.deploymentTarget or without workload at all
351358 // expected flux resource name format: env.workspace.application.workload.deploymentTarget[.clusterType]
352359 nameParts := strings .Split (* status .Name , "." )
353- if len (nameParts ) < 5 {
354- continue
360+
361+ if len (nameParts ) >= 5 {
362+ environmentName = nameParts [0 ]
363+ workspace = nameParts [1 ]
364+ application = nameParts [2 ]
365+ workloadName = nameParts [3 ]
366+ deploymentTargetName = nameParts [4 ]
367+ } else if len (nameParts ) >= 3 {
368+ environmentName = nameParts [0 ]
369+ workloadName = nameParts [1 ]
370+ deploymentTargetName = nameParts [2 ]
355371 }
356- environmentName := nameParts [0 ]
357- workspace := nameParts [1 ]
358- application := nameParts [2 ]
359- workloadName := nameParts [3 ]
360- deploymentTargetName := nameParts [4 ]
361372
362373 dt , err := storageClient .GetDeploymentTarget (ctx , & pb.DeploymentTargetSearch {
363374 WorkloadName : workloadName ,
0 commit comments