GoogleContainerTools/kpt-config-sync

Upgrade dependency "github.com/GoogleContainerTools/kpt"

Ben131-Go opened this issue · 4 comments

Background

Repo github.com/GoogleContainerTools/kpt-config-sync depends on github.com/GoogleContainerTools/kpt@v1.0.0-beta.21.

https://github.com/GoogleContainerTools/kpt-config-sync/blob/main/go.mod#L8

However, comparing version v1.0.0-beta.21 of github.com/GoogleContainerTools/kpt from proxy.golang.org and github, there are inconsistencies.

commit time of the copy on github.com

"committer": {
      "name": "GitHub",
      "email": "noreply@github.com",
      "date": "2022-09-27T17:42:58Z"
    }

commit time of the copy on proxy.golang.org

{"Version":"v1.0.0-beta.21","Time":"2022-09-26T21:32:47Z","Origin":{"VCS":"git","URL":"https://github.com/googlecontainertools/kpt","Ref":"refs/tags/v1.0.0-beta.21","Hash":"be711ee98edbd35cdd08d4f1c5d081c2a64f0e0e"}}

So the checksum from the code in github does not match the checksum saved in sum.golang.org. The v1.0.0-beta.21 tag of github.com/GoogleContainerTools/kpt might have been retagged after a minor edition on github. I guess you use proxy.golang.org to get dependencies, but that also shows that your project is depending on the copy of github.com/GoogleContainerTools/kpt@v1.0.0-beta.21 before its edition. Depending upon such inconsistent tag version may also result in some unexpected errors as well as build errors due to different proxy settings.

For example, when someone who does not use proxy.golang.org, say GOPROXY=direct, attempts to get github.com/GoogleContainerTools/kpt@v1.0.0-beta.21, the following error occurs.

go: downloading github.com/GoogleContainerTools/kpt v1.0.0-beta.21
go: github.com/GoogleContainerTools/kpt@v1.0.0-beta.21: verifying module: checksum mismatch
        downloaded: h1:XYEBG0cJi7kwQmNj6iacaXJTkHNhQCnkyakIFu7k50Q=
        sum.golang.org: h1:VUj6pc6eaqPPXH64T8Jo9ERDDRhDpuxzFO6sgs0Z7/Q=

SECURITY ERROR
This download does NOT match the one reported by the checksum server.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.

So, this is a reminder in the hope that you can get rid of this problematic version of project github.com/GoogleContainerTools/kpt.

Solution

1. Bump the version of dependency github.com/GoogleContainerTools/kpt

I would recommend bumping the version of github.com/GoogleContainerTools/kpt to a new release to ensure dependency copy in proxy.golang.org and github in sync.

References

Note: Upgrading to kpt v1.0.0-beta.30 will also require updating the k8s libs to v0.25+, which we'll need to do first to validate.

K8s update: #596

kpt update: #644

Done. merged.