Skip to content
Permalink
Browse files

fix the golint issue 'gitUrl' to 'gitURL'

  • Loading branch information
kanozec committed Dec 3, 2019
1 parent 2a5010a commit edf005b7818c1a5cf517c2dacb9fd422ba6b4468
@@ -92,7 +92,7 @@ go_library(
"//pkg/volume/flexvolume:go_default_library",
"//pkg/volume/flocker:go_default_library",
"//pkg/volume/gcepd:go_default_library",
"//pkg/volume/git_repo:go_default_library",
"//pkg/volume/gitrepo:go_default_library",
"//pkg/volume/glusterfs:go_default_library",
"//pkg/volume/hostpath:go_default_library",
"//pkg/volume/iscsi:go_default_library",
@@ -34,7 +34,7 @@ import (
"k8s.io/kubernetes/pkg/volume/fc"
"k8s.io/kubernetes/pkg/volume/flexvolume"
"k8s.io/kubernetes/pkg/volume/flocker"
"k8s.io/kubernetes/pkg/volume/git_repo"
"k8s.io/kubernetes/pkg/volume/gitrepo"
"k8s.io/kubernetes/pkg/volume/glusterfs"
"k8s.io/kubernetes/pkg/volume/hostpath"
"k8s.io/kubernetes/pkg/volume/iscsi"
@@ -64,7 +64,7 @@ func ProbeVolumePlugins() []volume.VolumePlugin {
// If/when it does, see kube-controller-manager/app/plugins.go for example of using volume.VolumeConfig
allPlugins = appendLegacyProviderVolumes(allPlugins)
allPlugins = append(allPlugins, emptydir.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, git_repo.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, gitrepo.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, hostpath.ProbeVolumePlugins(volume.VolumeConfig{})...)
allPlugins = append(allPlugins, nfs.ProbeVolumePlugins(volume.VolumeConfig{})...)
allPlugins = append(allPlugins, secret.ProbeVolumePlugins()...)
@@ -40,7 +40,7 @@ go_library(
"//pkg/volume/emptydir:go_default_library",
"//pkg/volume/fc:go_default_library",
"//pkg/volume/flocker:go_default_library",
"//pkg/volume/git_repo:go_default_library",
"//pkg/volume/gitrepo:go_default_library",
"//pkg/volume/glusterfs:go_default_library",
"//pkg/volume/hostpath:go_default_library",
"//pkg/volume/iscsi:go_default_library",
@@ -41,7 +41,7 @@ import (
"k8s.io/kubernetes/pkg/volume/emptydir"
"k8s.io/kubernetes/pkg/volume/fc"
"k8s.io/kubernetes/pkg/volume/flocker"
"k8s.io/kubernetes/pkg/volume/git_repo"
"k8s.io/kubernetes/pkg/volume/gitrepo"
"k8s.io/kubernetes/pkg/volume/glusterfs"
"k8s.io/kubernetes/pkg/volume/hostpath"
"k8s.io/kubernetes/pkg/volume/iscsi"
@@ -70,7 +70,7 @@ type HollowKubelet struct {
func volumePlugins() []volume.VolumePlugin {
allPlugins := []volume.VolumePlugin{}
allPlugins = append(allPlugins, emptydir.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, git_repo.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, gitrepo.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, hostpath.ProbeVolumePlugins(volume.VolumeConfig{})...)
allPlugins = append(allPlugins, nfs.ProbeVolumePlugins(volume.VolumeConfig{})...)
allPlugins = append(allPlugins, secret.ProbeVolumePlugins()...)
@@ -93,7 +93,7 @@ filegroup(
"//pkg/volume/flexvolume:all-srcs",
"//pkg/volume/flocker:all-srcs",
"//pkg/volume/gcepd:all-srcs",
"//pkg/volume/git_repo:all-srcs",
"//pkg/volume/gitrepo:all-srcs",
"//pkg/volume/glusterfs:all-srcs",
"//pkg/volume/hostpath:all-srcs",
"//pkg/volume/iscsi:all-srcs",
@@ -10,9 +10,9 @@ go_library(
name = "go_default_library",
srcs = [
"doc.go",
"git_repo.go",
"gitrepo.go",
],
importpath = "k8s.io/kubernetes/pkg/volume/git_repo",
importpath = "k8s.io/kubernetes/pkg/volume/gitrepo",
deps = [
"//pkg/volume:go_default_library",
"//pkg/volume/util:go_default_library",
File renamed without changes.
@@ -14,5 +14,5 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package git_repo contains the internal representation of git repo volumes.
package git_repo // import "k8s.io/kubernetes/pkg/volume/git_repo"
// Package gitrepo contains the internal representation of git repo volumes.
package gitrepo // import "k8s.io/kubernetes/pkg/volume/gitrepo"
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package git_repo
package gitrepo

import (
"fmt"
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package git_repo
package gitrepo

import (
"fmt"
@@ -70,7 +70,7 @@ type expectedCommand struct {
}

func TestPlugin(t *testing.T) {
gitUrl := "https://github.com/kubernetes/kubernetes.git"
gitURL := "https://github.com/kubernetes/kubernetes.git"
revision := "2a30ce65c5ab586b98916d83385c5983edd353a1"

scenarios := []struct {
@@ -85,15 +85,15 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
Revision: revision,
Directory: "target_dir",
},
},
},
expecteds: []expectedCommand{
{
cmd: []string{"git", "clone", "--", gitUrl, "target_dir"},
cmd: []string{"git", "clone", "--", gitURL, "target_dir"},
dir: "",
},
{
@@ -113,14 +113,14 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
Directory: "target_dir",
},
},
},
expecteds: []expectedCommand{
{
cmd: []string{"git", "clone", "--", gitUrl, "target_dir"},
cmd: []string{"git", "clone", "--", gitURL, "target_dir"},
dir: "",
},
},
@@ -132,13 +132,13 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
},
},
},
expecteds: []expectedCommand{
{
cmd: []string{"git", "clone", "--", gitUrl},
cmd: []string{"git", "clone", "--", gitURL},
dir: "",
},
},
@@ -150,15 +150,15 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
Revision: revision,
Directory: "",
},
},
},
expecteds: []expectedCommand{
{
cmd: []string{"git", "clone", "--", gitUrl},
cmd: []string{"git", "clone", "--", gitURL},
dir: "",
},
{
@@ -178,15 +178,15 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
Revision: revision,
Directory: ".",
},
},
},
expecteds: []expectedCommand{
{
cmd: []string{"git", "clone", "--", gitUrl, "."},
cmd: []string{"git", "clone", "--", gitURL, "."},
dir: "",
},
{
@@ -206,15 +206,15 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
Revision: revision,
Directory: "./.",
},
},
},
expecteds: []expectedCommand{
{
cmd: []string{"git", "clone", "--", gitUrl, "./."},
cmd: []string{"git", "clone", "--", gitURL, "./."},
dir: "",
},
{
@@ -246,7 +246,7 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
Revision: "--bar",
},
},
@@ -259,7 +259,7 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitUrl,
Repository: gitURL,
Directory: "-b",
},
},
@@ -244,7 +244,7 @@ func GetPath(mounter volume.Mounter) (string, error) {
return path, nil
}

