fix(codeartifact): clear managed Reposilite state after teardown (#7078)

Clear managed endpoint and token state only after strict container removal succeeds. Retain ownership on failure for cleanup retry and preserve external endpoints.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
Andre Kurait authored and GitHub committed 2026-10-31 08:45:33 -04:00
1 parent 0de2b7fdd8
commit 01ecd4f8da
2 files changed
+97 -3

No files matched your search

@@ -167,12 +167,16 @@ public class ReposiliteSidecarManager implements ContainerTeardown {
}
@Override
public void stopManagedContainers() {
public synchronized void stopManagedContainers() {
if (containerId == null) {
return;
}
LOG.info("Stopping Reposilite sidecar container");
lifecycleManager.stopAndRemove(containerId, null);
lifecycleManager.stopAndRemoveStrict(containerId, null);
containerId = null;
resolvedUrl = null;
resolvedTokenName = null;
resolvedTokenSecret = null;
}
private static String trimTrailingSlash(String url) {