Bug 1889863 - Router prints incorrect log message for namespace label selector
Summary: Router prints incorrect log message for namespace label selector
Keywords:
Status: VERIFIED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Routing
Version: 4.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.7.0
Assignee: Miciah Dashiel Butler Masters
QA Contact: Hongan Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-20 18:06 UTC by Miciah Dashiel Butler Masters
Modified: 2020-11-12 06:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift router pull 204 None closed Bug 1889863: Fix logging of namespace label selector 2020-11-12 06:44:37 UTC

Description Miciah Dashiel Butler Masters 2020-10-20 18:06:10 UTC
Description of problem:

When an IngressController specifies a namespace selector, the router pod prints a log message indicating that it will filter namespaces using that selector.  However, the log output does not print the label selector correctly.


Version-Release number of selected component (if applicable):

4.6.0-0.ci-2020-08-06-061328

Most likely introduced in 4.3 by https://github.com/openshift/router/pull/47/commits/dc68ebfcbd9fdc600391ebe050228534dd2b07c3.


How reproducible:

Consistently.


Steps to Reproduce:

1. Launch a 4.6 cluster.

2. On the cluster created in Step 1, create a new IngressController that specifies spec.namespaceSelector:

     oc apply -f - <<'EOF'
     apiVersion: operator.openshift.io/v1
     kind: IngressController
     metadata:
       name: namespace-selector
       namespace: openshift-ingress-operator
     spec:
       replicas: 1
       domain: xyz.com
       endpointPublishingStrategy:
         type: Private
       namespaceSelector:
          matchLabels:
            foo: bar
     EOF

3. Check the logs for a router pod for the IngressController created in Step 2:

    oc -n openshift-ingress logs -c router deployments/router-namespace-selector


Actual results:

The log output prints the label selector incorrectly:

    "msg"="router is only using routes in namespaces matching labels"  "labels"=[{}]


Expected results:

The log output prints the label selector correctly:

    "msg"="router is only using routes in namespaces matching labels"  "labels"="foo=bar"

Comment 2 Hongan Li 2020-11-12 06:55:44 UTC
Verified with 4.7.0-0.nightly-2020-11-11-220947 and issue has been fixed.

# oc -n openshift-ingress logs router-default-87f6699c-5zsrx
<---snip--->
I1112 06:49:31.322770       1 router.go:254] router "msg"="router is only using routes in namespaces matching labels"  "labels"="foo=bar"


Note You need to log in before you can comment on or make changes to this bug.