Bug 1993159

Summary: [Azure] Instead of updating the spec actuator updates status twice
Product: OpenShift Container Platform Reporter: Mike Fedosin <mfedosin>
Component: Cloud ComputeAssignee: Mike Fedosin <mfedosin>
Cloud Compute sub component: Other Providers QA Contact: sunzhaohua <zhsun>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low    
Version: 4.9   
Target Milestone: ---   
Target Release: 4.9.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: 2021-10-18 17:46:09 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 Mike Fedosin 2021-08-12 13:46:08 UTC
Description of problem:
Currently, if we want to update a machine, the actuator patches its status twice instead of updating just spec and status:

https://github.com/openshift/cluster-api-provider-azure/blob/master/pkg/cloud/azure/actuators/machine_scope.go#L195-L201

There we need to update the spec first

Comment 2 sunzhaohua 2021-08-19 02:42:52 UTC
verified
clusterversion: 4.9.0-0.nightly-2021-08-18-144658

change log level to --v=4, edit machine, check machine-controller logs:
I0819 02:21:00.255042       1 controller.go:174] zhsun-819-vqzbk-worker-centralus3-xhghl: reconciling Machine
I0819 02:21:00.257068       1 actuator.go:208] zhsun-819-vqzbk-worker-centralus3-xhghl: actuator checking if machine exists
I0819 02:21:00.257090       1 machine_scope.go:226] Decoding ProviderConfig from Value
I0819 02:21:00.574763       1 reconciler.go:394] Provisioning state is 'Succeeded' for machine zhsun-819-vqzbk-worker-centralus3-xhghl
I0819 02:21:00.574794       1 controller.go:297] zhsun-819-vqzbk-worker-centralus3-xhghl: reconciling machine triggers idempotent update
I0819 02:21:00.574803       1 actuator.go:168] Updating machine zhsun-819-vqzbk-worker-centralus3-xhghl
I0819 02:21:00.574812       1 machine_scope.go:226] Decoding ProviderConfig from Value
I0819 02:21:00.755327       1 machine_scope.go:156] zhsun-819-vqzbk-worker-centralus3-xhghl: status unchanged
I0819 02:21:00.755446       1 machine_scope.go:148] Storing machine spec for "zhsun-819-vqzbk-worker-centralus3-xhghl", resourceVersion: 43840, generation: 4
I0819 02:21:00.755460       1 machine_scope.go:172] zhsun-819-vqzbk-worker-centralus3-xhghl: patching machine

Comment 5 errata-xmlrpc 2021-10-18 17:46:09 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.9.0 bug fix and security 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-2021:3759