refactor(main): unmount override container (#4161) #4208
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(cherry picked from commit 4fed20a)
🤖 Generated by Copilot at e489328
Summary
🔧🗃️🚀
This pull request enhances the handling of
MountImage
instances in thecluster.Status.Mounts
slice by sorting, deduplicating, and appending them. It also simplifies thecluster.FindImage
method and removes thecluster.SetMountImage
method. These changes aim to avoid conflicts or errors when applying the cluster configuration.Walkthrough
cluster.Status.Mounts
slice is consistent and up-to-date with the latestMountImage
instances (link, link)sort
package inpkg/apply/processor/install.go
(link)ImageName
to the index of the last occurrence in the slice and sort the indexes (link)MountImage
instances based on the sorted indexes and assign it to the cluster status (link)MountImage
instance already exists in the slice before appending it and remove the old one if found (link)cluster.FindImage
method to return both the index and the pointer to theMountImage
instance inpkg/types/v1beta1/cluster_args.go
(link)cluster.SetMountImage
method as it is no longer needed (link)