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
43c5326d
Commit
43c5326d
authored
Oct 05, 2018
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove VolumeSubpathEnvExpansion
parent
5fc28320
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
39 deletions
+4
-39
util.go
pkg/api/pod/util.go
+1
-1
kube_features.go
pkg/features/kube_features.go
+0
-8
helpers.go
pkg/kubelet/container/helpers.go
+1
-20
kubelet_pods.go
pkg/kubelet/kubelet_pods.go
+2
-10
No files found.
pkg/api/pod/util.go
View file @
43c5326d
...
@@ -350,7 +350,7 @@ func dropDisabledFields(
...
@@ -350,7 +350,7 @@ func dropDisabledFields(
}
}
}
}
if
(
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
VolumeSubpath
)
||
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
VolumeSubpathEnvExpansion
))
&&
!
subpathExprInUse
(
oldPodSpec
)
{
if
!
subpathExprInUse
(
oldPodSpec
)
{
// drop subpath env expansion from the pod if either of the subpath features is disabled and the old spec did not specify subpath env expansion
// drop subpath env expansion from the pod if either of the subpath features is disabled and the old spec did not specify subpath env expansion
for
i
:=
range
podSpec
.
Containers
{
for
i
:=
range
podSpec
.
Containers
{
for
j
:=
range
podSpec
.
Containers
[
i
]
.
VolumeMounts
{
for
j
:=
range
podSpec
.
Containers
[
i
]
.
VolumeMounts
{
...
...
pkg/features/kube_features.go
View file @
43c5326d
...
@@ -255,13 +255,6 @@ const (
...
@@ -255,13 +255,6 @@ const (
// Allow user to specify additional conditions to be evaluated for Pod readiness.
// Allow user to specify additional conditions to be evaluated for Pod readiness.
PodReadinessGates
utilfeature
.
Feature
=
"PodReadinessGates"
PodReadinessGates
utilfeature
.
Feature
=
"PodReadinessGates"
// owner: @kevtaylor
// alpha: v1.11
//
// Allow subpath environment variable substitution
// Only applicable if the VolumeSubpath feature is also enabled
VolumeSubpathEnvExpansion
utilfeature
.
Feature
=
"VolumeSubpathEnvExpansion"
// owner: @vikaschoudhary16
// owner: @vikaschoudhary16
// GA: v1.13
// GA: v1.13
//
//
...
@@ -419,7 +412,6 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -419,7 +412,6 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
CSIMigrationOpenStack
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
CSIMigrationOpenStack
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSubpath
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
VolumeSubpath
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
PodReadinessGates
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
PodReadinessGates
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
VolumeSubpathEnvExpansion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
KubeletPluginsWatcher
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
,
LockToDefault
:
true
},
// remove in 1.16
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
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSIBlockVolume
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
...
...
pkg/kubelet/container/helpers.go
View file @
43c5326d
...
@@ -23,11 +23,10 @@ import (
...
@@ -23,11 +23,10 @@ import (
"k8s.io/klog"
"k8s.io/klog"
"k8s.io/api/core/v1"
v1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/tools/record"
runtimeapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
runtimeapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/kubelet/util/format"
...
@@ -131,24 +130,6 @@ func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []v1.EnvVa
...
@@ -131,24 +130,6 @@ func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []v1.EnvVa
return
command
return
command
}
}
func
ExpandContainerVolumeMounts
(
mount
v1
.
VolumeMount
,
envs
[]
EnvVar
)
(
string
,
error
)
{
envmap
:=
EnvVarsToMap
(
envs
)
missingKeys
:=
sets
.
NewString
()
expanded
:=
expansion
.
Expand
(
mount
.
SubPathExpr
,
func
(
key
string
)
string
{
value
,
ok
:=
envmap
[
key
]
if
!
ok
||
len
(
value
)
==
0
{
missingKeys
.
Insert
(
key
)
}
return
value
})
if
len
(
missingKeys
)
>
0
{
return
""
,
fmt
.
Errorf
(
"missing value for %s"
,
strings
.
Join
(
missingKeys
.
List
(),
", "
))
}
return
expanded
,
nil
}
func
ExpandContainerCommandAndArgs
(
container
*
v1
.
Container
,
envs
[]
EnvVar
)
(
command
[]
string
,
args
[]
string
)
{
func
ExpandContainerCommandAndArgs
(
container
*
v1
.
Container
,
envs
[]
EnvVar
)
(
command
[]
string
,
args
[]
string
)
{
mapping
:=
expansion
.
MappingFuncFor
(
EnvVarsToMap
(
envs
))
mapping
:=
expansion
.
MappingFuncFor
(
EnvVarsToMap
(
envs
))
...
...
pkg/kubelet/kubelet_pods.go
View file @
43c5326d
...
@@ -32,7 +32,7 @@ import (
...
@@ -32,7 +32,7 @@ import (
"strings"
"strings"
"sync"
"sync"
"k8s.io/api/core/v1"
v1
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/errors"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/labels"
...
@@ -167,15 +167,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h
...
@@ -167,15 +167,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h
return
nil
,
cleanupAction
,
fmt
.
Errorf
(
"volume subpaths are disabled"
)
return
nil
,
cleanupAction
,
fmt
.
Errorf
(
"volume subpaths are disabled"
)
}
}
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
VolumeSubpathEnvExpansion
)
{
return
nil
,
cleanupAction
,
fmt
.
Errorf
(
"volume subpath expansion is disabled"
)
return
nil
,
cleanupAction
,
fmt
.
Errorf
(
"volume subpath expansion is disabled"
)
}
subPath
,
err
=
kubecontainer
.
ExpandContainerVolumeMounts
(
mount
,
expandEnvs
)
if
err
!=
nil
{
return
nil
,
cleanupAction
,
err
}
}
}
if
subPath
!=
""
{
if
subPath
!=
""
{
...
...
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