Skip to content

Commit

Permalink
Fix panic in automatic external traffic handling (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
orishoshan authored Nov 22, 2023
1 parent be54891 commit 8386dfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/operator/controllers/external_traffic/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ func serviceNamesFromIngress(ingress *v1.Ingress) sets.Set[string] {
}

for _, rule := range ingress.Spec.Rules {
for _, path := range rule.HTTP.Paths {
if path.Backend.Service != nil {
serviceNames.Insert(path.Backend.Service.Name)
if rule.HTTP != nil {
for _, path := range rule.HTTP.Paths {
if path.Backend.Service != nil {
serviceNames.Insert(path.Backend.Service.Name)
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"k8s.io/client-go/metadata"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"time"

otterizev1alpha2 "github.com/otterize/intents-operator/src/operator/api/v1alpha2"
"github.com/otterize/intents-operator/src/operator/controllers"
Expand Down Expand Up @@ -119,6 +120,9 @@ func main() {

podName := MustGetEnvVar(operatorconfig.IntentsOperatorPodNameKey)
podNamespace := MustGetEnvVar(operatorconfig.IntentsOperatorPodNamespaceKey)
logrus.SetFormatter(&logrus.JSONFormatter{
TimestampFormat: time.RFC3339,
})
debugLogs := viper.GetBool(operatorconfig.DebugLogKey)

ctrl.SetLogger(logrusr.New(logrus.StandardLogger()))
Expand Down

0 comments on commit 8386dfd

Please sign in to comment.