Skip to content

Commit 3705397

Browse files
[no-relnote] ignore deprecation warning of runc/utils/WithProcfd
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 4469147 commit 3705397

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

cmd/nvidia-cdi-hook/disable-device-node-modification/params_linux.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ func createParamsFileInContainer(containerRoot *os.Root, contents []byte) error
3737
return fmt.Errorf("error creating hook scratch folder: %w", err)
3838
}
3939

40-
err := utils.WithProcfd(containerRootDirPath, hookScratchDirPath, func(hookScratchDirFdPath string) error {
40+
// TODO (ArangoGutierrez): Remove the nolint:staticcheck and properly fix the deprecation warning.
41+
err := utils.WithProcfd(containerRootDirPath, hookScratchDirPath, func(hookScratchDirFdPath string) error { //nolint:staticcheck
4142
return createTmpFs(hookScratchDirFdPath, len(contents))
4243
})
4344
if err != nil {
@@ -49,7 +50,8 @@ func createParamsFileInContainer(containerRoot *os.Root, contents []byte) error
4950
return fmt.Errorf("error creating modified params file: %w", err)
5051
}
5152

52-
err = utils.WithProcfd(containerRootDirPath, modifiedParamsFilePath, func(modifiedParamsFileFdPath string) error {
53+
// TODO (ArangoGutierrez): Remove the nolint:staticcheck and properly fix the deprecation warning.
54+
err = utils.WithProcfd(containerRootDirPath, modifiedParamsFilePath, func(modifiedParamsFileFdPath string) error { //nolint:staticcheck
5355
modifiedParamsFile, err := os.OpenFile(modifiedParamsFileFdPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0444)
5456
if err != nil {
5557
return fmt.Errorf("failed to open modified params file: %w", err)
@@ -60,7 +62,8 @@ func createParamsFileInContainer(containerRoot *os.Root, contents []byte) error
6062
return fmt.Errorf("failed to write temporary params file: %w", err)
6163
}
6264

63-
err = utils.WithProcfd(containerRootDirPath, nvidiaDriverParamsPath, func(nvidiaDriverParamsFdPath string) error {
65+
// TODO (ArangoGutierrez): Remove the nolint:staticcheck and properly fix the deprecation warning.
66+
err = utils.WithProcfd(containerRootDirPath, nvidiaDriverParamsPath, func(nvidiaDriverParamsFdPath string) error { //nolint:staticcheck
6467
return unix.Mount(modifiedParamsFileFdPath, nvidiaDriverParamsFdPath, "", unix.MS_BIND|unix.MS_RDONLY|unix.MS_NODEV|unix.MS_PRIVATE|unix.MS_NOSYMFOLLOW, "")
6568
})
6669
if err != nil {

internal/ldconfig/ldconfig_linux.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ func mountLdConfig(hostLdconfigPath string, containerRoot *os.Root) (string, err
198198
return "", fmt.Errorf("error creating hook scratch folder: %w", err)
199199
}
200200

201-
err = utils.WithProcfd(containerRootDirPath, hookScratchDirPath, func(hookScratchDirFdPath string) error {
201+
// TODO (ArangoGutierrez): Remove the nolint:staticcheck and properly fix the deprecation warning.
202+
err = utils.WithProcfd(containerRootDirPath, hookScratchDirPath, func(hookScratchDirFdPath string) error { //nolint:staticcheck
202203
return createTmpFs(hookScratchDirFdPath, int(hostLdconfigInfo.Size()))
203204
})
204205
if err != nil {
@@ -209,7 +210,8 @@ func mountLdConfig(hostLdconfigPath string, containerRoot *os.Root) (string, err
209210
return "", fmt.Errorf("error creating ldconfig: %w", err)
210211
}
211212

212-
err = utils.WithProcfd(containerRootDirPath, ldconfigPath, func(ldconfigFdPath string) error {
213+
// TODO (ArangoGutierrez): Remove the nolint:staticcheck and properly fix the deprecation warning.
214+
err = utils.WithProcfd(containerRootDirPath, ldconfigPath, func(ldconfigFdPath string) error { //nolint:staticcheck
213215
return unix.Mount(hostLdconfigPath, ldconfigFdPath, "", unix.MS_BIND|unix.MS_RDONLY|unix.MS_NODEV|unix.MS_PRIVATE|unix.MS_NOSYMFOLLOW, "")
214216
})
215217
if err != nil {

0 commit comments

Comments
 (0)