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
08330c37
Commit
08330c37
authored
Mar 01, 2019
by
Michelle Au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lock csi and plugin watcher GA feature gates
parent
a352b74b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
68 deletions
+2
-68
util.go
pkg/api/persistentvolume/util.go
+0
-6
util_test.go
pkg/api/persistentvolume/util_test.go
+0
-52
kube_features.go
pkg/features/kube_features.go
+2
-2
node_test.go
test/integration/auth/node_test.go
+0
-8
No files found.
pkg/api/persistentvolume/util.go
View file @
08330c37
...
@@ -28,12 +28,6 @@ func DropDisabledFields(pvSpec *api.PersistentVolumeSpec, oldPVSpec *api.Persist
...
@@ -28,12 +28,6 @@ func DropDisabledFields(pvSpec *api.PersistentVolumeSpec, oldPVSpec *api.Persist
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
BlockVolume
)
&&
!
volumeModeInUse
(
oldPVSpec
)
{
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
BlockVolume
)
&&
!
volumeModeInUse
(
oldPVSpec
)
{
pvSpec
.
VolumeMode
=
nil
pvSpec
.
VolumeMode
=
nil
}
}
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
CSIPersistentVolume
)
{
// if this is a new PV, or the old PV didn't already have the CSI field, clear it
if
oldPVSpec
==
nil
||
oldPVSpec
.
PersistentVolumeSource
.
CSI
==
nil
{
pvSpec
.
PersistentVolumeSource
.
CSI
=
nil
}
}
}
}
func
volumeModeInUse
(
oldPVSpec
*
api
.
PersistentVolumeSpec
)
bool
{
func
volumeModeInUse
(
oldPVSpec
*
api
.
PersistentVolumeSpec
)
bool
{
...
...
pkg/api/persistentvolume/util_test.go
View file @
08330c37
...
@@ -28,12 +28,6 @@ import (
...
@@ -28,12 +28,6 @@ import (
)
)
func
TestDropDisabledFields
(
t
*
testing
.
T
)
{
func
TestDropDisabledFields
(
t
*
testing
.
T
)
{
specWithCSI
:=
func
()
*
api
.
PersistentVolumeSpec
{
return
&
api
.
PersistentVolumeSpec
{
PersistentVolumeSource
:
api
.
PersistentVolumeSource
{
CSI
:
&
api
.
CSIPersistentVolumeSource
{}}}
}
specWithoutCSI
:=
func
()
*
api
.
PersistentVolumeSpec
{
return
&
api
.
PersistentVolumeSpec
{
PersistentVolumeSource
:
api
.
PersistentVolumeSource
{
CSI
:
nil
}}
}
specWithMode
:=
func
(
mode
*
api
.
PersistentVolumeMode
)
*
api
.
PersistentVolumeSpec
{
specWithMode
:=
func
(
mode
*
api
.
PersistentVolumeMode
)
*
api
.
PersistentVolumeSpec
{
return
&
api
.
PersistentVolumeSpec
{
VolumeMode
:
mode
}
return
&
api
.
PersistentVolumeSpec
{
VolumeMode
:
mode
}
}
}
...
@@ -45,53 +39,8 @@ func TestDropDisabledFields(t *testing.T) {
...
@@ -45,53 +39,8 @@ func TestDropDisabledFields(t *testing.T) {
newSpec
*
api
.
PersistentVolumeSpec
newSpec
*
api
.
PersistentVolumeSpec
expectOldSpec
*
api
.
PersistentVolumeSpec
expectOldSpec
*
api
.
PersistentVolumeSpec
expectNewSpec
*
api
.
PersistentVolumeSpec
expectNewSpec
*
api
.
PersistentVolumeSpec
csiEnabled
bool
blockEnabled
bool
blockEnabled
bool
}{
}{
"disabled csi clears new"
:
{
csiEnabled
:
false
,
newSpec
:
specWithCSI
(),
expectNewSpec
:
specWithoutCSI
(),
oldSpec
:
nil
,
expectOldSpec
:
nil
,
},
"disabled csi clears update when old pv did not use csi"
:
{
csiEnabled
:
false
,
newSpec
:
specWithCSI
(),
expectNewSpec
:
specWithoutCSI
(),
oldSpec
:
specWithoutCSI
(),
expectOldSpec
:
specWithoutCSI
(),
},
"disabled csi preserves update when old pv did use csi"
:
{
csiEnabled
:
false
,
newSpec
:
specWithCSI
(),
expectNewSpec
:
specWithCSI
(),
oldSpec
:
specWithCSI
(),
expectOldSpec
:
specWithCSI
(),
},
"enabled csi preserves new"
:
{
csiEnabled
:
true
,
newSpec
:
specWithCSI
(),
expectNewSpec
:
specWithCSI
(),
oldSpec
:
nil
,
expectOldSpec
:
nil
,
},
"enabled csi preserves update when old pv did not use csi"
:
{
csiEnabled
:
true
,
newSpec
:
specWithCSI
(),
expectNewSpec
:
specWithCSI
(),
oldSpec
:
specWithoutCSI
(),
expectOldSpec
:
specWithoutCSI
(),
},
"enabled csi preserves update when old pv did use csi"
:
{
csiEnabled
:
true
,
newSpec
:
specWithCSI
(),
expectNewSpec
:
specWithCSI
(),
oldSpec
:
specWithCSI
(),
expectOldSpec
:
specWithCSI
(),
},
"disabled block clears new"
:
{
"disabled block clears new"
:
{
blockEnabled
:
false
,
blockEnabled
:
false
,
newSpec
:
specWithMode
(
&
modeBlock
),
newSpec
:
specWithMode
(
&
modeBlock
),
...
@@ -139,7 +88,6 @@ func TestDropDisabledFields(t *testing.T) {
...
@@ -139,7 +88,6 @@ func TestDropDisabledFields(t *testing.T) {
for
name
,
tc
:=
range
tests
{
for
name
,
tc
:=
range
tests
{
t
.
Run
(
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
name
,
func
(
t
*
testing
.
T
)
{
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
CSIPersistentVolume
,
tc
.
csiEnabled
)()
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
BlockVolume
,
tc
.
blockEnabled
)()
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
BlockVolume
,
tc
.
blockEnabled
)()
DropDisabledFields
(
tc
.
newSpec
,
tc
.
oldSpec
)
DropDisabledFields
(
tc
.
newSpec
,
tc
.
oldSpec
)
...
...
pkg/features/kube_features.go
View file @
08330c37
...
@@ -449,7 +449,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -449,7 +449,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
ServiceNodeExclusion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ServiceNodeExclusion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
MountContainers
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
MountContainers
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeScheduling
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
VolumeScheduling
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
CSIPersistentVolume
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
CSIPersistentVolume
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
CSIDriverRegistry
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSIDriverRegistry
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSINodeInfo
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSINodeInfo
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CustomPodDNS
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
CustomPodDNS
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
...
@@ -474,7 +474,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -474,7 +474,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
BalanceAttachedNodeVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
BalanceAttachedNodeVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
PodReadinessGates
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
PodReadinessGates
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
VolumeSubpathEnvExpansion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSubpathEnvExpansion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
KubeletPluginsWatcher
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
KubeletPluginsWatcher
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
ResourceQuotaScopeSelectors
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ResourceQuotaScopeSelectors
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSIBlockVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
CSIBlockVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
RuntimeClass
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
RuntimeClass
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
...
...
test/integration/auth/node_test.go
View file @
08330c37
...
@@ -56,9 +56,6 @@ func TestNodeAuthorizer(t *testing.T) {
...
@@ -56,9 +56,6 @@ func TestNodeAuthorizer(t *testing.T) {
tokenNode2
=
"node2-token"
tokenNode2
=
"node2-token"
)
)
// Enabled CSIPersistentVolume feature at startup so volumeattachments get watched
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
CSIPersistentVolume
,
true
)()
// Enable DynamicKubeletConfig feature so that Node.Spec.ConfigSource can be set
// Enable DynamicKubeletConfig feature so that Node.Spec.ConfigSource can be set
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
DynamicKubeletConfig
,
true
)()
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
DynamicKubeletConfig
,
true
)()
...
@@ -576,12 +573,7 @@ func TestNodeAuthorizer(t *testing.T) {
...
@@ -576,12 +573,7 @@ func TestNodeAuthorizer(t *testing.T) {
expectAllowed
(
t
,
updatePVCCapacity
(
node2Client
))
expectAllowed
(
t
,
updatePVCCapacity
(
node2Client
))
expectForbidden
(
t
,
updatePVCPhase
(
node2Client
))
expectForbidden
(
t
,
updatePVCPhase
(
node2Client
))
// Disabled CSIPersistentVolume feature
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
CSIPersistentVolume
,
false
)()
expectForbidden
(
t
,
getVolumeAttachment
(
node1ClientExternal
))
expectForbidden
(
t
,
getVolumeAttachment
(
node2ClientExternal
))
// Enabled CSIPersistentVolume feature
// Enabled CSIPersistentVolume feature
defer
utilfeaturetesting
.
SetFeatureGateDuringTest
(
t
,
utilfeature
.
DefaultFeatureGate
,
features
.
CSIPersistentVolume
,
true
)()
expectForbidden
(
t
,
getVolumeAttachment
(
node1ClientExternal
))
expectForbidden
(
t
,
getVolumeAttachment
(
node1ClientExternal
))
expectAllowed
(
t
,
getVolumeAttachment
(
node2ClientExternal
))
expectAllowed
(
t
,
getVolumeAttachment
(
node2ClientExternal
))
...
...
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