Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
000e3008
Commit
000e3008
authored
Sep 04, 2018
by
Cheng Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix golint for pkg/volume/aws_ebs
parent
7bfd0d35
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
35 additions
and
34 deletions
+35
-34
BUILD
cmd/kube-controller-manager/app/BUILD
+1
-1
plugins.go
cmd/kube-controller-manager/app/plugins.go
+4
-4
BUILD
cmd/kubelet/app/BUILD
+1
-1
plugins.go
cmd/kubelet/app/plugins.go
+2
-2
.golint_failures
hack/.golint_failures
+0
-1
BUILD
pkg/kubelet/BUILD
+1
-1
kubelet_test.go
pkg/kubelet/kubelet_test.go
+2
-2
BUILD
pkg/volume/BUILD
+1
-1
BUILD
pkg/volume/awsebs/BUILD
+1
-1
OWNERS
pkg/volume/awsebs/OWNERS
+0
-0
attacher.go
pkg/volume/awsebs/attacher.go
+4
-4
attacher_test.go
pkg/volume/awsebs/attacher_test.go
+3
-3
aws_ebs.go
pkg/volume/awsebs/aws_ebs.go
+2
-2
aws_ebs_block.go
pkg/volume/awsebs/aws_ebs_block.go
+1
-1
aws_ebs_block_test.go
pkg/volume/awsebs/aws_ebs_block_test.go
+1
-1
aws_ebs_test.go
pkg/volume/awsebs/aws_ebs_test.go
+1
-1
aws_util.go
pkg/volume/awsebs/aws_util.go
+7
-5
doc.go
pkg/volume/awsebs/doc.go
+2
-2
test_owners.csv
test/test_owners.csv
+1
-1
No files found.
cmd/kube-controller-manager/app/BUILD
View file @
000e3008
...
...
@@ -84,7 +84,7 @@ go_library(
"//pkg/version:go_default_library",
"//pkg/version/verflag:go_default_library",
"//pkg/volume:go_default_library",
"//pkg/volume/aws
_
ebs:go_default_library",
"//pkg/volume/awsebs:go_default_library",
"//pkg/volume/azure_dd:go_default_library",
"//pkg/volume/azure_file:go_default_library",
"//pkg/volume/cinder:go_default_library",
...
...
cmd/kube-controller-manager/app/plugins.go
View file @
000e3008
...
...
@@ -30,7 +30,7 @@ import (
_
"k8s.io/kubernetes/pkg/cloudprovider/providers"
// Volume plugins
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/aws
_
ebs"
"k8s.io/kubernetes/pkg/volume/awsebs"
"k8s.io/kubernetes/pkg/volume/azure_dd"
"k8s.io/kubernetes/pkg/volume/azure_file"
"k8s.io/kubernetes/pkg/volume/cinder"
...
...
@@ -66,7 +66,7 @@ import (
func
ProbeAttachableVolumePlugins
()
[]
volume
.
VolumePlugin
{
allPlugins
:=
[]
volume
.
VolumePlugin
{}
allPlugins
=
append
(
allPlugins
,
aws
_
ebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
awsebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
gce_pd
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
cinder
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
portworx
.
ProbeVolumePlugins
()
...
)
...
...
@@ -95,7 +95,7 @@ func GetDynamicPluginProber(config kubectrlmgrconfig.VolumeConfiguration) volume
func
ProbeExpandableVolumePlugins
(
config
kubectrlmgrconfig
.
VolumeConfiguration
)
[]
volume
.
VolumePlugin
{
allPlugins
:=
[]
volume
.
VolumePlugin
{}
allPlugins
=
append
(
allPlugins
,
aws
_
ebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
awsebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
gce_pd
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
cinder
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
portworx
.
ProbeVolumePlugins
()
...
)
...
...
@@ -158,7 +158,7 @@ func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, config kubectrl
allPlugins
=
append
(
allPlugins
,
local
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
storageos
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
aws
_
ebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
awsebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
gce_pd
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
cinder
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
vsphere_volume
.
ProbeVolumePlugins
()
...
)
...
...
cmd/kubelet/app/BUILD
View file @
000e3008
...
...
@@ -69,7 +69,7 @@ go_library(
"//pkg/version:go_default_library",
"//pkg/version/verflag:go_default_library",
"//pkg/volume:go_default_library",
"//pkg/volume/aws
_
ebs:go_default_library",
"//pkg/volume/awsebs:go_default_library",
"//pkg/volume/azure_dd:go_default_library",
"//pkg/volume/azure_file:go_default_library",
"//pkg/volume/cephfs:go_default_library",
...
...
cmd/kubelet/app/plugins.go
View file @
000e3008
...
...
@@ -26,7 +26,7 @@ import (
"k8s.io/utils/exec"
// Volume plugins
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/aws
_
ebs"
"k8s.io/kubernetes/pkg/volume/awsebs"
"k8s.io/kubernetes/pkg/volume/azure_dd"
"k8s.io/kubernetes/pkg/volume/azure_file"
"k8s.io/kubernetes/pkg/volume/cephfs"
...
...
@@ -71,7 +71,7 @@ func ProbeVolumePlugins() []volume.VolumePlugin {
//
// Kubelet does not currently need to configure volume plugins.
// If/when it does, see kube-controller-manager/app/plugins.go for example of using volume.VolumeConfig
allPlugins
=
append
(
allPlugins
,
aws
_
ebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
awsebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
empty_dir
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
gce_pd
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
git_repo
.
ProbeVolumePlugins
()
...
)
...
...
hack/.golint_failures
View file @
000e3008
...
...
@@ -401,7 +401,6 @@ pkg/util/tolerations
pkg/util/workqueue/prometheus
pkg/version/verflag
pkg/volume
pkg/volume/aws_ebs
pkg/volume/azure_dd
pkg/volume/azure_file
pkg/volume/cephfs
...
...
pkg/kubelet/BUILD
View file @
000e3008
...
...
@@ -210,7 +210,7 @@ go_test(
"//pkg/util/taints:go_default_library",
"//pkg/version:go_default_library",
"//pkg/volume:go_default_library",
"//pkg/volume/aws
_
ebs:go_default_library",
"//pkg/volume/awsebs:go_default_library",
"//pkg/volume/azure_dd:go_default_library",
"//pkg/volume/gce_pd:go_default_library",
"//pkg/volume/host_path:go_default_library",
...
...
pkg/kubelet/kubelet_test.go
View file @
000e3008
...
...
@@ -68,7 +68,7 @@ import (
schedulercache
"k8s.io/kubernetes/pkg/scheduler/cache"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/aws
_
ebs"
"k8s.io/kubernetes/pkg/volume/awsebs"
"k8s.io/kubernetes/pkg/volume/azure_dd"
"k8s.io/kubernetes/pkg/volume/gce_pd"
_
"k8s.io/kubernetes/pkg/volume/host_path"
...
...
@@ -313,7 +313,7 @@ func newTestKubeletWithImageList(
if
initFakeVolumePlugin
{
allPlugins
=
append
(
allPlugins
,
plug
)
}
else
{
allPlugins
=
append
(
allPlugins
,
aws
_
ebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
awsebs
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
gce_pd
.
ProbeVolumePlugins
()
...
)
allPlugins
=
append
(
allPlugins
,
azure_dd
.
ProbeVolumePlugins
()
...
)
}
...
...
pkg/volume/BUILD
View file @
000e3008
...
...
@@ -69,7 +69,7 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//pkg/volume/aws
_
ebs:all-srcs",
"//pkg/volume/awsebs:all-srcs",
"//pkg/volume/azure_dd:all-srcs",
"//pkg/volume/azure_file:all-srcs",
"//pkg/volume/cephfs:all-srcs",
...
...
pkg/volume/aws
_
ebs/BUILD
→
pkg/volume/awsebs/BUILD
View file @
000e3008
...
...
@@ -15,7 +15,7 @@ go_library(
"aws_util.go",
"doc.go",
],
importpath = "k8s.io/kubernetes/pkg/volume/aws
_
ebs",
importpath = "k8s.io/kubernetes/pkg/volume/awsebs",
deps = [
"//pkg/cloudprovider:go_default_library",
"//pkg/cloudprovider/providers/aws:go_default_library",
...
...
pkg/volume/aws
_
ebs/OWNERS
→
pkg/volume/awsebs/OWNERS
View file @
000e3008
File moved
pkg/volume/aws
_
ebs/attacher.go
→
pkg/volume/awsebs/attacher.go
View file @
000e3008
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
aws
_
ebs
package
awsebs
import
(
"fmt"
...
...
@@ -163,7 +163,7 @@ func (attacher *awsElasticBlockStoreAttacher) WaitForAttach(spec *volume.Spec, d
}
if
devicePath
==
""
{
return
""
,
fmt
.
Errorf
(
"
WaitForAttach failed for AWS Volume %q: devicePath is empty.
"
,
volumeID
)
return
""
,
fmt
.
Errorf
(
"
waitForAttach failed for AWS Volume %q: devicePath is empty
"
,
volumeID
)
}
ticker
:=
time
.
NewTicker
(
checkSleepDuration
)
...
...
@@ -175,7 +175,7 @@ func (attacher *awsElasticBlockStoreAttacher) WaitForAttach(spec *volume.Spec, d
select
{
case
<-
ticker
.
C
:
glog
.
V
(
5
)
.
Infof
(
"Checking AWS Volume %q is attached."
,
volumeID
)
devicePaths
:=
getDiskByI
d
Paths
(
aws
.
KubernetesVolumeID
(
volumeSource
.
VolumeID
),
partition
,
devicePath
)
devicePaths
:=
getDiskByI
D
Paths
(
aws
.
KubernetesVolumeID
(
volumeSource
.
VolumeID
),
partition
,
devicePath
)
path
,
err
:=
verifyDevicePath
(
devicePaths
)
if
err
!=
nil
{
// Log error, if any, and continue checking periodically. See issue #11321
...
...
@@ -186,7 +186,7 @@ func (attacher *awsElasticBlockStoreAttacher) WaitForAttach(spec *volume.Spec, d
return
path
,
nil
}
case
<-
timer
.
C
:
return
""
,
fmt
.
Errorf
(
"
Could not find attached AWS Volume %q. Timeout waiting for mount paths to be created.
"
,
volumeID
)
return
""
,
fmt
.
Errorf
(
"
could not find attached AWS Volume %q. Timeout waiting for mount paths to be created
"
,
volumeID
)
}
}
}
...
...
pkg/volume/aws
_
ebs/attacher_test.go
→
pkg/volume/awsebs/attacher_test.go
View file @
000e3008
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
aws
_
ebs
package
awsebs
import
(
"errors"
...
...
@@ -219,7 +219,7 @@ func (testcase *testcase) AttachDisk(diskName aws.KubernetesVolumeID, nodeName t
// testcase.attach looks uninitialized, test did not expect to call
// AttachDisk
testcase
.
t
.
Errorf
(
"Unexpected AttachDisk call!"
)
return
""
,
errors
.
New
(
"
Unexpected AttachDisk call!
"
)
return
""
,
errors
.
New
(
"
unexpected AttachDisk call
"
)
}
if
expected
.
diskName
!=
diskName
{
...
...
@@ -244,7 +244,7 @@ func (testcase *testcase) DetachDisk(diskName aws.KubernetesVolumeID, nodeName t
// testcase.detach looks uninitialized, test did not expect to call
// DetachDisk
testcase
.
t
.
Errorf
(
"Unexpected DetachDisk call!"
)
return
""
,
errors
.
New
(
"
Unexpected DetachDisk call!
"
)
return
""
,
errors
.
New
(
"
unexpected DetachDisk call
"
)
}
if
expected
.
diskName
!=
diskName
{
...
...
pkg/volume/aws
_
ebs/aws_ebs.go
→
pkg/volume/awsebs/aws_ebs.go
View file @
000e3008
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
aws
_
ebs
package
awsebs
import
(
"context"
...
...
@@ -39,7 +39,7 @@ import (
"k8s.io/kubernetes/pkg/volume/util"
)
//
Thi
s is the primary entrypoint for volume plugins.
//
ProbeVolumePlugin
s is the primary entrypoint for volume plugins.
func
ProbeVolumePlugins
()
[]
volume
.
VolumePlugin
{
return
[]
volume
.
VolumePlugin
{
&
awsElasticBlockStorePlugin
{
nil
}}
}
...
...
pkg/volume/aws
_
ebs/aws_ebs_block.go
→
pkg/volume/awsebs/aws_ebs_block.go
View file @
000e3008
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
aws
_
ebs
package
awsebs
import
(
"fmt"
...
...
pkg/volume/aws
_
ebs/aws_ebs_block_test.go
→
pkg/volume/awsebs/aws_ebs_block_test.go
View file @
000e3008
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
aws
_
ebs
package
awsebs
import
(
"os"
...
...
pkg/volume/aws
_
ebs/aws_ebs_test.go
→
pkg/volume/awsebs/aws_ebs_test.go
View file @
000e3008
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
aws
_
ebs
package
awsebs
import
(
"fmt"
...
...
pkg/volume/aws
_
ebs/aws_util.go
→
pkg/volume/awsebs/aws_util.go
View file @
000e3008
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
aws
_
ebs
package
awsebs
import
(
"fmt"
...
...
@@ -45,8 +45,10 @@ const (
ebsMaxReplicasInAZ
=
1
)
// AWSDiskUtil provides operations for EBS volume.
type
AWSDiskUtil
struct
{}
// DeleteVolume deletes an AWS EBS volume.
func
(
util
*
AWSDiskUtil
)
DeleteVolume
(
d
*
awsElasticBlockStoreDeleter
)
error
{
cloud
,
err
:=
getCloudProvider
(
d
.
awsElasticBlockStore
.
plugin
.
host
.
GetCloudProvider
())
if
err
!=
nil
{
...
...
@@ -198,11 +200,11 @@ func verifyDevicePath(devicePaths []string) (string, error) {
func
verifyAllPathsRemoved
(
devicePaths
[]
string
)
(
bool
,
error
)
{
allPathsRemoved
:=
true
for
_
,
path
:=
range
devicePaths
{
if
exists
,
err
:=
volumeutil
.
PathExists
(
path
);
err
!=
nil
{
exists
,
err
:=
volumeutil
.
PathExists
(
path
)
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Error checking if path exists: %v"
,
err
)
}
else
{
allPathsRemoved
=
allPathsRemoved
&&
!
exists
}
allPathsRemoved
=
allPathsRemoved
&&
!
exists
}
return
allPathsRemoved
,
nil
...
...
@@ -211,7 +213,7 @@ func verifyAllPathsRemoved(devicePaths []string) (bool, error) {
// Returns list of all paths for given EBS mount
// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id)
// Here it is mostly about applying the partition path
func
getDiskByI
d
Paths
(
volumeID
aws
.
KubernetesVolumeID
,
partition
string
,
devicePath
string
)
[]
string
{
func
getDiskByI
D
Paths
(
volumeID
aws
.
KubernetesVolumeID
,
partition
string
,
devicePath
string
)
[]
string
{
devicePaths
:=
[]
string
{}
if
devicePath
!=
""
{
devicePaths
=
append
(
devicePaths
,
devicePath
)
...
...
pkg/volume/aws
_
ebs/doc.go
→
pkg/volume/awsebs/doc.go
View file @
000e3008
...
...
@@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package aws
_
ebs contains the internal representation of AWS Elastic
// Package awsebs contains the internal representation of AWS Elastic
// Block Store volumes.
package
aws
_ebs
// import "k8s.io/kubernetes/pkg/volume/aws_
ebs"
package
aws
ebs
// import "k8s.io/kubernetes/pkg/volume/aws
ebs"
test/test_owners.csv
View file @
000e3008
...
...
@@ -811,7 +811,7 @@ k8s.io/kubernetes/pkg/util/term,davidopp,1,
k8s.io/kubernetes/pkg/util/threading,roberthbailey,1,
k8s.io/kubernetes/pkg/util/version,danwinship,0,
k8s.io/kubernetes/pkg/volume,saad-ali,0,
k8s.io/kubernetes/pkg/volume/aws
_
ebs,caesarxuchao,1,
k8s.io/kubernetes/pkg/volume/awsebs,caesarxuchao,1,
k8s.io/kubernetes/pkg/volume/azure_dd,bgrant0607,1,
k8s.io/kubernetes/pkg/volume/azure_file,maisem,1,
k8s.io/kubernetes/pkg/volume/cephfs,eparis,1,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment