tree-wide: rewrite ioutil functions to their replacements

The ioutil package has been deprecated in Go 1.16 [1]. This CL removes
all our own users of that package and rewrites them to use their
replacements in the os package. I initially wanted to do this with a
gofix but because all replacements were signature-compatible I just
did it with a few string replaces and then ran goimports to fix up the
imports.

I intentionally didn't rewrite the patches as that would require a
different process and is IMO of less value.

[1] https://github.com/golang/go/issues/42026

Change-Id: Iac6663a1f1ee49f9b1c6e4b3d97e73f2c3b54a13
Reviewed-on: https://review.monogon.dev/c/monogon/+/449
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
diff --git a/metropolis/node/kubernetes/containerd/main.go b/metropolis/node/kubernetes/containerd/main.go
index c3dd4a0..b5e2cf0 100644
--- a/metropolis/node/kubernetes/containerd/main.go
+++ b/metropolis/node/kubernetes/containerd/main.go
@@ -20,7 +20,6 @@
 	"context"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -108,7 +107,7 @@
 		return fmt.Errorf("failed to connect to containerd: %w", err)
 	}
 	logger := supervisor.Logger(ctx)
-	preseedNamespaceDirs, err := ioutil.ReadDir(preseedNamespacesDir)
+	preseedNamespaceDirs, err := os.ReadDir(preseedNamespacesDir)
 	if err != nil {
 		return fmt.Errorf("failed to open preseed dir: %w", err)
 	}
@@ -118,7 +117,7 @@
 			continue
 		}
 		namespace := dir.Name()
-		images, err := ioutil.ReadDir(filepath.Join(preseedNamespacesDir, namespace))
+		images, err := os.ReadDir(filepath.Join(preseedNamespacesDir, namespace))
 		if err != nil {
 			return fmt.Errorf("failed to list namespace preseed directory for ns \"%v\": %w", namespace, err)
 		}