Remove apimachinery dep from mount library

As part of wanting to move the mount library into staging and then
k8s.io/utils, there can be no dependencies on k/k code, and that
includes k/apimachinery.

This patch makes a small implementation change to no longer need
k8s.io/apimachinery/pkg/util/sets
This commit is contained in:
Travis Rhoden 2019-04-02 13:49:46 -06:00
parent d99f49d2a7
commit 6e5bf40dd2
2 changed files with 7 additions and 4 deletions

View File

@ -37,7 +37,6 @@ go_library(
"//vendor/k8s.io/utils/nsenter:go_default_library", "//vendor/k8s.io/utils/nsenter:go_default_library",
], ],
"@io_bazel_rules_go//go/platform:linux": [ "@io_bazel_rules_go//go/platform:linux": [
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/golang.org/x/sys/unix:go_default_library", "//vendor/golang.org/x/sys/unix:go_default_library",
"//vendor/k8s.io/utils/io:go_default_library", "//vendor/k8s.io/utils/io:go_default_library",
"//vendor/k8s.io/utils/nsenter:go_default_library", "//vendor/k8s.io/utils/nsenter:go_default_library",

View File

@ -30,7 +30,6 @@ import (
"syscall" "syscall"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog" "k8s.io/klog"
utilexec "k8s.io/utils/exec" utilexec "k8s.io/utils/exec"
utilio "k8s.io/utils/io" utilio "k8s.io/utils/io"
@ -90,8 +89,13 @@ func (mounter *Mounter) Mount(source string, target string, fstype string, optio
return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindRemountOpts) return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindRemountOpts)
} }
// The list of filesystems that require containerized mounter on GCI image cluster // The list of filesystems that require containerized mounter on GCI image cluster
fsTypesNeedMounter := sets.NewString("nfs", "glusterfs", "ceph", "cifs") fsTypesNeedMounter := map[string]struct{}{
if fsTypesNeedMounter.Has(fstype) { "nfs": {},
"glusterfs": {},
"ceph": {},
"cifs": {},
}
if _, ok := fsTypesNeedMounter[fstype]; ok {
mounterPath = mounter.mounterPath mounterPath = mounter.mounterPath
} }
return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, options) return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, options)