Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Describe what this PR does / why we need it
修复manifestEqual方法缺陷。
该方法的意图应当是对比来源和目标镜像的manifest,如果相同就skip该任务。但是该方法之前在本地和远程manifest内容实际上完全一致,但是key顺序不同的情况下,会返回false,没有成功比较。
而由于destManifest是本地构造的,因此key顺序大概率与远程不同。
这导致重复向远程仓库提交push;而在远程仓库开启immutable的情况下,会导致任务预期外的失败。
Does this pull request fix one issue?
是的,已测试
Describe how you did it
将简单的json.compact成为无序byte数组的比较,转变成递归的key value逐个值比较,包括slice。
Describe how to verify it
将目标镜像仓库设置immutable,也就是已存在的tag不允许重复提交;此时将来源和目标设置为相同地址进行提交,在原始版本会报错。
unknown: The requested tag already exists and cannot be overwritten
当前提交版本会提示 skip synchronization because destination image exists 并返回成功
Special notes for reviews