Browse code

integration-cli: fix incorrect permissions (staticcheck)

```
13:06:14 integration-cli/docker_api_containers_test.go:1983:72: SA9002: file mode '666' evaluates to 01232; did you mean '0666'? (staticcheck)
13:06:14 err = ioutil.WriteFile(filepath.Join(tmpDir, "bar"), []byte("hello"), 666)
13:06:14 integration-cli/fixtures_linux_daemon_test.go:64:46: SA9002: file mode '600' evaluates to 01130; did you mean '0600'? (staticcheck)
13:06:14 err = ioutil.WriteFile(dockerFile, content, 600)
13:06:14 ^
13:06:14 integration-cli/fixtures_linux_daemon_test.go:119:54: SA9002: file mode '600' evaluates to 01130; did you mean '0600'? (staticcheck)
13:06:14 err = ioutil.WriteFile(dockerfile, []byte(content), 600)
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/08/05 22:28:25
Showing 2 changed files
... ...
@@ -1941,7 +1941,7 @@ func (s *DockerSuite) TestContainerAPICreateMountsBindRead(c *testing.T) {
1941 1941
 	tmpDir, err := ioutil.TempDir("", "test-mounts-api-bind")
1942 1942
 	assert.NilError(c, err)
1943 1943
 	defer os.RemoveAll(tmpDir)
1944
-	err = ioutil.WriteFile(filepath.Join(tmpDir, "bar"), []byte("hello"), 666)
1944
+	err = ioutil.WriteFile(filepath.Join(tmpDir, "bar"), []byte("hello"), 0666)
1945 1945
 	assert.NilError(c, err)
1946 1946
 	config := containertypes.Config{
1947 1947
 		Image: "busybox",
... ...
@@ -61,7 +61,7 @@ func ensureSyscallTest(c *testing.T) {
61 61
 	FROM debian:jessie
62 62
 	COPY . /usr/bin/
63 63
 	`)
64
-	err = ioutil.WriteFile(dockerFile, content, 600)
64
+	err = ioutil.WriteFile(dockerFile, content, 0600)
65 65
 	assert.NilError(c, err)
66 66
 
67 67
 	var buildArgs []string
... ...
@@ -116,7 +116,7 @@ func ensureNNPTest(c *testing.T) {
116 116
 	COPY . /usr/bin
117 117
 	RUN chmod +s /usr/bin/nnp-test
118 118
 	`
119
-	err = ioutil.WriteFile(dockerfile, []byte(content), 600)
119
+	err = ioutil.WriteFile(dockerfile, []byte(content), 0600)
120 120
 	assert.NilError(c, err, "could not write Dockerfile for nnp-test image")
121 121
 
122 122
 	var buildArgs []string