mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
update golangci-lint to 1.60.1
Fixes new spotted issues around printf() formats and using os.Setenv() in tests. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -14,19 +14,19 @@ func TestSocketActivated(t *testing.T) {
|
||||
assert.False(SocketActivated())
|
||||
|
||||
// different pid
|
||||
assert.NoError(os.Setenv("LISTEN_PID", "1"))
|
||||
t.Setenv("LISTEN_PID", "1")
|
||||
assert.False(SocketActivated())
|
||||
|
||||
// same pid no fds
|
||||
assert.NoError(os.Setenv("LISTEN_PID", strconv.Itoa(os.Getpid())))
|
||||
assert.NoError(os.Setenv("LISTEN_FDS", "0"))
|
||||
t.Setenv("LISTEN_PID", strconv.Itoa(os.Getpid()))
|
||||
t.Setenv("LISTEN_FDS", "0")
|
||||
assert.False(SocketActivated())
|
||||
|
||||
// same pid some fds
|
||||
assert.NoError(os.Setenv("LISTEN_FDS", "1"))
|
||||
t.Setenv("LISTEN_FDS", "1")
|
||||
assert.True(SocketActivated())
|
||||
|
||||
// FDNAME is ok too (but not required)
|
||||
assert.NoError(os.Setenv("LISTEN_FDNAMES", "/meshuggah/rocks"))
|
||||
t.Setenv("LISTEN_FDNAMES", "/meshuggah/rocks")
|
||||
assert.True(SocketActivated())
|
||||
}
|
||||
|
@ -1775,7 +1775,7 @@ func handleUserRemap(unitFile *parser.UnitFile, groupName string, podman *Podman
|
||||
autoOpts = append(autoOpts, fmt.Sprintf("size=%v", uidSize))
|
||||
}
|
||||
|
||||
podman.addf("--userns=" + usernsOpts("auto", autoOpts))
|
||||
podman.add("--userns=" + usernsOpts("auto", autoOpts))
|
||||
case "keep-id":
|
||||
if !isUser {
|
||||
return fmt.Errorf("RemapUsers=keep-id is unsupported for system units")
|
||||
@ -1795,7 +1795,7 @@ func handleUserRemap(unitFile *parser.UnitFile, groupName string, podman *Podman
|
||||
keepidOpts = append(keepidOpts, "gid="+gidMaps[0])
|
||||
}
|
||||
|
||||
podman.addf("--userns=" + usernsOpts("keep-id", keepidOpts))
|
||||
podman.add("--userns=" + usernsOpts("keep-id", keepidOpts))
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unsupported RemapUsers option '%s'", remapUsers)
|
||||
|
Reference in New Issue
Block a user