Skip to content

Commit 55fd451

Browse files
authored
Add missing packages and rely on $PATH to locate the findmnt binary (#10)
1 parent 487743a commit 55fd451

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ COPY . .
99
RUN cd cmd/carina-node && CGO_ENABLED=0 go build -o /tmp/carina-node .
1010
RUN cd cmd/carina-controller && CGO_ENABLED=0 go build -o /tmp/carina-controller .
1111

12-
FROM alpine:3.20
12+
FROM alpine:3.23
1313

14-
RUN apk add --no-cache bash bcache-tools device-mapper e2fsprogs eudev lvm2 parted thin-provisioning-tools util-linux xfsprogs
14+
RUN apk add --no-cache bash bcache-tools bcache-tools-udev device-mapper e2fsprogs e2fsprogs-extra eudev lvm2 parted thin-provisioning-tools util-linux xfsprogs xfsprogs-extra
1515

1616
COPY --from=builder /tmp/carina-node /usr/bin/
1717
COPY --from=builder /tmp/carina-controller /usr/bin/

pkg/csidriver/driver/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import (
4848
const (
4949
// DeviceDirectory is a directory where Node service creates device files.
5050
DeviceDirectory = "/dev/carina"
51-
findmntCmd = "/usr/bin/findmnt"
51+
findmntCmd = "findmnt"
5252
devicePermission = 0600 | unix.S_IFBLK
5353
)
5454

pkg/devicemanager/partition/partition.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ func (ld *LocalPartitionImplement) UpdatePartition(name, groups string, size uin
245245
partitionNum = p.Number
246246
log.Info("Update partition on disk dst: ", fmt.Sprintf("/dev/%s", diskPath), " number:", p.Number, " name:", p.Name, " start:", p.Start, " size: ", p.Last, " last:", p.Last, disk.Table)
247247
kname := linux.GetPartitionKname(disk.Path, p.Number)
248-
targetPathOut, err := ld.Executor.ExecuteCommandWithOutput("/usr/bin/findmnt", "-S", kname, "--noheadings", "--output=target")
248+
targetPathOut, err := ld.Executor.ExecuteCommandWithOutput("findmnt", "-S", kname, "--noheadings", "--output=target")
249249
if err != nil {
250250
log.Error("targetPathOut ", targetPathOut, " failed: "+err.Error())
251251
//skip return err because no mount point is available for target path
252252
}
253-
log.Info("/usr/bin/findmnt", " -S ", kname, " --noheadings", " --output=target", " targetPathOut: "+targetPathOut)
253+
log.Info("findmnt", " -S ", kname, " --noheadings", " --output=target", " targetPathOut: "+targetPathOut)
254254

255255
targetpath := strings.TrimSpace(strings.TrimSuffix(strings.ReplaceAll(targetPathOut, "\"", ""), "\n"))
256256
isMount := strings.Contains(targetpath, "mount")

pkg/devicemanager/partition/partition_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestGetPartitions(t *testing.T) {
132132

133133
func TestMount(t *testing.T) {
134134

135-
targetPathOut, err := localparttion.Executor.ExecuteCommandWithOutput("/usr/bin/findmnt", "-S", "/dev/loop0", "--noheadings", "--output=target")
135+
targetPathOut, err := localparttion.Executor.ExecuteCommandWithOutput("findmnt", "-S", "/dev/loop0", "--noheadings", "--output=target")
136136
t.Log("targetPathOut", targetPathOut)
137137
if err != nil {
138138
t.Log(err.Error())

scheduler/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY . .
77

88
RUN cd cmd && CGO_ENABLED=0 go build -o /tmp/carina-scheduler .
99

10-
FROM alpine:3.20
10+
FROM alpine:3.23
1111

1212
COPY --from=builder /workspace/debug/scheduler-config.yaml /etc/kubernetes
1313
COPY --from=builder /workspace/config.json /etc/carina/

0 commit comments

Comments
 (0)