Bug 1740595

Summary: [upgrade] servicemonitor for ingress is not updated after upgrading from 4.1.11 to 4.2
Product: OpenShift Container Platform Reporter: Hongan Li <hongli>
Component: NetworkingAssignee: Miciah Dashiel Butler Masters <mmasters>
Networking sub component: router QA Contact: Hongan Li <hongli>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aos-bugs
Version: 4.2.0   
Target Milestone: ---   
Target Release: 4.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-16 06:35:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hongan Li 2019-08-13 10:31:22 UTC
Description of problem:
The selector in servicemonitor resource is nil in 4.1 but has been fixed in 4.2. 
After upgrading the cluster from 4.1 to 4.2 and found the selector is still  nil.

Version-Release number of selected component (if applicable):
4.1.11 to 4.2.0-0.nightly-2019-08-08-103722

How reproducible:
100%

Steps to Reproduce:
1. upgrade cluster from 4.1.11 to 4.1.11 to 4.2.0-0.nightly-2019-08-08-103722
2. check servicemonitor

Actual results:

$ oc get servicemonitor router-default -o yaml -n openshift-ingress
<---snip--->
spec:
  endpoints:
  - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
    interval: 30s
    path: /metrics
    port: metrics
    scheme: https
    tlsConfig:
      caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
      serverName: router-internal-default.openshift-ingress.svc
  namespaceSelector:
    matchNames:
    - openshift-ingress
  selector: {}

Expected results:
the selector should not be nil, the correct one looks like:
  selector:
    matchLabels:
      ingresscontroller.operator.openshift.io/owning-ingresscontroller: default

Additional info:

Comment 2 Hongan Li 2019-08-20 05:27:18 UTC
upgrade cluster from 4.1.12 to 4.2.0-0.nightly-2019-08-19-201622 and the issue has been fixed.

$ oc get servicemonitors.monitoring.coreos.com -n openshift-ingress -o yaml
<---snip--->
    selector:
      matchLabels:
        ingresscontroller.operator.openshift.io/owning-ingresscontroller: default
<---snip--->
    selector:
      matchLabels:
        ingresscontroller.operator.openshift.io/owning-ingresscontroller: test

Comment 3 errata-xmlrpc 2019-10-16 06:35:53 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, 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/RHBA-2019:2922