Skip to content

Comments

Handle deleting of server maintenance#371

Closed
SzymonSAP wants to merge 2 commits intomainfrom
owner-ref
Closed

Handle deleting of server maintenance#371
SzymonSAP wants to merge 2 commits intomainfrom
owner-ref

Conversation

@SzymonSAP
Copy link
Contributor

When BiosSettings cr is removed a ServerMaintenance cr should also be removed. Currently it is handled by owner reference but this solution doesn't work because BiosSettings is a cluster scoped resource and ServerMaintenance is namespaced resource. This commit introduces deleting ServerMaintenance when BiosSettings is deleted in a reconcile function. It also changes owning to watching of ServerMaintenance by BiosSettings controller.

Proposed Changes

Fixes #

When BiosSettings cr is removed a ServerMaintenance cr should also be
removed. Currently it is handled by owner reference but this solution
doesn't work because BiosSettings is a cluster scoped resource and
ServerMaintenance is namespaced resource. This commit introduces
deleting ServerMaintenance when BiosSettings is deleted in a reconcile
function. It also changes owning to watching of ServerMaintenance by
BiosSettings controller.
@Nuckal777
Copy link
Contributor

Could you add/adjust a test to check that the explicit deletion is working?

@nagadeesh-nagaraja
Copy link
Contributor

nagadeesh-nagaraja commented Jun 23, 2025

The bios Settings should not be deleted while in progress. ( this will be handled using webhook and in deletion logic)
PRs are in review.
#322 (webhook to not delete inProgress biosettings)
#351 ( not to delete (continue reconcile) BIOSSettings when in Progress)

@SzymonSAP
Copy link
Contributor Author

The bios Settings should not be deleted while in progress. ( this will be handled using webhook and in deletion logic) PRs are in review. #322 (webhook to not delete inProgress biosettings) #351 ( not to delete (continue reconcile) BIOSSettings when in Progress)

I see, but does it impact this PR? Here I delete ServerMaintenance not BiosSettings and logic from #351 can be merged before deleting ServerMaintenance.

@nagadeesh-nagaraja
Copy link
Contributor

The bios Settings should not be deleted while in progress. ( this will be handled using webhook and in deletion logic) PRs are in review. #322 (webhook to not delete inProgress biosettings) #351 ( not to delete (continue reconcile) BIOSSettings when in Progress)

I see, but does it impact this PR? Here I delete ServerMaintenance not BiosSettings and logic from #351 can be merged before deleting ServerMaintenance.

This diff will not affect the other diffs, but I am afraid that this might introduce issues.
Example.
Consider the situation that the BIOSSettings has failed and the server is in messed up state. if you delete the BIOSSettings and then that deletes the serverMaintenance. The system will go back to Available/Reserved state even though it is totally messed up.

current behavior is not like that. In Failed state, the maintenance is not removed, so if I delete the BiosSettings, the server is still in Maintenance and that will give a chance to fix or revert the changes before moving the server out of maintenance (or maybe create new BIOSSettings with same maintenance Ref to fix the server).

@SzymonSAP
Copy link
Contributor Author

As discussed with @nagadeesh-nagaraja we don't need to take care of deleting ServerMaintenance when BiosSettings is deleted because we shouldn't delete BiosSettings when maintenance is ongoing and it will be deleted after it is done.

@SzymonSAP SzymonSAP closed this Jun 27, 2025
@github-project-automation github-project-automation bot moved this to Done in Roadmap Jun 27, 2025
@afritzler afritzler deleted the owner-ref branch February 13, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants