Skip to content

Commit 13a5c4e

Browse files
authored
Merge pull request #4941 from lifubang/backport-4934-4917-4937
[1.4] ci: backport #4934 #4917 #4937
2 parents 1984e2c + ae19971 commit 13a5c4e

File tree

10 files changed

+14
-16
lines changed

10 files changed

+14
-16
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ jobs:
218218

219219
# NOTE the execution environment lacks a terminal, needed for
220220
# some integration tests. So we use `ssh -tt` command to fake a terminal.
221-
- uses: lima-vm/lima-actions/ssh@v1
222-
223221
- name: "Run unit tests"
224222
run: ssh -tt lima-default sudo -i make -C /tmp/runc localunittest
225223

.github/workflows/validate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
sudo apt -qy install libseccomp-dev
4242
- uses: golangci/golangci-lint-action@v8
4343
with:
44-
version: v2.4
45-
# Extra linters, only checking new code from a pull request.
44+
version: v2.5
45+
# Extra linters, only checking new code from a pull request to main.
4646
- name: lint-extra
47-
if: github.event_name == 'pull_request'
47+
if: github.event_name == 'pull_request' && github.base_ref == 'main'
4848
run: |
4949
golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1
5050

libcontainer/exeseal/cloned_binary_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func getSealableFile(comment, tmpDir string) (file *os.File, sealFn SealFunc, er
125125
// First, try an executable memfd (supported since Linux 3.17).
126126
file, sealFn, err = Memfd(comment)
127127
if err == nil {
128-
return
128+
return file, sealFn, err
129129
}
130130
logrus.Debugf("memfd cloned binary failed, falling back to O_TMPFILE: %v", err)
131131

@@ -154,7 +154,7 @@ func getSealableFile(comment, tmpDir string) (file *os.File, sealFn SealFunc, er
154154
file.Close()
155155
continue
156156
}
157-
return
157+
return file, sealFn, err
158158
}
159159
logrus.Debugf("O_TMPFILE cloned binary failed, falling back to mktemp(): %v", err)
160160
// Finally, try a classic unlinked temporary file.
@@ -168,7 +168,7 @@ func getSealableFile(comment, tmpDir string) (file *os.File, sealFn SealFunc, er
168168
file.Close()
169169
continue
170170
}
171-
return
171+
return file, sealFn, err
172172
}
173173
return nil, nil, fmt.Errorf("could not create sealable file for cloned binary: %w", err)
174174
}

libcontainer/integration/utils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func runContainer(t testing.TB, config *configs.Config, args ...string) (buffers
210210
} else {
211211
return buffers, -1, err
212212
}
213-
return
213+
return buffers, exitCode, err
214214
}
215215

216216
// runContainerOk is a wrapper for runContainer, simplifying its use for cases

libcontainer/internal/userns/usernsfd_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (m Mapping) toSys() (uids, gids []syscall.SysProcIDMap) {
3434
Size: int(gid.Size),
3535
})
3636
}
37-
return
37+
return uids, gids
3838
}
3939

4040
// id returns a unique identifier for this mapping, agnostic of the order of

libcontainer/mount_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func syscallMode(i fs.FileMode) (o uint32) {
236236
o |= unix.S_ISVTX
237237
}
238238
// No mapping for Go's ModeTemporary (plan9 only).
239-
return
239+
return o
240240
}
241241

242242
// mountFd creates a "mount source fd" (either through open_tree(2) or just

libcontainer/nsenter/nsenter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func newPipe(t *testing.T) (parent *os.File, child *os.File) {
199199
parent.Close()
200200
child.Close()
201201
})
202-
return
202+
return parent, child
203203
}
204204

205205
func reapChildren(t *testing.T, parent *os.File) {

libcontainer/rootfs_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ func msMoveRoot(rootfs string) error {
11551155
strings.HasPrefix(info.Mountpoint, rootfs) {
11561156
skip = true
11571157
}
1158-
return
1158+
return skip, stop
11591159
})
11601160
if err != nil {
11611161
return err

libcontainer/seccomp/patchbpf/enosys_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ func filterFlags(config *configs.Seccomp, filter *libseccomp.ScmpFilter) (flags
676676
}
677677
}
678678

679-
return
679+
return flags, noNewPrivs, err
680680
}
681681

682682
func sysSeccompSetFilter(flags uint, filter []unix.SockFilter) (fd int, err error) {
@@ -706,7 +706,7 @@ func sysSeccompSetFilter(flags uint, filter []unix.SockFilter) (fd int, err erro
706706
}
707707
runtime.KeepAlive(filter)
708708
runtime.KeepAlive(fprog)
709-
return
709+
return fd, err
710710
}
711711

712712
// PatchAndLoad takes a seccomp configuration and a libseccomp filter which has

libcontainer/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@ func Annotations(labels []string) (bundle string, userAnnotations map[string]str
111111
userAnnotations[name] = value
112112
}
113113
}
114-
return
114+
return bundle, userAnnotations
115115
}

0 commit comments

Comments
 (0)