craigcondit commented on code in PR #579:
URL: https://github.com/apache/yunikorn-core/pull/579#discussion_r1240029312
##########
pkg/common/configs/config.go:
##########
@@ -194,15 +199,53 @@ func GetConfigurationString(requestBytes []byte) string {
return strings.ReplaceAll(conf, checksum, "")
}
-// DefaultSchedulerConfig contains the default scheduler configuration; used
if no other is provided
-var DefaultSchedulerConfig = `
-partitions:
- - name: default
- placementrules:
- - name: tag
- value: namespace
- create: true
- queues:
- - name: root
- submitacl: '*'
-`
+// GetDefaultConfig creates default scheduler configuration; used if no other
is provided
+func GetDefaultConfig() (string, error) {
+ config := &SchedulerConfig{
+ Partitions: GetDefaultPartitionConfig(),
+ EventRequestsEnabled: DefaultEventRequestsEnabled,
+ EventTrackingEnabled: DefaultEventTrackingEnabled,
+ EventRequestCapacity: DefaultEventRequestCapacity,
+ EventBufferCapacity: DefaultEventBufferCapacity,
+ EventResponseSize: DefaultEventResponseSize,
+ }
+
+ // ideally err will always be nil as we are now building the conf
programatically
+ content, err := yaml.Marshal(config)
+ if err != nil {
+ log.Log(log.Config).Error("failed to marshal config object",
+ zap.Error(err))
+ return "", err
Review Comment:
I added a top-level comment, but SchedulerConfig and these event
configurations have nothing to do with one another, and no changes should be
made to SchedulerConfig. Instead, have the event system register for configmap
changes (see the health check system for how to do that). Whenever the
configmap changes, the callbacks get run, and each subsystem can then parse out
and apply any configuration, falling back to default values for anything not
set.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]