Skip to content

Commit 0e846e1

Browse files
committed
enable mount prop
run update schema
1 parent 6265a8e commit 0e846e1

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

cmd/schema-tweak/overrides.go

+4
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ func revSpecOverrides(prefixPath string) []entry {
227227
"mountPath",
228228
"subPath",
229229
),
230+
featureFlagFields: []flagField{{
231+
name: "mountPropagation",
232+
flag: config.FeaturePodSpecMountPropagation,
233+
}},
230234
}, {
231235
path: "volumes",
232236
allowedFields: sets.New(

config/core/300-resources/configuration.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,10 @@ spec:
926926
Path within the container at which the volume should be mounted. Must
927927
not contain ':'.
928928
type: string
929+
mountPropagation:
930+
description: |-
931+
This is accessible behind a feature flag - kubernetes.podspec-mount-propagation
932+
type: string
929933
name:
930934
description: This must match the Name of a Volume.
931935
type: string

config/core/300-resources/revision.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,10 @@ spec:
902902
Path within the container at which the volume should be mounted. Must
903903
not contain ':'.
904904
type: string
905+
mountPropagation:
906+
description: |-
907+
This is accessible behind a feature flag - kubernetes.podspec-mount-propagation
908+
type: string
905909
name:
906910
description: This must match the Name of a Volume.
907911
type: string

config/core/300-resources/service.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,10 @@ spec:
944944
Path within the container at which the volume should be mounted. Must
945945
not contain ':'.
946946
type: string
947+
mountPropagation:
948+
description: |-
949+
This is accessible behind a feature flag - kubernetes.podspec-mount-propagation
950+
type: string
947951
name:
948952
description: This must match the Name of a Volume.
949953
type: string

pkg/apis/config/features.go

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const (
6666
FeaturePodSpecHostPID = "kubernetes.podspec-hostpid"
6767
FeaturePodSpecHostPath = "kubernetes.podspec-volumes-hostpath"
6868
FeaturePodSpecInitContainers = "kubernetes.podspec-init-containers"
69+
FeaturePodSpecMountPropagation = "kubernetes.podspec-mount-propagation"
6970
FeaturePodSpecNodeSelector = "kubernetes.podspec-nodeselector"
7071
FeaturePodSpecPVClaim = "kubernetes.podspec-persistent-volume-claim"
7172
FeaturePodSpecPriorityClassName = "kubernetes.podspec-priorityclassname"
@@ -99,6 +100,7 @@ func defaultFeaturesConfig() *Features {
99100
PodSpecTolerations: Disabled,
100101
PodSpecVolumesEmptyDir: Enabled,
101102
PodSpecVolumesHostPath: Disabled,
103+
PodSpecVolumeMountPropagation: Disabled,
102104
PodSpecPersistentVolumeClaim: Disabled,
103105
PodSpecPersistentVolumeWrite: Disabled,
104106
QueueProxyMountPodInfo: Disabled,
@@ -139,6 +141,7 @@ func NewFeaturesConfigFromMap(data map[string]string) (*Features, error) {
139141
asFlag(FeaturePodSpecHostPID, &nc.PodSpecHostPID),
140142
asFlag(FeaturePodSpecHostPath, &nc.PodSpecVolumesHostPath),
141143
asFlag(FeaturePodSpecInitContainers, &nc.PodSpecInitContainers),
144+
asFlag(FeaturePodSpecMountPropagation, &nc.PodSpecVolumeMountPropagation),
142145
asFlag(FeaturePodSpecNodeSelector, &nc.PodSpecNodeSelector),
143146
asFlag(FeaturePodSpecPVClaim, &nc.PodSpecPersistentVolumeClaim),
144147
asFlag(FeaturePodSpecPriorityClassName, &nc.PodSpecPriorityClassName),
@@ -181,6 +184,7 @@ type Features struct {
181184
PodSpecTolerations Flag
182185
PodSpecVolumesEmptyDir Flag
183186
PodSpecVolumesHostPath Flag
187+
PodSpecVolumeMountPropagation Flag
184188
PodSpecInitContainers Flag
185189
PodSpecPersistentVolumeClaim Flag
186190
PodSpecPersistentVolumeWrite Flag

pkg/apis/serving/fieldmask.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,11 @@ func VolumeMountMask(in *corev1.VolumeMount) *corev1.VolumeMount {
345345
out.ReadOnly = in.ReadOnly
346346
out.MountPath = in.MountPath
347347
out.SubPath = in.SubPath
348+
out.MountPropagation = in.MountPropagation
348349

349350
// Disallowed fields
350351
// This list is unnecessary, but added here for clarity
351-
out.MountPropagation = nil
352+
out.RecursiveReadOnly = nil
352353

353354
return out
354355
}

0 commit comments

Comments
 (0)