diff --git a/rollout/trafficrouting/istio/istio.go b/rollout/trafficrouting/istio/istio.go index 3a2ebc836f..525c806e79 100644 --- a/rollout/trafficrouting/istio/istio.go +++ b/rollout/trafficrouting/istio/istio.go @@ -242,19 +242,36 @@ func (r *Reconciler) reconcileVirtualService(obj *unstructured.Unstructured, vsv } } +<<<<<<< HEAD patches := r.generateVirtualServicePatches(vsvcRouteNames, httpRoutes, vsvcTLSRoutes, tlsRoutes, int64(desiredWeight), additionalDestinations...) +======= + // Generate Patches + patches := r.generateVirtualServicePatches(httpRoutes, tlsRoutes, int64(desiredWeight)) +>>>>>>> 7a15c88a (chore: Fix istio vs reconcile errors) err = patches.patchVirtualService(httpRoutesI, tlsRoutesI) if err != nil { return nil, false, err } - err = unstructured.SetNestedSlice(newObj.Object, httpRoutesI, "spec", Http) - if err != nil { - return newObj, len(patches) > 0, err + // Set HTTP Route Slice + if len(httpRoutes) > 0 { + err = unstructured.SetNestedSlice(newObj.Object, httpRoutesI, "spec", Http) + if err != nil { + return newObj, len(patches) > 0, err + } } +<<<<<<< HEAD if tlsRoutesI != nil { err = unstructured.SetNestedSlice(newObj.Object, tlsRoutesI, "spec", Tls) } +======= + + // Set TLS Route Slice + if len(tlsRoutes) > 0 { + err = unstructured.SetNestedSlice(newObj.Object, tlsRoutesI, "spec", Tls) + } + +>>>>>>> 7a15c88a (chore: Fix istio vs reconcile errors) return newObj, len(patches) > 0, err }