You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/10/05 15:03:33 UTC

[GitHub] [incubator-yunikorn-core] kingamarton commented on a change in pull request #207: [YUNIKORN-405] Added checksum validation

kingamarton commented on a change in pull request #207:
URL: https://github.com/apache/incubator-yunikorn-core/pull/207#discussion_r499667131



##########
File path: pkg/common/configs/config.go
##########
@@ -142,6 +142,20 @@ type LoadSchedulerConfigFunc func(policyGroup string) (*SchedulerConfig, error)
 
 // Visible by tests
 func LoadSchedulerConfigFromByteArray(content []byte) (*SchedulerConfig, error) {
+	conf, err := ParseAndValidateConfig(content)
+	if err != nil {
+		return nil, err
+	}
+	// Create a sha256 checksum for this validated config
+	PopulateChecksum(content, conf)
+	return conf, err
+}
+
+func PopulateChecksum(content []byte, conf *SchedulerConfig) {

Review comment:
       Since we call this function from handler.go as well, we need to keep it public.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org