Skip to content

Commit 0480f80

Browse files
Remove redundant helper methods
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 4ddb0a1 commit 0480f80

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

internal/containerd/install_dbus.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,8 @@ package containerd
33
import (
44
"fmt"
55
"log/slog"
6-
"os"
7-
"os/exec"
86
)
97

10-
// UsesSystemd checks if the system is using systemd.
11-
func UsesSystemd() bool {
12-
cmd := nsenterCmd("systemctl", "list-units", "|", "grep", "-q", "containerd.service")
13-
if err := cmd.Run(); err != nil {
14-
slog.Info("Error with systemctl: %w\n", "error", err)
15-
return false
16-
}
17-
return true
18-
}
19-
208
// InstallDbus checks if D-Bus service is installed and active. If not, installs D-Bus
219
// and starts the service.
2210
// NOTE: this limits support to systems using systemctl to manage systemd.
@@ -63,8 +51,3 @@ func InstallDbus() error {
6351

6452
return nil
6553
}
66-
67-
func nsenterCmd(cmd ...string) *exec.Cmd {
68-
return exec.Command("nsenter",
69-
append([]string{fmt.Sprintf("-m/%s/proc/1/ns/mnt", os.Getenv("HOST_ROOT")), "--"}, cmd...)...) // #nosec G204
70-
}

internal/controller/shim_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ func (sr *ShimReconciler) setOperationConfiguration(shim *rcmv1.Shim, opConfig *
380380
}
381381

382382
// createJobManifest creates a Job manifest for a Shim.
383+
//
384+
//nolint:funlen // function is longer due to scaffolding an entire K8s Job manifest
383385
func (sr *ShimReconciler) createJobManifest(shim *rcmv1.Shim, node *corev1.Node, operation string) (*batchv1.Job, error) {
384386
opConfig := opConfig{
385387
operation: operation,

0 commit comments

Comments
 (0)