Bug 1749581 - IngressController resource's scale subresource has incorrect label selector path
Summary: IngressController resource's scale subresource has incorrect label selector path
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.2.0
Assignee: Miciah Dashiel Butler Masters
QA Contact: Hongan Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-05 22:38 UTC by Miciah Dashiel Butler Masters
Modified: 2022-08-04 22:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:40:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Go program that uses client-go to get the default ingresscontroller's scale subresource and prints the label selector path (1.12 KB, text/plain)
2019-09-05 22:42 UTC, Miciah Dashiel Butler Masters
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift api pull 425 0 None closed Bug 1749581: operator/ingress: Fix scale kubebuilder marker 2020-08-11 21:20:52 UTC
Github openshift cluster-ingress-operator pull 296 0 None closed Bug 1749581: Fix scale subresource's label selector path; set default ingresscontroller's replicas to non-nil 2020-08-11 21:20:52 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:40:43 UTC

Description Miciah Dashiel Butler Masters 2019-09-05 22:38:57 UTC
Description of problem:

The IngressController custom resource definition (CRD) specifies an incorrect label selector path in the scale subresource.  As a consequence, clients will see an empty value for the label selector on the scale subresource.


Version-Release number of selected component (if applicable):
4.1 and 4.2.


How reproducible:
100%.


Steps to Reproduce:

Run the following command while logged in to a v4 cluster:

     oc get --raw /apis/operator.openshift.io/v1/namespaces/openshift-ingress-operator/ingresscontrollers/default/scale | jq .

Alternatively, run the attached Go program, which uses the scale client from client-go to get the default ingresscontroller's scale resource and prints the label selector.


Actual results:

    % go run scale-test.go
    scale status.selector: ""
    % oc get --raw /apis/operator.openshift.io/v1/namespaces/openshift-ingress-operator/ingresscontrollers/default/scale | jq .
    {
      "kind": "Scale",
      "apiVersion": "autoscaling/v1",
      "metadata": {
        "name": "default",
        "namespace": "openshift-ingress-operator",
        "selfLink": "/apis/operator.openshift.io/v1/namespaces/openshift-ingress-operator/ingresscontrollers/default/scale",
        "uid": "15c66196-d016-11e9-b1af-42010a000004",
        "resourceVersion": "35527",
        "creationTimestamp": "2019-09-05T19:48:08Z"
      },
      "spec": {
        "replicas": 2
      },
      "status": {
        "replicas": 2
      }
    }
    % 


Expected results:

    % go run scale-test.go
    scale status.selector: "ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default"
    % oc get --raw /apis/operator.openshift.io/v1/namespaces/openshift-ingress-operator/ingresscontrollers/default/scale | jq .
    {
      "kind": "Scale",
      "apiVersion": "autoscaling/v1",
      "metadata": {
        "name": "default",
        "namespace": "openshift-ingress-operator",
        "selfLink": "/apis/operator.openshift.io/v1/namespaces/openshift-ingress-operator/ingresscontrollers/default/scale",
        "uid": "15c66196-d016-11e9-b1af-42010a000004",
        "resourceVersion": "35527",
        "creationTimestamp": "2019-09-05T19:48:08Z"
      },
      "spec": {
        "replicas": 2
      },
      "status": {
        "replicas": 2,
        "selector": "ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default"
      }
    }
    % 


Additional info:

The label selector path will need to be fixed for the horizontal pod autoscaler (HPA).  I am not aware of anything else that the incorrect path could break.

Comment 1 Miciah Dashiel Butler Masters 2019-09-05 22:42:51 UTC
Created attachment 1612093 [details]
Go program that uses client-go to get the default ingresscontroller's scale subresource and prints the label selector path

Comment 3 Hongan Li 2019-09-17 02:44:59 UTC
verified with 4.2.0-0.nightly-2019-09-15-052022 and issue has been fixed.

$ oc get --raw /apis/operator.openshift.io/v1/namespaces/openshift-ingress-operator/ingresscontrollers/default/scale | jq .
{
  "kind": "Scale",
  "apiVersion": "autoscaling/v1",
  "metadata": {
    "name": "default",
    "namespace": "openshift-ingress-operator",
    "selfLink": "/apis/operator.openshift.io/v1/namespaces/openshift-ingress-operator/ingresscontrollers/default/scale",
    "uid": "80d8539f-d81d-11e9-ab02-000d3a979766",
    "resourceVersion": "13689",
    "creationTimestamp": "2019-09-16T01:01:23Z"
  },
  "spec": {
    "replicas": 2
  },
  "status": {
    "replicas": 2,
    "selector": "ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default"
  }
}

Comment 5 errata-xmlrpc 2019-10-16 06:40:35 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


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