fix(cluster): tolerate partial mesh and cluster state during delete (#52)#57
Merged
Conversation
- writeDNSEntries now inspects the DNS container after writing the new Corefile and skips the kill/start reload if the container is not running; the updated Corefile is loaded when it next starts - previously `docker kill sind-dns` failed with exit 1 against a stopped container, breaking `sind delete cluster` (issue #52) and the symmetric `sind create cluster` path - cluster test mock dispatchers now seed an inspect→running result between the Corefile write and the reload kill
Generalises issue #52: the delete orchestrator now treats already-gone resources and unreachable mesh helpers as warnings instead of fatal errors. A user who has `docker stop`'d, `docker rm`'d, or `docker network rm`'d parts of a cluster between sind invocations can still complete the teardown. - DeleteContainers / DeleteNetwork / DeleteVolumes swallow IsNotFound with a warning; other errors still abort - DeregisterMesh wraps RemoveDNSRecords and RemoveKnownHosts with warn-and-continue; failing to update a torn-down helper is no longer fatal - mesh CleanupMesh's removeContainerIfExists / removeNetworkIfExists / removeVolumeIfExists drop the redundant existence precheck and swallow IsNotFound from the actual remove, closing the TOCTOU window between inspect and rm - redundant `if err := DeregisterMesh(...); err != nil` checks in deleteClusterResources and WorkerRemove are removed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #52.
writeDNSEntriesskips the DNS-container reload when sind-dns is notrunning; the updated Corefile is loaded on next start
DeleteContainers/DeleteNetwork/DeleteVolumesswallowIsNotFound with a warning; non-IsNotFound errors still abort
DeregisterMeshwraps DNS-record and known_hosts removal withwarn-and-continue
CleanupMeshhelpers drop the redundant existence precheck andswallow IsNotFound from the actual remove, closing the TOCTOU window
if err := DeregisterMesh(...); err != nilchecks indeleteClusterResourcesandWorkerRemoveare removed