From 293325ea691aeb896167e1332aadbe242ff4b1fc Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Wed, 14 Aug 2024 13:33:08 -0400 Subject: [PATCH] Remove first provider container last (#317) remove first prov container last Signed-off-by: Emily McMullan --- cmd/analyze.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/analyze.go b/cmd/analyze.go index 863becb..cfdd3bd 100644 --- a/cmd/analyze.go +++ b/cmd/analyze.go @@ -2005,7 +2005,8 @@ func (a *analyzeCommand) RmVolumes(ctx context.Context) error { } func (a *analyzeCommand) RmProviderContainers(ctx context.Context) error { - for i := range a.providerContainerNames { + // if multiple provider containers, we need to remove the first created provider container last + for i := len(a.providerContainerNames) - 1; i >= 0; i-- { con := a.providerContainerNames[i] // because we are using the --rm option when we start the provider container, // it will immediately be removed after it stops