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/02 22:01:05 UTC

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

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



##########
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:
       Seems no need to expose this function. Pls change to `populateChecksum `




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