@@ -20,6 +20,8 @@ limitations under the License.
2020package conf
2121
2222import (
23+ "maps"
24+ "slices"
2325 "time"
2426
2527 "k8s.io/apimachinery/pkg/labels"
@@ -59,33 +61,76 @@ type SchedulerConfiguration struct {
5961 UsageDBConfig * usagedbapi.UsageDBConfig `yaml:"usageDBConfig,omitempty" json:"usageDBConfig,omitempty"`
6062}
6163
64+ func (s * SchedulerConfiguration ) DeepCopy () * SchedulerConfiguration {
65+ copy := SchedulerConfiguration {
66+ Actions : s .Actions ,
67+ Tiers : slices .Clone (s .Tiers ),
68+ QueueDepthPerAction : maps .Clone (s .QueueDepthPerAction ),
69+ UsageDBConfig : s .UsageDBConfig .DeepCopy (),
70+ }
71+
72+ return & copy
73+ }
74+
6275// Tier defines plugin tier
6376type Tier struct {
6477 Plugins []PluginOption `yaml:"plugins" json:"plugins"`
6578}
6679
80+ func (t * Tier ) DeepCopy () * Tier {
81+ copy := Tier {
82+ Plugins : make ([]PluginOption , len (t .Plugins )),
83+ }
84+ for i , plugin := range t .Plugins {
85+ copy .Plugins [i ] = * plugin .DeepCopy ()
86+ }
87+ return & copy
88+ }
89+
6790// PluginOption defines the options of plugin
6891type PluginOption struct {
6992 // The name of Plugin
7093 Name string `yaml:"name" json:"name"`
94+
7195 // JobOrderDisabled defines whether jobOrderFn is disabled
96+ // Deprecated: To disable, don't set this plugin in the config
7297 JobOrderDisabled bool `yaml:"disableJobOrder" json:"disableJobOrder"`
7398 // TaskOrderDisabled defines whether taskOrderFn is disabled
7499 TaskOrderDisabled bool `yaml:"disableTaskOrder" json:"disableTaskOrder"`
100+ // Deprecated: To disable, don't set this plugin in the config
75101 // PreemptableDisabled defines whether preemptableFn is disabled
76102 PreemptableDisabled bool `yaml:"disablePreemptable" json:"disablePreemptable"`
77103 // ReclaimableDisabled defines whether reclaimableFn is disabled
104+ // Deprecated: To disable, don't set this plugin in the config
78105 ReclaimableDisabled bool `yaml:"disableReclaimable" json:"disableReclaimable"`
79106 // QueueOrderDisabled defines whether queueOrderFn is disabled
80107 QueueOrderDisabled bool `yaml:"disableQueueOrder" json:"disableQueueOrder"`
108+ // Deprecated: To disable, don't set this plugin in the config
81109 // PredicateDisabled defines whether predicateFn is disabled
82110 PredicateDisabled bool `yaml:"disablePredicate" json:"disablePredicate"`
83111 // NodeOrderDisabled defines whether NodeOrderFn is disabled
112+ // Deprecated: To disable, don't set this plugin in the config
84113 NodeOrderDisabled bool `yaml:"disableNodeOrder" json:"disableNodeOrder"`
114+
85115 // Arguments defines the different arguments that can be given to different plugins
86116 Arguments map [string ]string `yaml:"arguments" json:"arguments"`
87117}
88118
119+ func (p * PluginOption ) DeepCopy () * PluginOption {
120+ copy := PluginOption {
121+ Name : p .Name ,
122+ Arguments : maps .Clone (p .Arguments ),
123+ }
124+ copy .JobOrderDisabled = p .JobOrderDisabled
125+ copy .TaskOrderDisabled = p .TaskOrderDisabled
126+ copy .PreemptableDisabled = p .PreemptableDisabled
127+ copy .ReclaimableDisabled = p .ReclaimableDisabled
128+ copy .QueueOrderDisabled = p .QueueOrderDisabled
129+ copy .PredicateDisabled = p .PredicateDisabled
130+ copy .NodeOrderDisabled = p .NodeOrderDisabled
131+ return & copy
132+ }
133+
89134type SchedulingNodePoolParams struct {
90135 NodePoolLabelKey string
91136 NodePoolLabelValue string
0 commit comments