From 6e5bf40dd2d94df634c4a8d4bc7218ea70bc5a19 Mon Sep 17 00:00:00 2001 From: Travis Rhoden Date: Tue, 2 Apr 2019 13:49:46 -0600 Subject: [PATCH] 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 --- pkg/util/mount/BUILD | 1 - pkg/util/mount/mount_linux.go | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/util/mount/BUILD b/pkg/util/mount/BUILD index 3a61d016a81..30c7b7cd3d3 100644 --- a/pkg/util/mount/BUILD +++ b/pkg/util/mount/BUILD @@ -37,7 +37,6 @@ go_library( "//vendor/k8s.io/utils/nsenter:go_default_library", ], "@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/k8s.io/utils/io:go_default_library", "//vendor/k8s.io/utils/nsenter:go_default_library", diff --git a/pkg/util/mount/mount_linux.go b/pkg/util/mount/mount_linux.go index 9ffd766a51b..8017aaf00ad 100644 --- a/pkg/util/mount/mount_linux.go +++ b/pkg/util/mount/mount_linux.go @@ -30,7 +30,6 @@ import ( "syscall" "golang.org/x/sys/unix" - "k8s.io/apimachinery/pkg/util/sets" "k8s.io/klog" utilexec "k8s.io/utils/exec" 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) } // The list of filesystems that require containerized mounter on GCI image cluster - fsTypesNeedMounter := sets.NewString("nfs", "glusterfs", "ceph", "cifs") - if fsTypesNeedMounter.Has(fstype) { + fsTypesNeedMounter := map[string]struct{}{ + "nfs": {}, + "glusterfs": {}, + "ceph": {}, + "cifs": {}, + } + if _, ok := fsTypesNeedMounter[fstype]; ok { mounterPath = mounter.mounterPath } return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, options)