// UnmountViaEmptyDir delegates the tear down operation for secret, configmap, git_repo and downwardapi
// UnmountViaEmptyDir delegates the tear down operation for secret, configmap, gitrepo and downwardapi
// to empty_dir
func UnmountViaEmptyDir(dir string, host volume.VolumeHost, volName string, volSpec volume.Spec, podUID utypes.UID) error {
klog.V(3).Infof("Tearing down volume %v for pod %v at %v", volName, podUID, dir)
@@ -38,7 +38,7 @@ const (
// If you make them too low, you'll get flaky
// tests instead of failing ones if the race bug reappears.
// If you make volume counts or pod counts too high,
// the tests may fail because mounting configmap/git_repo
// the tests may fail because mounting configmap/gitrepo
// volumes is not very fast and the tests may time out
// waiting for pods to become Running.
// And of course the higher are the numbers, the
@@ -194,7 +194,7 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
// This test uses deprecated GitRepo VolumeSource so it MUST not be promoted to Conformance.
// To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod’s container.
// This projected volume maps approach can also be tested with secrets and downwardapi VolumeSource but are less prone to the race problem.
ginkgo.It("should not cause race condition when used for git_repo [Serial] [Slow]", func() {
ginkgo.It("should not cause race condition when used for gitrepo [Serial] [Slow]", func() {
gitURL, gitRepo, cleanup := createGitServer(f)
defer cleanup()
volumes, volumeMounts := makeGitRepoVolumes(gitURL, gitRepo)

0 comments on commit edf005b

Please sign in to comment.
You can’t perform that action at this time.