Skip to content

Commit

Permalink
Merge pull request volcano-sh#3307 from Lily922/master-config
Browse files Browse the repository at this point in the history
change private function 'unmarshalSchedulerConf' to public function 'UnmarshalSchedulerConf'
  • Loading branch information
volcano-sh-bot authored Feb 28, 2024
2 parents 94c62a4 + 730d548 commit 6e9f4f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ func (pc *Scheduler) loadSchedulerConf() {

var err error
pc.once.Do(func() {
pc.actions, pc.plugins, pc.configurations, pc.metricsConf, err = unmarshalSchedulerConf(defaultSchedulerConf)
pc.actions, pc.plugins, pc.configurations, pc.metricsConf, err = UnmarshalSchedulerConf(DefaultSchedulerConf)
if err != nil {
klog.Errorf("unmarshal Scheduler config %s failed: %v", defaultSchedulerConf, err)
klog.Errorf("unmarshal Scheduler config %s failed: %v", DefaultSchedulerConf, err)
panic("invalid default configuration")
}
})
Expand All @@ -155,7 +155,7 @@ func (pc *Scheduler) loadSchedulerConf() {
config = strings.TrimSpace(string(confData))
}

actions, plugins, configurations, metricsConf, err := unmarshalSchedulerConf(config)
actions, plugins, configurations, metricsConf, err := UnmarshalSchedulerConf(config)
if err != nil {
klog.Errorf("Scheduler config %s is invalid: %v", config, err)
return
Expand Down
4 changes: 2 additions & 2 deletions pkg/scheduler/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"volcano.sh/volcano/pkg/util"
)

var defaultSchedulerConf = `
var DefaultSchedulerConf = `
actions: "enqueue, allocate, backfill"
tiers:
- plugins:
Expand All @@ -45,7 +45,7 @@ tiers:
- name: nodeorder
`

func unmarshalSchedulerConf(confStr string) ([]framework.Action, []conf.Tier, []conf.Configuration, map[string]string, error) {
func UnmarshalSchedulerConf(confStr string) ([]framework.Action, []conf.Tier, []conf.Configuration, map[string]string, error) {
var actions []framework.Action

schedulerConf := &conf.SchedulerConfiguration{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ tiers:

var expectedConfigurations []conf.Configuration

_, tiers, configurations, _, err := unmarshalSchedulerConf(configuration)
_, tiers, configurations, _, err := UnmarshalSchedulerConf(configuration)
if err != nil {
t.Errorf("Failed to load Scheduler configuration: %v", err)
}
Expand Down

0 comments on commit 6e9f4f6

Please sign in to comment.