@@ -69,6 +69,7 @@ import (
6969 "k8s.io/kubernetes/pkg/volume/util/volumepathhandler"
7070 volumevalidation "k8s.io/kubernetes/pkg/volume/validation"
7171 "k8s.io/kubernetes/third_party/forked/golang/expansion"
72+ "k8s.io/utils/feature"
7273 utilnet "k8s.io/utils/net"
7374)
7475
@@ -348,7 +349,8 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h
348349 if err != nil {
349350 return nil , cleanupAction , fmt .Errorf ("failed to resolve recursive read-only mode: %w" , err )
350351 }
351- if rro && ! utilfeature .DefaultFeatureGate .Enabled (features .RecursiveReadOnlyMounts ) {
352+ if rro && ! utilfeature .DefaultFeatureGate .Enabled (features .RecursiveReadOnlyMounts ) &&
353+ ! feature .Enabled (features .RecursiveReadOnlyMountsGate ) {
352354 return nil , cleanupAction , fmt .Errorf ("recursive read-only mount needs feature gate %q to be enabled" , features .RecursiveReadOnlyMounts )
353355 }
354356
@@ -2136,7 +2138,8 @@ func (kl *Kubelet) convertToAPIContainerStatuses(pod *v1.Pod, podStatus *kubecon
21362138 }
21372139 // status.VolumeMounts cannot be propagated from kubecontainer.Status
21382140 // because the CRI API is unaware of the volume names.
2139- if utilfeature .DefaultFeatureGate .Enabled (features .RecursiveReadOnlyMounts ) {
2141+ if utilfeature .DefaultFeatureGate .Enabled (features .RecursiveReadOnlyMounts ) ||
2142+ feature .Enabled (features .RecursiveReadOnlyMountsGate ) {
21402143 for _ , vol := range container .VolumeMounts {
21412144 volStatus := v1.VolumeMountStatus {
21422145 Name : vol .Name ,
@@ -2148,7 +2151,8 @@ func (kl *Kubelet) convertToAPIContainerStatuses(pod *v1.Pod, podStatus *kubecon
21482151 if b , err := resolveRecursiveReadOnly (vol , supportsRRO ); err != nil {
21492152 klog .ErrorS (err , "failed to resolve recursive read-only mode" , "mode" , * vol .RecursiveReadOnly )
21502153 } else if b {
2151- if utilfeature .DefaultFeatureGate .Enabled (features .RecursiveReadOnlyMounts ) {
2154+ if utilfeature .DefaultFeatureGate .Enabled (features .RecursiveReadOnlyMounts ) ||
2155+ feature .Enabled (features .RecursiveReadOnlyMountsGate ) {
21522156 rroMode = v1 .RecursiveReadOnlyEnabled
21532157 } else {
21542158 klog .ErrorS (nil , "recursive read-only mount needs feature gate to be enabled" ,
0 commit comments