Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [release-1.6] fix(capd): remove hack for btrfs/zfs support #10192

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions test/infrastructure/container/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const (

btrfsStorage = "btrfs"
zfsStorage = "zfs"
xfsStorage = "xfs"
)

type dockerRuntime struct {
Expand Down Expand Up @@ -445,15 +444,6 @@ func (d *dockerRuntime) RunContainer(ctx context.Context, runConfig *RunContaine
}
containerConfig.Env = envVars

// handle Docker on Btrfs or ZFS
// https://github.com/kubernetes-sigs/kind/issues/1416#issuecomment-606514724
if d.mountDevMapper(info) {
runConfig.Mounts = append(runConfig.Mounts, Mount{
Source: "/dev/mapper",
Target: "/dev/mapper",
})
}

configureVolumes(runConfig, &containerConfig, &hostConfig)
configurePortMappings(runConfig.PortMappings, &containerConfig, &hostConfig)

Expand Down Expand Up @@ -692,28 +682,6 @@ func (d *dockerRuntime) usernsRemap(info types.Info) bool {
return false
}

// mountDevMapper checks if the Docker storage driver is Btrfs or ZFS
// or if the backing filesystem is Btrfs.
func (d *dockerRuntime) mountDevMapper(info types.Info) bool {
storage := ""
storage = strings.ToLower(strings.TrimSpace(info.Driver))
if storage == btrfsStorage || storage == zfsStorage || storage == "devicemapper" {
return true
}

// check the backing file system
// docker info -f '{{json .DriverStatus }}'
// [["Backing Filesystem","extfs"],["Supports d_type","true"],["Native Overlay Diff","true"]]
for _, item := range info.DriverStatus {
if item[0] == "Backing Filesystem" {
storage = strings.ToLower(item[1])
break
}
}

return storage == btrfsStorage || storage == zfsStorage || storage == xfsStorage
}

// rootless: use fuse-overlayfs by default
// https://github.com/kubernetes-sigs/kind/issues/2275
func (d *dockerRuntime) mountFuse(info types.Info) bool {
Expand Down
Loading