mirror of
https://github.com/containers/skopeo.git
synced 2025-08-01 23:07:51 +00:00
Use slices.Backward
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
f745bb46bc
commit
1f49b2c0c0
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -253,10 +254,10 @@ func (cluster *openshiftCluster) relaxImageSignerPermissions(t *testing.T) {
|
|||||||
|
|
||||||
// tearDown stops the cluster services and deletes (only some!) of the state.
|
// tearDown stops the cluster services and deletes (only some!) of the state.
|
||||||
func (cluster *openshiftCluster) tearDown(t *testing.T) {
|
func (cluster *openshiftCluster) tearDown(t *testing.T) {
|
||||||
for i := len(cluster.processes) - 1; i >= 0; i-- {
|
for _, process := range slices.Backward(cluster.processes) {
|
||||||
// It’s undocumented what Kill() returns if the process has terminated,
|
// It’s undocumented what Kill() returns if the process has terminated,
|
||||||
// so we couldn’t check just for that. This is running in a container anyway…
|
// so we couldn’t check just for that. This is running in a container anyway…
|
||||||
_ = cluster.processes[i].Process.Kill()
|
_ = process.Process.Kill()
|
||||||
}
|
}
|
||||||
if cluster.dockerDir != "" {
|
if cluster.dockerDir != "" {
|
||||||
err := os.RemoveAll(cluster.dockerDir)
|
err := os.RemoveAll(cluster.dockerDir)
|
||||||
|
Loading…
Reference in New Issue
Block a user