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
575f79e0
Commit
575f79e0
authored
Sep 28, 2018
by
Hemant Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable volume limit feature by default
Also add tests for it.
parent
c79ad5a6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
2 deletions
+10
-2
kube_features.go
pkg/features/kube_features.go
+1
-1
BUILD
pkg/volume/csi/nodeinfomanager/BUILD
+3
-0
nodeinfomanager.go
pkg/volume/csi/nodeinfomanager/nodeinfomanager.go
+6
-1
nodeinfomanager_test.go
pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go
+0
-0
No files found.
pkg/features/kube_features.go
View file @
575f79e0
...
@@ -408,7 +408,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -408,7 +408,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
QOSReserved
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
QOSReserved
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ExpandPersistentVolumes
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ExpandPersistentVolumes
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ExpandInUsePersistentVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ExpandInUsePersistentVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
AttachVolumeLimit
:
{
Default
:
fals
e
,
PreRelease
:
utilfeature
.
Beta
},
AttachVolumeLimit
:
{
Default
:
tru
e
,
PreRelease
:
utilfeature
.
Beta
},
CPUManager
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CPUManager
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CPUCFSQuotaPeriod
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
CPUCFSQuotaPeriod
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ServiceNodeExclusion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ServiceNodeExclusion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
...
...
pkg/volume/csi/nodeinfomanager/BUILD
View file @
575f79e0
...
@@ -43,10 +43,13 @@ go_test(
...
@@ -43,10 +43,13 @@ go_test(
embed = [":go_default_library"],
embed = [":go_default_library"],
deps = [
deps = [
"//pkg/apis/core/helper:go_default_library",
"//pkg/apis/core/helper:go_default_library",
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/features:go_default_library",
"//pkg/features:go_default_library",
"//pkg/volume/testing:go_default_library",
"//pkg/volume/testing:go_default_library",
"//pkg/volume/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
...
...
pkg/volume/csi/nodeinfomanager/nodeinfomanager.go
View file @
575f79e0
...
@@ -89,11 +89,16 @@ func (nim *nodeInfoManager) AddNodeInfo(driverName string, driverNodeID string,
...
@@ -89,11 +89,16 @@ func (nim *nodeInfoManager) AddNodeInfo(driverName string, driverNodeID string,
nodeUpdateFuncs
:=
[]
nodeUpdateFunc
{
nodeUpdateFuncs
:=
[]
nodeUpdateFunc
{
updateNodeIDInNode
(
driverName
,
driverNodeID
),
updateNodeIDInNode
(
driverName
,
driverNodeID
),
updateMaxAttachLimit
(
driverName
,
maxAttachLimit
),
}
}
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
CSINodeInfo
)
{
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
CSINodeInfo
)
{
nodeUpdateFuncs
=
append
(
nodeUpdateFuncs
,
updateTopologyLabels
(
topology
))
nodeUpdateFuncs
=
append
(
nodeUpdateFuncs
,
updateTopologyLabels
(
topology
))
}
}
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
AttachVolumeLimit
)
{
nodeUpdateFuncs
=
append
(
nodeUpdateFuncs
,
updateMaxAttachLimit
(
driverName
,
maxAttachLimit
))
}
err
:=
nim
.
updateNode
(
nodeUpdateFuncs
...
)
err
:=
nim
.
updateNode
(
nodeUpdateFuncs
...
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error updating Node object with CSI driver node info: %v"
,
err
)
return
fmt
.
Errorf
(
"error updating Node object with CSI driver node info: %v"
,
err
)
...
...
pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go
View file @
575f79e0
This diff is collapsed.
Click to expand it.
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