From f130e48debbbee15a232d00db16f22d00b04e6a1 Mon Sep 17 00:00:00 2001 From: yameiwang Date: Fri, 2 Nov 2018 05:16:00 +0800 Subject: [PATCH] fix golint errors in pkg/volume/host_path --- cmd/kube-controller-manager/app/BUILD | 2 +- cmd/kube-controller-manager/app/plugins.go | 4 ++-- cmd/kubelet/app/BUILD | 2 +- cmd/kubelet/app/plugins.go | 4 ++-- hack/.golint_failures | 1 - pkg/kubelet/BUILD | 2 +- pkg/kubelet/kubelet_test.go | 2 +- pkg/volume/BUILD | 2 +- pkg/volume/{host_path => hostpath}/BUILD | 2 +- pkg/volume/{host_path => hostpath}/OWNERS | 0 pkg/volume/{host_path => hostpath}/doc.go | 4 ++-- pkg/volume/{host_path => hostpath}/host_path.go | 4 ++-- pkg/volume/{host_path => hostpath}/host_path_test.go | 2 +- test/test_owners.csv | 2 +- 14 files changed, 16 insertions(+), 17 deletions(-) rename pkg/volume/{host_path => hostpath}/BUILD (96%) rename pkg/volume/{host_path => hostpath}/OWNERS (100%) rename pkg/volume/{host_path => hostpath}/doc.go (80%) rename pkg/volume/{host_path => hostpath}/host_path.go (99%) rename pkg/volume/{host_path => hostpath}/host_path_test.go (99%) diff --git a/cmd/kube-controller-manager/app/BUILD b/cmd/kube-controller-manager/app/BUILD index edf90b2b29d..6fdd483cedb 100644 --- a/cmd/kube-controller-manager/app/BUILD +++ b/cmd/kube-controller-manager/app/BUILD @@ -96,7 +96,7 @@ go_library( "//pkg/volume/flocker:go_default_library", "//pkg/volume/gcepd:go_default_library", "//pkg/volume/glusterfs:go_default_library", - "//pkg/volume/host_path:go_default_library", + "//pkg/volume/hostpath:go_default_library", "//pkg/volume/iscsi:go_default_library", "//pkg/volume/local:go_default_library", "//pkg/volume/nfs:go_default_library", diff --git a/cmd/kube-controller-manager/app/plugins.go b/cmd/kube-controller-manager/app/plugins.go index 0c9f8b3cf81..dc3a89807c3 100644 --- a/cmd/kube-controller-manager/app/plugins.go +++ b/cmd/kube-controller-manager/app/plugins.go @@ -40,7 +40,7 @@ import ( "k8s.io/kubernetes/pkg/volume/flocker" "k8s.io/kubernetes/pkg/volume/gcepd" "k8s.io/kubernetes/pkg/volume/glusterfs" - "k8s.io/kubernetes/pkg/volume/host_path" + "k8s.io/kubernetes/pkg/volume/hostpath" "k8s.io/kubernetes/pkg/volume/iscsi" "k8s.io/kubernetes/pkg/volume/local" "k8s.io/kubernetes/pkg/volume/nfs" @@ -135,7 +135,7 @@ func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, config persiste if err := AttemptToLoadRecycler(config.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathHostPath, &hostPathConfig); err != nil { klog.Fatalf("Could not create hostpath recycler pod from file %s: %+v", config.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathHostPath, err) } - allPlugins = append(allPlugins, host_path.ProbeVolumePlugins(hostPathConfig)...) + allPlugins = append(allPlugins, hostpath.ProbeVolumePlugins(hostPathConfig)...) nfsConfig := volume.VolumeConfig{ RecyclerMinimumTimeout: int(config.PersistentVolumeRecyclerConfiguration.MinimumTimeoutNFS), diff --git a/cmd/kubelet/app/BUILD b/cmd/kubelet/app/BUILD index 6395f9d30f3..0cde1c1c174 100644 --- a/cmd/kubelet/app/BUILD +++ b/cmd/kubelet/app/BUILD @@ -96,7 +96,7 @@ go_library( "//pkg/volume/gcepd:go_default_library", "//pkg/volume/git_repo:go_default_library", "//pkg/volume/glusterfs:go_default_library", - "//pkg/volume/host_path:go_default_library", + "//pkg/volume/hostpath:go_default_library", "//pkg/volume/iscsi:go_default_library", "//pkg/volume/local:go_default_library", "//pkg/volume/nfs:go_default_library", diff --git a/cmd/kubelet/app/plugins.go b/cmd/kubelet/app/plugins.go index 5f8ceed7b00..be0a2b2b0bc 100644 --- a/cmd/kubelet/app/plugins.go +++ b/cmd/kubelet/app/plugins.go @@ -41,7 +41,7 @@ import ( "k8s.io/kubernetes/pkg/volume/gcepd" "k8s.io/kubernetes/pkg/volume/git_repo" "k8s.io/kubernetes/pkg/volume/glusterfs" - "k8s.io/kubernetes/pkg/volume/host_path" + "k8s.io/kubernetes/pkg/volume/hostpath" "k8s.io/kubernetes/pkg/volume/iscsi" "k8s.io/kubernetes/pkg/volume/local" "k8s.io/kubernetes/pkg/volume/nfs" @@ -75,7 +75,7 @@ func ProbeVolumePlugins() []volume.VolumePlugin { allPlugins = append(allPlugins, emptydir.ProbeVolumePlugins()...) allPlugins = append(allPlugins, gcepd.ProbeVolumePlugins()...) allPlugins = append(allPlugins, git_repo.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, host_path.ProbeVolumePlugins(volume.VolumeConfig{})...) + allPlugins = append(allPlugins, hostpath.ProbeVolumePlugins(volume.VolumeConfig{})...) allPlugins = append(allPlugins, nfs.ProbeVolumePlugins(volume.VolumeConfig{})...) allPlugins = append(allPlugins, secret.ProbeVolumePlugins()...) allPlugins = append(allPlugins, iscsi.ProbeVolumePlugins()...) diff --git a/hack/.golint_failures b/hack/.golint_failures index adac8ddc34b..883d1ee5118 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -344,7 +344,6 @@ pkg/volume/azure_file pkg/volume/csi/csiv0 pkg/volume/csi/fake pkg/volume/git_repo -pkg/volume/host_path pkg/volume/iscsi pkg/volume/nfs pkg/volume/photon_pd diff --git a/pkg/kubelet/BUILD b/pkg/kubelet/BUILD index 182fbb40152..9db64dbff02 100644 --- a/pkg/kubelet/BUILD +++ b/pkg/kubelet/BUILD @@ -218,7 +218,7 @@ go_test( "//pkg/volume/awsebs:go_default_library", "//pkg/volume/azure_dd:go_default_library", "//pkg/volume/gcepd:go_default_library", - "//pkg/volume/host_path:go_default_library", + "//pkg/volume/hostpath:go_default_library", "//pkg/volume/testing:go_default_library", "//pkg/volume/util:go_default_library", "//pkg/volume/util/subpath:go_default_library", diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index c44e9b8038c..4bfa8b33741 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -72,7 +72,7 @@ import ( "k8s.io/kubernetes/pkg/volume/awsebs" "k8s.io/kubernetes/pkg/volume/azure_dd" "k8s.io/kubernetes/pkg/volume/gcepd" - _ "k8s.io/kubernetes/pkg/volume/host_path" + _ "k8s.io/kubernetes/pkg/volume/hostpath" volumetest "k8s.io/kubernetes/pkg/volume/testing" "k8s.io/kubernetes/pkg/volume/util" "k8s.io/kubernetes/pkg/volume/util/subpath" diff --git a/pkg/volume/BUILD b/pkg/volume/BUILD index fd001aee035..c5a9f8dda31 100644 --- a/pkg/volume/BUILD +++ b/pkg/volume/BUILD @@ -90,7 +90,7 @@ filegroup( "//pkg/volume/gcepd:all-srcs", "//pkg/volume/git_repo:all-srcs", "//pkg/volume/glusterfs:all-srcs", - "//pkg/volume/host_path:all-srcs", + "//pkg/volume/hostpath:all-srcs", "//pkg/volume/iscsi:all-srcs", "//pkg/volume/local:all-srcs", "//pkg/volume/nfs:all-srcs", diff --git a/pkg/volume/host_path/BUILD b/pkg/volume/hostpath/BUILD similarity index 96% rename from pkg/volume/host_path/BUILD rename to pkg/volume/hostpath/BUILD index 0c961173ba4..651159f6855 100644 --- a/pkg/volume/host_path/BUILD +++ b/pkg/volume/hostpath/BUILD @@ -12,7 +12,7 @@ go_library( "doc.go", "host_path.go", ], - importpath = "k8s.io/kubernetes/pkg/volume/host_path", + importpath = "k8s.io/kubernetes/pkg/volume/hostpath", deps = [ "//pkg/util/mount:go_default_library", "//pkg/volume:go_default_library", diff --git a/pkg/volume/host_path/OWNERS b/pkg/volume/hostpath/OWNERS similarity index 100% rename from pkg/volume/host_path/OWNERS rename to pkg/volume/hostpath/OWNERS diff --git a/pkg/volume/host_path/doc.go b/pkg/volume/hostpath/doc.go similarity index 80% rename from pkg/volume/host_path/doc.go rename to pkg/volume/hostpath/doc.go index 8d6ea5ffdfd..0d4051a946e 100644 --- a/pkg/volume/host_path/doc.go +++ b/pkg/volume/hostpath/doc.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package host_path contains the internal representation of hostPath +// Package hostpath contains the internal representation of hostPath // volumes. -package host_path // import "k8s.io/kubernetes/pkg/volume/host_path" +package hostpath // import "k8s.io/kubernetes/pkg/volume/hostpath" diff --git a/pkg/volume/host_path/host_path.go b/pkg/volume/hostpath/host_path.go similarity index 99% rename from pkg/volume/host_path/host_path.go rename to pkg/volume/hostpath/host_path.go index dfbe01bf272..070b12d0d82 100644 --- a/pkg/volume/host_path/host_path.go +++ b/pkg/volume/hostpath/host_path.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package host_path +package hostpath import ( "fmt" @@ -32,7 +32,7 @@ import ( "k8s.io/kubernetes/pkg/volume/validation" ) -// This is the primary entrypoint for volume plugins. +// ProbeVolumePlugins is the primary entrypoint for volume plugins. // The volumeConfig arg provides the ability to configure volume behavior. It is implemented as a pointer to allow nils. // The hostPathPlugin is used to store the volumeConfig and give it, when needed, to the func that Recycles. // Tests that exercise recycling should not use this func but instead use ProbeRecyclablePlugins() to override default behavior. diff --git a/pkg/volume/host_path/host_path_test.go b/pkg/volume/hostpath/host_path_test.go similarity index 99% rename from pkg/volume/host_path/host_path_test.go rename to pkg/volume/hostpath/host_path_test.go index 16c6697b640..ac2cd64eb32 100644 --- a/pkg/volume/host_path/host_path_test.go +++ b/pkg/volume/hostpath/host_path_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package host_path +package hostpath import ( "fmt" diff --git a/test/test_owners.csv b/test/test_owners.csv index 6ee4400bc33..8f3d51da648 100644 --- a/test/test_owners.csv +++ b/test/test_owners.csv @@ -818,7 +818,7 @@ k8s.io/kubernetes/pkg/volume/flocker,jbeda,1, k8s.io/kubernetes/pkg/volume/gcepd,saad-ali,0, k8s.io/kubernetes/pkg/volume/git_repo,davidopp,1, k8s.io/kubernetes/pkg/volume/glusterfs,tallclair,1, -k8s.io/kubernetes/pkg/volume/host_path,jbeda,1, +k8s.io/kubernetes/pkg/volume/hostpath,jbeda,1, k8s.io/kubernetes/pkg/volume/iscsi,cjcullen,1, k8s.io/kubernetes/pkg/volume/nfs,justinsb,1, k8s.io/kubernetes/pkg/volume/photon_pd,luomiao,0,