mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Update ioutil library references to os and io respectively for API and Plugins package (#16330)
No user facing changes so I assume no change log is required
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"regexp"
|
||||
@@ -176,7 +175,7 @@ func TestExecFSIsolation(t *testing.T, driver *DriverHarness, taskID string) {
|
||||
t.Logf("created file in task: %v", tempfile)
|
||||
|
||||
// read from host
|
||||
b, err := ioutil.ReadFile(tempfile)
|
||||
b, err := os.ReadFile(tempfile)
|
||||
if !isolated {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, text, strings.TrimSpace(string(b)))
|
||||
|
||||
@@ -3,7 +3,6 @@ package testutils
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -116,7 +115,7 @@ func (h *DriverHarness) cleanupCgroup() {
|
||||
// A cleanup func is returned and should be deferred so as to not leak dirs
|
||||
// between tests.
|
||||
func (h *DriverHarness) MkAllocDir(t *drivers.TaskConfig, enableLogs bool) func() {
|
||||
dir, err := ioutil.TempDir("", "nomad_driver_harness-")
|
||||
dir, err := os.MkdirTemp("", "nomad_driver_harness-")
|
||||
require.NoError(h.t, err)
|
||||
|
||||
allocDir := allocdir.NewAllocDir(h.logger, dir, t.AllocID)
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
@@ -95,7 +94,7 @@ func (c *Device) Run(args []string) int {
|
||||
var config []byte
|
||||
if numArgs == 2 {
|
||||
var err error
|
||||
config, err = ioutil.ReadFile(args[1])
|
||||
config, err = os.ReadFile(args[1])
|
||||
if err != nil {
|
||||
c.logger.Error("failed to read config file", "error", err)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user