From 3c3dac0a5b6d7fd14b218814a1bd11cdbf7652da Mon Sep 17 00:00:00 2001 From: Mark Gordon Date: Thu, 8 Aug 2019 12:29:05 -0400 Subject: [PATCH] remotecache: other fix to record sorting Signed-off-by: Mark Gordon --- cache/remotecache/v1/utils.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cache/remotecache/v1/utils.go b/cache/remotecache/v1/utils.go index 0638b17a..dfc7fab3 100644 --- a/cache/remotecache/v1/utils.go +++ b/cache/remotecache/v1/utils.go @@ -78,10 +78,14 @@ func sortConfig(cc *CacheConfig) { if ri.Inputs[i][j].Selector != rj.Inputs[i][j].Selector { return ri.Inputs[i][j].Selector < rj.Inputs[i][j].Selector } - return cc.Records[ri.Inputs[i][j].LinkIndex].Digest < cc.Records[rj.Inputs[i][j].LinkIndex].Digest + inputDigesti := cc.Records[ri.Inputs[i][j].LinkIndex].Digest + inputDigestj := cc.Records[rj.Inputs[i][j].LinkIndex].Digest + if inputDigesti != inputDigestj { + return inputDigesti < inputDigestj + } } } - return ri.Digest < rj.Digest + return false }) for i, l := range sortedRecords { l.newIndex = i