Bug 1669081 - [Cloud-CA] Failed to delete machineautoscaler if related machineset doesn't exist
Summary: [Cloud-CA] Failed to delete machineautoscaler if related machineset doesn't e...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.1.0
Assignee: Brad Ison
QA Contact: sunzhaohua
Depends On:
TreeView+ depends on / blocked
Reported: 2019-01-24 09:44 UTC by sunzhaohua
Modified: 2019-06-04 10:42 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2019-06-04 10:42:08 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:42:23 UTC

Description sunzhaohua 2019-01-24 09:44:59 UTC
Description of problem:
Failed to delete machineautoscaler if related machineset doesn't exist.

Version-Release number of selected component (if applicable):
clusterversion: 4.0.0-0.alpha-2019-01-24-003716

How reproducible:

Steps to Reproduce:
1. Create a machineautoscaler which targets a node group zhsun-worker-us-east-2c
apiVersion: autoscaling.openshift.io/v1alpha1
kind: MachineAutoscaler
  - machinetarget.autoscaling.openshift.io
  name: autoscale-us-east-2c
  namespace: openshift-cluster-api
  maxReplicas: 3
  minReplicas: 1
    apiVersion: cluster.k8s.io/v1alpha1
    kind: MachineSet
    name: worker-us-east-2a
status: {}
2. Delete machineset zhsun-worker-us-east-2c
3. Delete machineautoscaler
4. Check logs

Actual results:
Machineautoscaler couldn't be deleted.

$ oc get machineautoscaler
NAME                     REF KIND     REF NAME                  MIN       MAX       AGE
autoscale-us-east-2a     MachineSet   zhsun-worker-us-east-2a   1         2         1h
autoscale-us-east-2b     MachineSet   zhsun-worker-us-east-2b   1         2         1h
autoscale-us-east-2c     MachineSet   zhsun-worker-us-east-2c   1         2         3h

$ oc get machineset
NAME                      DESIRED   CURRENT   READY     AVAILABLE   AGE
zhsun-worker-us-east-2a   1         1         1         1           6h
zhsun-worker-us-east-2b   1         1         1         1           6h
zhsun-worker-us-east-2c   1         1         1         1           6h

$ oc delete machineset zhsun-worker-us-east-2c
machineset.cluster.k8s.io "zhsun-worker-us-east-2c" deleted

$ oc delete machineautoscaler autoscale-us-east-2c
machineautoscaler.autoscaling.openshift.io "autoscale-us-east-2c" deleted

$ oc logs -f cluster-autoscaler-operator-8684bc9f5c-xnb57
I0123 10:00:30.193001       1 machineautoscaler_controller.go:102] Reconciling MachineAutoscaler openshift-cluster-api/autoscale-us-east-2c
E0123 10:00:30.197162       1 machineautoscaler_controller.go:123] Error getting target: machinesets.cluster.k8s.io "zhsun-worker-us-east-2c" not found

Expected results:
Machineautoscaler could be deleted.

Additional info:

Comment 1 Brad Ison 2019-01-30 09:38:27 UTC
This should be fixed by: https://github.com/openshift/cluster-autoscaler-operator/pull/33

Not-found errors no longer cause the finalizer to fail.

Comment 2 sunzhaohua 2019-02-02 05:49:07 UTC

$ oc delete machineset zhsun-worker-us-east-2a-a
machineset.cluster.k8s.io "zhsun-worker-us-east-2a-a" deleted

$ oc get machineautoscaler
NAME                   REF KIND     REF NAME                    MIN       MAX       AGE
autoscale-us-east-2a   MachineSet   zhsun-worker-us-east-2a-a   1         5         35s

$ oc delete machineautoscaler autoscale-us-east-2a
machineautoscaler.autoscaling.openshift.io "autoscale-us-east-2a" deleted

Comment 5 errata-xmlrpc 2019-06-04 10:42:08 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.


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