mitdesai commented on code in PR #579:
URL: https://github.com/apache/yunikorn-core/pull/579#discussion_r1239950736
##########
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 think serialized YAML should be fine. This path should ideally not get
exercised as we are now programmatically building the default config, we do
something horribly bad with the default values. I'll make the changes and see
if others have a different opinion.
--
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]