[ https://issues.apache.org/jira/browse/YUNIKORN-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540478#comment-17540478 ]
Saad Ur Rahman edited comment on YUNIKORN-1220 at 5/22/22 6:20 PM: ------------------------------------------------------------------- [GetConfigurationString|https://github.com/apache/yunikorn-core/blob/d81bf72c9fcdf5255816194d0d2ad68d7d3d69a7/pkg/common/configs/config.go#L216-L228] removes the {_}checksum{_}. I am wondering if it would be simpler and easier to maintain if we marshalled the contents to the _*Config*_ struct and set the *_Checksum_* field to _nil_ and then unmarshalled it back to a {_}string{_}? The [Checksum field|https://github.com/apache/yunikorn-core/blob/d81bf72c9fcdf5255816194d0d2ad68d7d3d69a7/pkg/common/configs/config.go#L38] in _*Config*_ is set to _omit empty_ so it should not add the key if the value is set to {_}nil{_}. On closer inspection [updateClusterConfig|https://github.com/apache/yunikorn-core/blob/d81bf72c9fcdf5255816194d0d2ad68d7d3d69a7/pkg/webservice/handlers.go#L434] already performs the marshalling to a _*Config*_ struct so we would just need to pass that as a parameter to {_}*GetConfigurationString*{_}. Example: https://go.dev/play/p/7xdaRj-Jqs0 was (Author: surahman): [GetConfigurationString|https://github.com/apache/yunikorn-core/blob/d81bf72c9fcdf5255816194d0d2ad68d7d3d69a7/pkg/common/configs/config.go#L216-L228] removes the {_}checksum{_}. I am wondering if it would be simpler and easier to maintain if we marshalled the contents to the _*Config*_ struct and set the *_Checksum_* field to _nil_ and then unmarshalled it back to a {_}string{_}? The [Checksum field|https://github.com/apache/yunikorn-core/blob/d81bf72c9fcdf5255816194d0d2ad68d7d3d69a7/pkg/common/configs/config.go#L38] in _*Config*_ is set to _omit empty_ so it should not add the key if the value is set to {_}nil{_}. On closer inspection [updateClusterConfig|https://github.com/apache/yunikorn-core/blob/d81bf72c9fcdf5255816194d0d2ad68d7d3d69a7/pkg/webservice/handlers.go#L434] already performs the marshalling to a _*Config*_ struct so we would just need to pass that as a parameter to {_}*GetConfigurationString*{_}. > Move Checksum in configs under Scheduler. > ----------------------------------------- > > Key: YUNIKORN-1220 > URL: https://issues.apache.org/jira/browse/YUNIKORN-1220 > Project: Apache YuniKorn > Issue Type: Improvement > Components: core - scheduler > Reporter: Saad Ur Rahman > Assignee: Saad Ur Rahman > Priority: Major > Labels: features > > The _*checksum*_ is currently at the root of the scheduler configs but the > desire is to place it under a _*Scheduler*_ subsection. Work in the linked > Jira issue will add the _*Scheduler*_ subsection to the configs and work on > this issue can subsequently proceed. -- This message was sent by Atlassian Jira (v8.20.7#820007) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@yunikorn.apache.org For additional commands, e-mail: issues-h...@yunikorn.apache.org