mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #64577 from gnufied/rename-online-resize-feature-gate
Automatic merge from submit-queue (batch tested with PRs 59938, 63777, 64577, 63999, 64431). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Rename online resizine feature gate This was left as a unaddressed comment from https://github.com/kubernetes/kubernetes/pull/62460 cc @saad-ali /sig storage ```release-note None ```
This commit is contained in:
commit
d922a4e497
@ -102,7 +102,7 @@ const (
|
|||||||
// owner: @mlmhl
|
// owner: @mlmhl
|
||||||
// alpha: v1.11
|
// alpha: v1.11
|
||||||
// Ability to expand persistent volumes' file system without unmounting volumes.
|
// Ability to expand persistent volumes' file system without unmounting volumes.
|
||||||
ExpandPersistentVolumesFSWithoutUnmounting utilfeature.Feature = "ExpandPersistentVolumesFSWithoutUnmounting"
|
ExpandInUsePersistentVolumes utilfeature.Feature = "ExpandInUsePersistentVolumes"
|
||||||
|
|
||||||
// owner: @verb
|
// owner: @verb
|
||||||
// alpha: v1.10
|
// alpha: v1.10
|
||||||
@ -333,7 +333,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
|
|||||||
MountPropagation: {Default: true, PreRelease: utilfeature.Beta},
|
MountPropagation: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
QOSReserved: {Default: false, PreRelease: utilfeature.Alpha},
|
QOSReserved: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
ExpandPersistentVolumes: {Default: true, PreRelease: utilfeature.Beta},
|
ExpandPersistentVolumes: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
ExpandPersistentVolumesFSWithoutUnmounting: {Default: false, PreRelease: utilfeature.Alpha},
|
ExpandInUsePersistentVolumes: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
CPUManager: {Default: true, PreRelease: utilfeature.Beta},
|
CPUManager: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
ServiceNodeExclusion: {Default: false, PreRelease: utilfeature.Alpha},
|
ServiceNodeExclusion: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
MountContainers: {Default: false, PreRelease: utilfeature.Alpha},
|
MountContainers: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
|
@ -630,7 +630,7 @@ func (asw *actualStateOfWorld) PodExistsInVolume(
|
|||||||
return true, volumeObj.devicePath, newRemountRequiredError(volumeObj.volumeName, podObj.podName)
|
return true, volumeObj.devicePath, newRemountRequiredError(volumeObj.volumeName, podObj.podName)
|
||||||
}
|
}
|
||||||
if podObj.fsResizeRequired &&
|
if podObj.fsResizeRequired &&
|
||||||
utilfeature.DefaultFeatureGate.Enabled(features.ExpandPersistentVolumesFSWithoutUnmounting) {
|
utilfeature.DefaultFeatureGate.Enabled(features.ExpandInUsePersistentVolumes) {
|
||||||
return true, volumeObj.devicePath, newFsResizeRequiredError(volumeObj.volumeName, podObj.podName)
|
return true, volumeObj.devicePath, newFsResizeRequiredError(volumeObj.volumeName, podObj.podName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ func (dswp *desiredStateOfWorldPopulator) isPodTerminated(pod *v1.Pod) bool {
|
|||||||
func (dswp *desiredStateOfWorldPopulator) findAndAddNewPods() {
|
func (dswp *desiredStateOfWorldPopulator) findAndAddNewPods() {
|
||||||
// Map unique pod name to outer volume name to MountedVolume.
|
// Map unique pod name to outer volume name to MountedVolume.
|
||||||
mountedVolumesForPod := make(map[volumetypes.UniquePodName]map[string]cache.MountedVolume)
|
mountedVolumesForPod := make(map[volumetypes.UniquePodName]map[string]cache.MountedVolume)
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.ExpandPersistentVolumesFSWithoutUnmounting) {
|
if utilfeature.DefaultFeatureGate.Enabled(features.ExpandInUsePersistentVolumes) {
|
||||||
for _, mountedVolume := range dswp.actualStateOfWorld.GetMountedVolumes() {
|
for _, mountedVolume := range dswp.actualStateOfWorld.GetMountedVolumes() {
|
||||||
mountedVolumes, exist := mountedVolumesForPod[mountedVolume.PodName]
|
mountedVolumes, exist := mountedVolumesForPod[mountedVolume.PodName]
|
||||||
if !exist {
|
if !exist {
|
||||||
@ -323,7 +323,7 @@ func (dswp *desiredStateOfWorldPopulator) processPodVolumes(
|
|||||||
volumeSpec.Name(),
|
volumeSpec.Name(),
|
||||||
uniquePodName)
|
uniquePodName)
|
||||||
|
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.ExpandPersistentVolumesFSWithoutUnmounting) {
|
if utilfeature.DefaultFeatureGate.Enabled(features.ExpandInUsePersistentVolumes) {
|
||||||
dswp.checkVolumeFSResize(pod, podVolume, pvc, volumeSpec,
|
dswp.checkVolumeFSResize(pod, podVolume, pvc, volumeSpec,
|
||||||
uniquePodName, mountedVolumesForPod, processedVolumesForFSResize)
|
uniquePodName, mountedVolumesForPod, processedVolumesForFSResize)
|
||||||
}
|
}
|
||||||
|
@ -562,9 +562,9 @@ func volumeCapacity(size int) v1.ResourceList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setExpandOnlinePersistentVolumesFeatureGate(value string, t *testing.T) {
|
func setExpandOnlinePersistentVolumesFeatureGate(value string, t *testing.T) {
|
||||||
err := utilfeature.DefaultFeatureGate.Set(fmt.Sprintf("%s=%s", features.ExpandPersistentVolumesFSWithoutUnmounting, value))
|
err := utilfeature.DefaultFeatureGate.Set(fmt.Sprintf("%s=%s", features.ExpandInUsePersistentVolumes, value))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Set ExpandPersistentVolumesFSWithoutUnmounting feature gate to %s failed: %v", value, err)
|
t.Fatalf("Set ExpandInUsePersistentVolumes feature gate to %s failed: %v", value, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ func (rc *reconciler) reconcile() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if cache.IsFSResizeRequiredError(err) &&
|
} else if cache.IsFSResizeRequiredError(err) &&
|
||||||
utilfeature.DefaultFeatureGate.Enabled(features.ExpandPersistentVolumesFSWithoutUnmounting) {
|
utilfeature.DefaultFeatureGate.Enabled(features.ExpandInUsePersistentVolumes) {
|
||||||
glog.V(4).Infof(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.ExpandVolumeFSWithoutUnmounting", ""))
|
glog.V(4).Infof(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.ExpandVolumeFSWithoutUnmounting", ""))
|
||||||
err := rc.operationExecutor.ExpandVolumeFSWithoutUnmounting(
|
err := rc.operationExecutor.ExpandVolumeFSWithoutUnmounting(
|
||||||
volumeToMount.VolumeToMount,
|
volumeToMount.VolumeToMount,
|
||||||
|
@ -973,7 +973,7 @@ func Test_GenerateUnmapDeviceFunc_Plugin_Not_Found(t *testing.T) {
|
|||||||
// Mark volume as fsResizeRequired in ASW.
|
// Mark volume as fsResizeRequired in ASW.
|
||||||
// Verifies volume's fsResizeRequired flag is cleared later.
|
// Verifies volume's fsResizeRequired flag is cleared later.
|
||||||
func Test_Run_Positive_VolumeFSResizeControllerAttachEnabled(t *testing.T) {
|
func Test_Run_Positive_VolumeFSResizeControllerAttachEnabled(t *testing.T) {
|
||||||
utilfeature.DefaultFeatureGate.Set(fmt.Sprintf("%s=true", features.ExpandPersistentVolumesFSWithoutUnmounting))
|
utilfeature.DefaultFeatureGate.Set(fmt.Sprintf("%s=true", features.ExpandInUsePersistentVolumes))
|
||||||
pv := &v1.PersistentVolume{
|
pv := &v1.PersistentVolume{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "pv",
|
Name: "pv",
|
||||||
|
Loading…
Reference in New Issue
Block a user