Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Conversation

@ejalberti
Copy link
Contributor

In execution time, if the controller-manager tries to update the list of customDevices on the powerNode, the update strategy fails with the message: "Operation cannot be fulfilled on powernodes.power.intel.com: the object has been modified; please apply your changes to the latest version and try again."

This commit changes the update strategy to a merge-patch command, avoiding an issue during the power node update.

In execution time, if the controller-manager tries to update the list of
customDevices on the powerNode, the update strategy fails with the message:
"Operation cannot be fulfilled on powernodes.power.intel.com: the object
has been modified; please apply your changes to the latest version and
try again."

This commit changes the update strategy to a merge-patch command, avoiding
an issue during the power node update.

Signed-off-by: Eduardo Juliano Alberti <eduardo.alberti@windriver.com>
Copy link
Contributor

@madalazar madalazar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to bring this commit internally & have more people review it - for more awareness + transparency.
I think we also need to check the unit tests

Comment on lines +244 to +245
patch := client.MergeFrom(powerNode.DeepCopy())
err = r.Client.Status().Patch(context.TODO(), powerNode, patch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I could understand with the way the Patch call is written we won't be running with optimistic locking which means we'd be overriding the customDevices field without trying to reconcile what's in etcd.
I'm a bit torn whether this particular call is the right thing to do.
Powernodes don't seem the powerconfig's main responsibility so I don't think it should be updating the customDevices field like that. I'd prefer to get into conflicts and trigger as many reconciler loops as needed to solve the conflict.
Now, on the other side, this is the only place (for the moment) where we update the powernode's customDevices field so there are no issues of concurrent updating.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants