Skip to content

Commit

Permalink
Fix: add new feature gate PreDownloadImageForSidecarSet
Browse files Browse the repository at this point in the history
Signed-off-by: Hanmengnan <1448189829@qq.com>
  • Loading branch information
Hanmengnan committed Jul 23, 2023
1 parent 4792ecb commit a191630
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/sidecarset/sidecarset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func Add(mgr manager.Manager) error {
}
if !utildiscovery.DiscoverGVK(appsv1alpha1.SchemeGroupVersion.WithKind("ImagePullJob")) ||
!utilfeature.DefaultFeatureGate.Enabled(features.KruiseDaemon) ||
!utilfeature.DefaultFeatureGate.Enabled(features.PreDownloadImageForInPlaceUpdate) {
!utilfeature.DefaultFeatureGate.Enabled(features.PreDownloadImageForInPlaceUpdate) ||
!utilfeature.DefaultFeatureGate.Enabled(features.PreDownloadImageForSidecarsetSetUpdate) {
isPreDownloadDisabled = true
}
return add(mgr, newReconciler(mgr))
Expand Down
6 changes: 6 additions & 0 deletions pkg/features/kruise_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ const (
// PreparingUpdateAsUpdate enable CloneSet/Advanced StatefulSet controller to regard preparing-update Pod
// as updated when calculating update/current revision during scaling.
PreparingUpdateAsUpdate featuregate.Feature = "PreparingUpdateAsUpdate"

// PreDownloadImageForSidecarsetSetUpdate enables sidecarset-controller to create ImagePullJobs to
// pre-download images for update.
PreDownloadImageForSidecarsetSetUpdate featuregate.Feature = "PreDownloadImageForSidecarsetSetUpdate"
)

var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
Expand All @@ -129,6 +133,7 @@ var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
PreDownloadImageForDaemonSetUpdate: {Default: false, PreRelease: featuregate.Alpha},
CloneSetEventHandlerOptimization: {Default: false, PreRelease: featuregate.Alpha},
PreparingUpdateAsUpdate: {Default: false, PreRelease: featuregate.Alpha},
PreDownloadImageForSidecarsetSetUpdate: {Default: false, PreRelease: featuregate.Alpha},
}

func init() {
Expand Down Expand Up @@ -164,5 +169,6 @@ func SetDefaultFeatureGates() {
_ = utilfeature.DefaultMutableFeatureGate.Set(fmt.Sprintf("%s=false", PreDownloadImageForDaemonSetUpdate))
_ = utilfeature.DefaultMutableFeatureGate.Set(fmt.Sprintf("%s=false", PodProbeMarkerGate))
_ = utilfeature.DefaultMutableFeatureGate.Set(fmt.Sprintf("%s=false", SidecarTerminator))
_ = utilfeature.DefaultMutableFeatureGate.Set(fmt.Sprintf("%s=false", PreDownloadImageForSidecarsetSetUpdate))
}
}

0 comments on commit a191630

Please sign in to comment.