chia7712 commented on code in PR #752:
URL: https://github.com/apache/yunikorn-k8shim/pull/752#discussion_r1450284107


##########
pkg/conf/schedulerconf.go:
##########
@@ -452,17 +451,10 @@ func DumpConfiguration() {
 
 func Decompress(key string, value []byte) (string, string) {
        var uncompressedData string
-       decodedValue := make([]byte, base64.StdEncoding.DecodedLen(len(value)))
-       n, err := base64.StdEncoding.Decode(decodedValue, value)
-       if err != nil {
-               log.Log(log.ShimConfig).Error("failed to decode schedulerConfig 
entry", zap.Error(err))
-               return "", ""
-       }
-       decodedValue = decodedValue[:n]
        splitKey := strings.Split(key, ".")
        compressionAlgo := splitKey[len(splitKey)-1]
        if strings.EqualFold(compressionAlgo, constants.GzipSuffix) {
-               reader := bytes.NewReader(decodedValue)
+               reader := bytes.NewReader(value)
                gzReader, err := gzip.NewReader(reader)

Review Comment:
   How about `gzReader, err := gzip.NewReader(bytes.NewReader(value))`?



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

Reply via email to