Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions internal/containerztest/containerztest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package containerztest

Check failure on line 15 in internal/containerztest/containerztest.go

View workflow job for this annotation

GitHub Actions / Static Analysis

should have a package comment

import (
"context"
Expand Down Expand Up @@ -242,15 +242,25 @@
t.Helper()
t.Logf("Attempting to stop container %s", instNameToStop)
if err := cli.StopContainer(ctx, instNameToStop, true); err != nil {
s, _ := status.FromError(err)
if s.Code() == codes.NotFound {
if status.Code(err) == codes.NotFound {
t.Logf("StopContainer: Container %s not found (may have already been stopped and removed): %v", instNameToStop, err)
} else {
t.Logf("StopContainer for %s encountered an issue: %v", instNameToStop, err)
}
} else {
t.Logf("Container %s stopped successfully.", instNameToStop)
}

t.Logf("Attempting to remove container %s", instNameToStop)
if err := cli.RemoveContainer(ctx, instNameToStop, true); err != nil {
if status.Code(err) == codes.NotFound {
t.Logf("RemoveContainer: Container %s not found (may have already been removed): %v", instNameToStop, err)
} else {
t.Logf("RemoveContainer for %s encountered an issue: %v", instNameToStop, err)
}
} else {
Comment thread
prathapcv marked this conversation as resolved.
t.Logf("Container %s removed successfully.", instNameToStop)
}
}

// WaitForRunning polls until a container instance is in the RUNNING state.
Expand Down
Loading