Skip to content

Commit

Permalink
Skip empty ingresses (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
shurshun authored Sep 10, 2024
1 parent b8d2d0d commit e9cd437
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/harvester/modules/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ func (ch *ClusterHarverster) getDomains() []*types.Domain {
ingress := obj.(*networkingv1.Ingress)

for _, rule := range ingress.Spec.Rules {
if rule.Host == "" {
log.WithFields(log.Fields{
"name": ingress.ObjectMeta.Name,
"action": "skip",
}).Debug("Ingress rule has no host")

continue
}

result = append(result, &types.Domain{
Name: helpers.EffectiveTLDPlusOne(rule.Host),
DisplayName: helpers.ToUnicode(helpers.EffectiveTLDPlusOne(rule.Host)),
Expand Down

0 comments on commit e9cd437

Please sign in to comment.