Skip to content

Commit

Permalink
tmp: logger broken sadface
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Sep 1, 2022
1 parent 46d237e commit ae304d4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
10 changes: 10 additions & 0 deletions internal/controllers/configuration/zz_generated_controllers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions internal/controllers/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package utils

import (
"encoding/json"
"fmt"

netv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -26,12 +29,21 @@ func MatchesIngressClass(obj client.Object, controllerIngressClass string, isDef
objectIngressClass := obj.GetAnnotations()[annotations.IngressClassKey]
objectKnativeClass := obj.GetAnnotations()[annotations.KnativeIngressClassKey]
objectKnativeClassAlt := obj.GetAnnotations()[annotations.KnativeIngressClassDeprecatedKey]
jblob, _ := json.Marshal(obj)
fmt.Printf("checking class for: %s\n", string(jblob))
fmt.Printf("objectIngressClass: %s, name: %s/%s\n", objectIngressClass, obj.GetNamespace(), obj.GetName())
if isDefault && IsIngressClassEmpty(obj) {
return true
}
if ing, isV1Ingress := obj.(*netv1.Ingress); isV1Ingress {
if ing.Spec.IngressClassName != nil && *ing.Spec.IngressClassName == controllerIngressClass {
return true
if ing.Spec.IngressClassName != nil {
fmt.Printf("spec.IngressClassName(%s) != nil: %v, name: %s/%s\n",
*ing.Spec.IngressClassName, ing.Spec.IngressClassName != nil, obj.GetNamespace(), obj.GetName())
fmt.Printf("spec.IngressClassName(%s) == controllerIngressClass(%s): %v, name: %s/%s\n",
*ing.Spec.IngressClassName, controllerIngressClass, *ing.Spec.IngressClassName == controllerIngressClass, obj.GetNamespace(), obj.GetName())
if ing.Spec.IngressClassName != nil && *ing.Spec.IngressClassName == controllerIngressClass {
return true
}
}
}

Expand Down

0 comments on commit ae304d4

Please sign in to comment.