Skip to content

Commit

Permalink
Merge pull request volcano-sh#3326 from bibibox/add_pdb_feature_gate
Browse files Browse the repository at this point in the history
Add pdb support feature gate
  • Loading branch information
volcano-sh-bot authored Feb 26, 2024
2 parents f6e0a52 + 6127f20 commit 94c62a4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ mod-download-go:

.PHONY: mirror-licenses
mirror-licenses: mod-download-go; \
go install istio.io/tools/cmd/license-lint@latest; \
go install istio.io/tools/cmd/license-lint@1.19.7; \
cd licenses; \
rm -rf `ls ./ | grep -v LICENSE`; \
cd -; \
Expand Down
4 changes: 4 additions & 0 deletions config/license-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ allowlisted_modules:
- github.com/google/cadvisor
# Apache-2.0: k8s.io/kubernetes@v1.27.2/logo/LICENSE
- k8s.io/kubernetes
# BSD: github.com/gogo/protobuf@v1.3.2/LICENSE
- github.com/gogo/protobuf
# MIT: sigs.k8s.io/yaml@v1.3.0/LICENSE
- sigs.k8s.io/yaml
12 changes: 8 additions & 4 deletions pkg/features/volcano_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const (
// VolcanoJobSupport can identify and schedule volcano job.
VolcanoJobSupport featuregate.Feature = "VolcanoJobSupport"

// PodDisruptionBudgetsSupport can cache and support PodDisruptionBudgets
PodDisruptionBudgetsSupport featuregate.Feature = "PodDisruptionBudgetsSupport"

// QueueCommandSync supports queue command sync.
QueueCommandSync featuregate.Feature = "QueueCommandSync"

Expand All @@ -47,10 +50,11 @@ func init() {
}

var defaultVolcanoFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
WorkLoadSupport: {Default: true, PreRelease: featuregate.Alpha},
VolcanoJobSupport: {Default: true, PreRelease: featuregate.Alpha},
QueueCommandSync: {Default: true, PreRelease: featuregate.Alpha},
PriorityClass: {Default: true, PreRelease: featuregate.Alpha},
WorkLoadSupport: {Default: true, PreRelease: featuregate.Alpha},
VolcanoJobSupport: {Default: true, PreRelease: featuregate.Alpha},
PodDisruptionBudgetsSupport: {Default: true, PreRelease: featuregate.Alpha},
QueueCommandSync: {Default: true, PreRelease: featuregate.Alpha},
PriorityClass: {Default: true, PreRelease: featuregate.Alpha},
// CSIStorage is explicitly set to false by default.
CSIStorage: {Default: false, PreRelease: featuregate.Alpha},
ResourceTopology: {Default: true, PreRelease: featuregate.Alpha},
Expand Down
8 changes: 6 additions & 2 deletions pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,9 @@ func (sc *SchedulerCache) addEventHandler() {
mySchedulerPodName, c := getMultiSchedulerInfo()

// explicitly register informers to the factory, otherwise resources listers cannot get anything
// even with no error returned. `PodDisruptionBudgets` informer is used by `Pdb` plugin
// even with no error returned.
// `Namespace` informer is used by `InterPodAffinity` plugin,
// `SelectorSpread` and `PodTopologySpread` plugins uses the following four so far.
informerFactory.Policy().V1().PodDisruptionBudgets().Informer()
informerFactory.Core().V1().Namespaces().Informer()
informerFactory.Core().V1().Services().Informer()
if utilfeature.DefaultFeatureGate.Enabled(features.WorkLoadSupport) {
Expand All @@ -594,6 +593,11 @@ func (sc *SchedulerCache) addEventHandler() {
informerFactory.Apps().V1().StatefulSets().Informer()
}

// `PodDisruptionBudgets` informer is used by `Pdb` plugin
if utilfeature.DefaultFeatureGate.Enabled(features.PodDisruptionBudgetsSupport) {
informerFactory.Policy().V1().PodDisruptionBudgets().Informer()
}

// create informer for node information
sc.nodeInformer = informerFactory.Core().V1().Nodes()
sc.nodeInformer.Informer().AddEventHandlerWithResyncPeriod(
Expand Down

0 comments on commit 94c62a4

Please sign in to comment.