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
943040d8
Commit
943040d8
authored
Dec 05, 2017
by
zouyee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
outdent err block
parent
95552b07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
util.go
pkg/volume/util.go
+4
-6
No files found.
pkg/volume/util.go
View file @
943040d8
...
@@ -87,9 +87,8 @@ func internalRecycleVolumeByWatchingPodUntilCompletion(pvName string, pod *v1.Po
...
@@ -87,9 +87,8 @@ func internalRecycleVolumeByWatchingPodUntilCompletion(pvName string, pod *v1.Po
// Recycler will try again and the old pod will be hopefuly deleted
// Recycler will try again and the old pod will be hopefuly deleted
// at that time.
// at that time.
return
fmt
.
Errorf
(
"old recycler pod found, will retry later"
)
return
fmt
.
Errorf
(
"old recycler pod found, will retry later"
)
}
else
{
return
fmt
.
Errorf
(
"unexpected error creating recycler pod: %+v
\n
"
,
err
)
}
}
return
fmt
.
Errorf
(
"unexpected error creating recycler pod: %+v"
,
err
)
}
}
err
=
waitForPod
(
pod
,
recyclerClient
,
podCh
)
err
=
waitForPod
(
pod
,
recyclerClient
,
podCh
)
...
@@ -274,9 +273,8 @@ func CalculateTimeoutForVolume(minimumTimeout, timeoutIncrement int, pv *v1.Pers
...
@@ -274,9 +273,8 @@ func CalculateTimeoutForVolume(minimumTimeout, timeoutIncrement int, pv *v1.Pers
timeout
:=
(
pvSize
/
giSize
)
*
int64
(
timeoutIncrement
)
timeout
:=
(
pvSize
/
giSize
)
*
int64
(
timeoutIncrement
)
if
timeout
<
int64
(
minimumTimeout
)
{
if
timeout
<
int64
(
minimumTimeout
)
{
return
int64
(
minimumTimeout
)
return
int64
(
minimumTimeout
)
}
else
{
return
timeout
}
}
return
timeout
}
}
// RoundUpSize calculates how many allocation units are needed to accommodate
// RoundUpSize calculates how many allocation units are needed to accommodate
...
@@ -304,7 +302,7 @@ func GenerateVolumeName(clusterName, pvName string, maxLength int) string {
...
@@ -304,7 +302,7 @@ func GenerateVolumeName(clusterName, pvName string, maxLength int) string {
return
prefix
+
"-"
+
pvName
return
prefix
+
"-"
+
pvName
}
}
//
Check
if the path from the mounter is empty.
//
GetPath checks
if the path from the mounter is empty.
func
GetPath
(
mounter
Mounter
)
(
string
,
error
)
{
func
GetPath
(
mounter
Mounter
)
(
string
,
error
)
{
path
:=
mounter
.
GetPath
()
path
:=
mounter
.
GetPath
()
if
path
==
""
{
if
path
==
""
{
...
@@ -313,7 +311,7 @@ func GetPath(mounter Mounter) (string, error) {
...
@@ -313,7 +311,7 @@ func GetPath(mounter Mounter) (string, error) {
return
path
,
nil
return
path
,
nil
}
}
// ChooseZone implements our heuristics for choosing a zone for volume creation based on the volume name
// ChooseZone
ForVolume
implements our heuristics for choosing a zone for volume creation based on the volume name
// Volumes are generally round-robin-ed across all active zones, using the hash of the PVC Name.
// Volumes are generally round-robin-ed across all active zones, using the hash of the PVC Name.
// However, if the PVCName ends with `-<integer>`, we will hash the prefix, and then add the integer to the hash.
// However, if the PVCName ends with `-<integer>`, we will hash the prefix, and then add the integer to the hash.
// This means that a StatefulSet's volumes (`claimname-statefulsetname-id`) will spread across available zones,
// This means that a StatefulSet's volumes (`claimname-statefulsetname-id`) will spread across available zones,
...
...
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