Skip to content

Commit

Permalink
fix: svcexp waiting for app ns, index out of range during gw recycle
Browse files Browse the repository at this point in the history
Signed-off-by: Mridul Gain <[email protected]>
  • Loading branch information
mridulgain committed Nov 26, 2024
1 parent 2fd8592 commit 426a5ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/serviceexport/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func isValidNameSpace(ns string, slice *kubeslicev1beta1.Slice) bool {
if ns == fmt.Sprintf(sliceController.VPC_NS_FMT, slice.Name) {
return true
}
return arrayContainsString(slice.Status.ApplicationNamespaces, ns)
return arrayContainsString(slice.Status.SliceConfig.NamespaceIsolationProfile.ApplicationNamespaces, ns)
}

// Setup ServiceExport Reconciler
Expand Down
3 changes: 3 additions & 0 deletions controllers/slicegateway/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ func GetPodForGwDeployment(ctx context.Context, c client.Client, depName string)
if err := c.List(ctx, &podList, listOpts...); err != nil {
return nil, err
}
if len(podList.Items) == 0 {
return nil, fmt.Errorf("No pods found with matching labels")
}

return &podList.Items[0], nil
}
Expand Down

0 comments on commit 426a5ae

Please sign in to comment.