Bug 1733471 - [autoscaler] Update machineautoscaler targetting an invalid machineset should have the original machineset annotation been cleared
Summary: [autoscaler] Update machineautoscaler targetting an invalid machineset should...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.2.0
Assignee: Brad Ison
QA Contact: sunzhaohua
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-26 08:19 UTC by sunzhaohua
Modified: 2019-10-16 06:33 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:33:49 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift cluster-autoscaler-operator pull 113 None None None 2019-08-02 11:50:52 UTC
Red Hat Product Errata RHBA-2019:2922 None None None 2019-10-16 06:33:59 UTC

Description sunzhaohua 2019-07-26 08:19:12 UTC
Description of problem:
If we allow to update machineautoscaler targetting an invalid machineset , then delete the machineautoscaler, the origin machineset annotations still exist.

Version-Release number of selected component (if applicable):
4.2.0-0.nightly-2019-07-25-053632

How reproducible:
Always

Steps to Reproduce:
1. Create a machineautoscaler targetting a valid machineset
apiVersion: autoscaling.openshift.io/v1beta1
kind: MachineAutoscaler
metadata:
  finalizers:
  - machinetarget.autoscaling.openshift.io
  name: machineautoscaler-c
  namespace: openshift-machine-api
spec:
  maxReplicas: 5
  minReplicas: 1
  scaleTargetRef:
    apiVersion: machine.openshift.io/v1beta1
    kind: MachineSet
    name: zhsun1-lpwf6-worker-us-east-2c
    
2. Edit machineautoscaler machineautoscaler-c targetting an invalid machineset
$ oc edit machineautoscaler machineautoscaler-c
apiVersion: autoscaling.openshift.io/v1beta1
kind: MachineAutoscaler
metadata:
  name: machineautoscaler-c
  namespace: openshift-machine-api
spec:
  maxReplicas: 5
  minReplicas: 1
  scaleTargetRef:
    apiVersion: machine.openshift.io/v1beta1
    kind: MachineSet
    name: zhsun1-lpwf6-worker-us-east-2c-invalid

3. Check machineset annotations 

Actual results:
Machineautoscaler targets an invalid group, but the original machineset annotations still exist, the cluster could scale up normally.


$ oc get machineset zhsun1-lpwf6-worker-us-east-2c -o yaml
metadata:
  annotations:
    autoscaling.openshift.io/machineautoscaler: openshift-machine-api/machineautoscaler-c
    machine.openshift.io/cluster-api-autoscaler-node-group-max-size: "5"
    machine.openshift.io/cluster-api-autoscaler-node-group-min-size: "1"


Expected results:
Updatting machineautoscaler targetting an invalid machineset should have the original machineset annotation been cleared.

Additional info:

Comment 2 sunzhaohua 2019-08-06 01:28:01 UTC
Verified

clusterversion: 4.2.0-0.nightly-2019-08-05-223032

1. Create a machineautoscaler targetting a valid machineset    
2. Edit machineautoscaler machineautoscaler-c targetting an invalid machineset
3. Check machineset annotations 

The annotations have been cleared.

Comment 3 errata-xmlrpc 2019-10-16 06:33:49 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.