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
9f4a4d1f
Commit
9f4a4d1f
authored
May 21, 2019
by
Robert Krawitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log message rather than error if setting quota fails
parent
46b3c751
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
empty_dir.go
pkg/volume/emptydir/empty_dir.go
+15
-11
No files found.
pkg/volume/emptydir/empty_dir.go
View file @
9f4a4d1f
...
@@ -233,23 +233,27 @@ func (ed *emptyDir) SetUpAt(dir string, mounterArgs volume.MounterArgs) error {
...
@@ -233,23 +233,27 @@ func (ed *emptyDir) SetUpAt(dir string, mounterArgs volume.MounterArgs) error {
volume
.
SetVolumeOwnership
(
ed
,
mounterArgs
.
FsGroup
)
volume
.
SetVolumeOwnership
(
ed
,
mounterArgs
.
FsGroup
)
// If setting up the quota fails, just log a message but don't actually error out.
// We'll use the old du mechanism in this case, at least until we support
// enforcement.
if
err
==
nil
{
if
err
==
nil
{
volumeutil
.
SetReady
(
ed
.
getMetaDir
())
volumeutil
.
SetReady
(
ed
.
getMetaDir
())
}
if
mounterArgs
.
DesiredSize
!=
nil
{
if
mounterArgs
.
DesiredSize
!=
nil
{
// Deliberately shadow the outer use of err as noted
hasQuotas
,
err
:=
quota
.
SupportsQuotas
(
ed
.
mounter
,
dir
)
// above.
if
err
!=
nil
{
hasQuotas
,
err
:=
quota
.
SupportsQuotas
(
ed
.
mounter
,
dir
)
return
fmt
.
Errorf
(
"Unable to check for quota support on %s: %s"
,
dir
,
err
.
Error
())
}
if
hasQuotas
{
klog
.
V
(
4
)
.
Infof
(
"emptydir trying to assign quota %v on %s"
,
mounterArgs
.
DesiredSize
,
dir
)
err
:=
quota
.
AssignQuota
(
ed
.
mounter
,
dir
,
mounterArgs
.
PodUID
,
mounterArgs
.
DesiredSize
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Set quota on %s failed %s"
,
dir
,
err
.
Error
())
klog
.
V
(
3
)
.
Infof
(
"Unable to check for quota support on %s: %s"
,
dir
,
err
.
Error
())
}
else
if
hasQuotas
{
klog
.
V
(
4
)
.
Infof
(
"emptydir trying to assign quota %v on %s"
,
mounterArgs
.
DesiredSize
,
dir
)
err
:=
quota
.
AssignQuota
(
ed
.
mounter
,
dir
,
mounterArgs
.
PodUID
,
mounterArgs
.
DesiredSize
)
if
err
!=
nil
{
klog
.
V
(
3
)
.
Infof
(
"Set quota on %s failed %s"
,
dir
,
err
.
Error
())
}
}
}
}
}
}
}
return
nil
return
err
}
}
// setupTmpfs creates a tmpfs mount at the specified directory.
// setupTmpfs creates a tmpfs mount at the specified directory.
...
...
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