Bug 1889863 - Router prints incorrect log message for namespace label selector
Summary: Router prints incorrect log message for namespace label selector
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
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: 2022-08-04 22:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:27:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift router pull 204 0 None closed Bug 1889863: Fix logging of namespace label selector 2021-01-20 00:46:38 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:27: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"

Comment 5 errata-xmlrpc 2021-02-24 15:27:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633


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