From 92a043e8338fa04bd0a7da5245c72d2c79a38420 Mon Sep 17 00:00:00 2001 From: Morgan Bauer Date: Wed, 17 Aug 2016 12:31:42 -0700 Subject: [PATCH] ensure pkg/util/mount compiles & crosses - move compile time check from linux code to generic code --- pkg/util/mount/mount.go | 4 ++++ pkg/util/mount/mount_linux.go | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/util/mount/mount.go b/pkg/util/mount/mount.go index 25f55df9ea9..fb05ed8e891 100644 --- a/pkg/util/mount/mount.go +++ b/pkg/util/mount/mount.go @@ -51,6 +51,10 @@ type Interface interface { GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) } +// Compile-time check to ensure all Mounter implementations satisfy +// the mount interface +var _ Interface = &Mounter{} + // This represents a single line in /proc/mounts or /etc/fstab. type MountPoint struct { Device string diff --git a/pkg/util/mount/mount_linux.go b/pkg/util/mount/mount_linux.go index 5e556c3444e..2c94f32d76a 100644 --- a/pkg/util/mount/mount_linux.go +++ b/pkg/util/mount/mount_linux.go @@ -54,8 +54,6 @@ const ( // kubelet is running in the host's root mount namespace. type Mounter struct{} -var _ = Interface(&Mounter{}) - // Mount mounts source to target as fstype with given options. 'source' and 'fstype' must // be an emtpy string in case it's not required, e.g. for remount, or for auto filesystem // type, where kernel handles fs type for you. The mount 'options' is a list of options,