Skip to content

Commit

Permalink
Fix meshPort nil for canary rollout without weights (#200)
Browse files Browse the repository at this point in the history
Signed-off-by: nbn01 <[email protected]>

Co-authored-by: nbn01 <[email protected]>
  • Loading branch information
Nandan B N and nbn01 authored Apr 8, 2022
1 parent 845e7da commit b3183b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admiral/pkg/clusters/serviceentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ func modifyServiceEntryForNewServiceOrPod(event admiral.EventType, env string, s

if len(sourceDeployments) > 0 {
meshPorts = GetMeshPorts(sourceCluster, serviceInstance, sourceDeployments[sourceCluster])
} else {
meshPorts = GetMeshPortsForRollout(sourceCluster, serviceInstance, sourceRollouts[sourceCluster])
}

for key, serviceEntry := range serviceEntries {
Expand All @@ -166,7 +168,6 @@ func modifyServiceEntryForNewServiceOrPod(event admiral.EventType, env string, s
// see if we have weighted services (rollouts with canary strategy)
} else if len(weightedServices) > 1 {
//add one endpoint per each service, may be modify
meshPorts = GetMeshPortsForRollout(sourceCluster, serviceInstance, sourceRollouts[sourceCluster])
var se = copyServiceEntry(serviceEntry)
updateEndpointsForWeightedServices(se, weightedServices, clusterIngress, meshPorts)
AddServiceEntriesWithDr(remoteRegistry.AdmiralCache, map[string]string{sourceCluster: sourceCluster}, remoteRegistry.RemoteControllers,
Expand Down

0 comments on commit b3183b6

Please sign in to comment.