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
437f4640
Commit
437f4640
authored
Aug 29, 2017
by
jianglingxia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo about volumes
parent
80ea31fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
openstack_volumes.go
pkg/cloudprovider/providers/openstack/openstack_volumes.go
+7
-7
kubelet_volumes.go
pkg/kubelet/kubelet_volumes.go
+1
-1
No files found.
pkg/cloudprovider/providers/openstack/openstack_volumes.go
View file @
437f4640
...
...
@@ -209,7 +209,7 @@ func (os *OpenStack) OperationPending(diskName string) (bool, string, error) {
return
true
,
volumeStatus
,
nil
}
// Attaches given cinder volume to the compute running kubelet
// Attach
Disk attach
es given cinder volume to the compute running kubelet
func
(
os
*
OpenStack
)
AttachDisk
(
instanceID
,
volumeID
string
)
(
string
,
error
)
{
volume
,
err
:=
os
.
getVolume
(
volumeID
)
if
err
!=
nil
{
...
...
@@ -288,7 +288,7 @@ func (os *OpenStack) DetachDisk(instanceID, volumeID string) error {
return
nil
}
//
R
etrieves Volume by its ID.
//
getVolume r
etrieves Volume by its ID.
func
(
os
*
OpenStack
)
getVolume
(
volumeID
string
)
(
Volume
,
error
)
{
volumes
,
err
:=
os
.
volumeService
(
""
)
if
err
!=
nil
||
volumes
==
nil
{
...
...
@@ -298,7 +298,7 @@ func (os *OpenStack) getVolume(volumeID string) (Volume, error) {
return
volumes
.
getVolume
(
volumeID
)
}
// Create a volume of given size (in GiB)
// Create
Volume creates
a volume of given size (in GiB)
func
(
os
*
OpenStack
)
CreateVolume
(
name
string
,
size
int
,
vtype
,
availability
string
,
tags
*
map
[
string
]
string
)
(
string
,
string
,
error
)
{
volumes
,
err
:=
os
.
volumeService
(
""
)
if
err
!=
nil
||
volumes
==
nil
{
...
...
@@ -378,7 +378,7 @@ func (os *OpenStack) DeleteVolume(volumeID string) error {
}
// Get device path of attached volume to the compute running kubelet, as known by cinder
// Get
AttachmentDiskPath gets
device path of attached volume to the compute running kubelet, as known by cinder
func
(
os
*
OpenStack
)
GetAttachmentDiskPath
(
instanceID
,
volumeID
string
)
(
string
,
error
)
{
// See issue #33128 - Cinder does not always tell you the right device path, as such
// we must only use this value as a last resort.
...
...
@@ -405,7 +405,7 @@ func (os *OpenStack) GetAttachmentDiskPath(instanceID, volumeID string) (string,
return
""
,
fmt
.
Errorf
(
"volume %s has no ServerId."
,
volumeID
)
}
//
query
if a volume is attached to a compute instance
//
DiskIsAttached queries
if a volume is attached to a compute instance
func
(
os
*
OpenStack
)
DiskIsAttached
(
instanceID
,
volumeID
string
)
(
bool
,
error
)
{
volume
,
err
:=
os
.
getVolume
(
volumeID
)
if
err
!=
nil
{
...
...
@@ -415,7 +415,7 @@ func (os *OpenStack) DiskIsAttached(instanceID, volumeID string) (bool, error) {
return
instanceID
==
volume
.
AttachedServerId
,
nil
}
//
query
if a list of volumes are attached to a compute instance
//
DisksAreAttached queries
if a list of volumes are attached to a compute instance
func
(
os
*
OpenStack
)
DisksAreAttached
(
instanceID
string
,
volumeIDs
[]
string
)
(
map
[
string
]
bool
,
error
)
{
attached
:=
make
(
map
[
string
]
bool
)
for
_
,
volumeID
:=
range
volumeIDs
{
...
...
@@ -434,7 +434,7 @@ func (os *OpenStack) diskIsUsed(volumeID string) (bool, error) {
return
volume
.
AttachedServerId
!=
""
,
nil
}
//
query
if we should trust the cinder provide deviceName, See issue #33128
//
ShouldTrustDevicePath queries
if we should trust the cinder provide deviceName, See issue #33128
func
(
os
*
OpenStack
)
ShouldTrustDevicePath
()
bool
{
return
os
.
bsOpts
.
TrustDevicePath
}
...
...
pkg/kubelet/kubelet_volumes.go
View file @
437f4640
...
...
@@ -126,7 +126,7 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(pods []*v1.Pod, runningPods []*kubecon
logSpew
:=
func
(
errs
[]
error
)
{
if
len
(
errs
)
>
0
{
glog
.
Errorf
(
"%v : There were a total of %v errors similar to this.
Turn up verbosity to see them."
,
errs
[
0
],
len
(
errs
))
glog
.
Errorf
(
"%v : There were a total of %v errors similar to this. Turn up verbosity to see them."
,
errs
[
0
],
len
(
errs
))
for
_
,
err
:=
range
errs
{
glog
.
V
(
5
)
.
Infof
(
"Orphan pod: %v"
,
err
)
}
...
...
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