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
6a88a03d
Commit
6a88a03d
authored
Jun 28, 2017
by
Johannes Scheuermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set a Quobyte quota for newly created volumes
parent
343d751b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
quobyte_util.go
pkg/volume/quobyte/quobyte_util.go
+10
-2
No files found.
pkg/volume/quobyte/quobyte_util.go
View file @
6a88a03d
...
@@ -36,7 +36,7 @@ func (manager *quobyteVolumeManager) createVolume(provisioner *quobyteVolumeProv
...
@@ -36,7 +36,7 @@ func (manager *quobyteVolumeManager) createVolume(provisioner *quobyteVolumeProv
capacity
:=
provisioner
.
options
.
PVC
.
Spec
.
Resources
.
Requests
[
v1
.
ResourceName
(
v1
.
ResourceStorage
)]
capacity
:=
provisioner
.
options
.
PVC
.
Spec
.
Resources
.
Requests
[
v1
.
ResourceName
(
v1
.
ResourceStorage
)]
volumeSize
:=
int
(
volume
.
RoundUpSize
(
capacity
.
Value
(),
1024
*
1024
*
1024
))
volumeSize
:=
int
(
volume
.
RoundUpSize
(
capacity
.
Value
(),
1024
*
1024
*
1024
))
// Quobyte has the concept of Volumes which doen't have a specific size (they can grow unlimited)
// Quobyte has the concept of Volumes which doen't have a specific size (they can grow unlimited)
// to simulate a size constraint we
could set here a Quota
// to simulate a size constraint we
set here a Quota for logical space
volumeRequest
:=
&
quobyteapi
.
CreateVolumeRequest
{
volumeRequest
:=
&
quobyteapi
.
CreateVolumeRequest
{
Name
:
provisioner
.
volume
,
Name
:
provisioner
.
volume
,
RootUserID
:
provisioner
.
user
,
RootUserID
:
provisioner
.
user
,
...
@@ -45,7 +45,15 @@ func (manager *quobyteVolumeManager) createVolume(provisioner *quobyteVolumeProv
...
@@ -45,7 +45,15 @@ func (manager *quobyteVolumeManager) createVolume(provisioner *quobyteVolumeProv
ConfigurationName
:
provisioner
.
config
,
ConfigurationName
:
provisioner
.
config
,
}
}
if
_
,
err
:=
manager
.
createQuobyteClient
()
.
CreateVolume
(
volumeRequest
);
err
!=
nil
{
quobyteClient
:=
manager
.
createQuobyteClient
()
volumeUUID
,
err
:=
quobyteClient
.
CreateVolume
(
volumeRequest
)
if
err
!=
nil
{
return
&
v1
.
QuobyteVolumeSource
{},
volumeSize
,
err
}
// Set Quoate for Volume with specified byte size
err
=
quobyteClient
.
SetVolumeQuota
(
volumeUUID
,
capacity
.
Value
())
if
err
!=
nil
{
return
&
v1
.
QuobyteVolumeSource
{},
volumeSize
,
err
return
&
v1
.
QuobyteVolumeSource
{},
volumeSize
,
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