Skip to content

Instantly share code, notes, and snippets.

@dims
Last active September 19, 2025 11:40
Show Gist options
  • Select an option

  • Save dims/c0857b86441442b15852a4c2355db130 to your computer and use it in GitHub Desktop.

Select an option

Save dims/c0857b86441442b15852a4c2355db130 to your computer and use it in GitHub Desktop.
[DEPRECATED] Python script to compute updates to the Kubernetes go.mod to see how far we are behind latest in vendored repos (please look in artifacts generated in this job - https://testgrid.k8s.io/sig-arch-code-organization#unit-master-dependencies&width=20)

Generated on Sep 19, 2025

Package Current Latest URL
github.com/Azure/go-ansiterm 306776ec8161 faa5f7b0171c https://github.com/Azure/go-ansiterm/compare/306776ec8161...faa5f7b0171c
github.com/antlr4-go/antlr/v4 v4.13.0 v4.13.1 https://github.com/antlr4-go/antlr/v4/compare/v4.13.0...v4.13.1
github.com/chai2010/gettext-go v1.0.2 v1.0.3 https://github.com/chai2010/gettext-go/compare/v1.0.2...v1.0.3
github.com/container-storage-interface/spec v1.9.0 v1.11.0 https://github.com/container-storage-interface/spec/compare/v1.9.0...v1.11.0
github.com/coredns/corefile-migration v1.0.27 v1.0.28 https://github.com/coredns/corefile-migration/compare/v1.0.27...v1.0.28
github.com/coreos/go-oidc v2.3.0 v2.4.0 https://github.com/coreos/go-oidc/compare/v2.3.0...v2.4.0
github.com/coreos/go-systemd/v22 v22.5.0 v22.6.0 https://github.com/coreos/go-systemd/v22/compare/v22.5.0...v22.6.0
github.com/cpuguy83/go-md2man/v2 v2.0.6 v2.0.7 https://github.com/cpuguy83/go-md2man/v2/compare/v2.0.6...v2.0.7
github.com/emicklei/go-restful/v3 v3.12.2 v3.13.0 https://github.com/emicklei/go-restful/v3/compare/v3.12.2...v3.13.0
github.com/go-errors/errors v1.4.2 v1.5.1 https://github.com/go-errors/errors/compare/v1.4.2...v1.5.1
github.com/go-openapi/jsonpointer v0.21.0 v0.22.0 https://github.com/go-openapi/jsonpointer/compare/v0.21.0...v0.22.0
github.com/go-openapi/jsonreference v0.20.2 v0.21.1 https://github.com/go-openapi/jsonreference/compare/v0.20.2...v0.21.1
github.com/go-openapi/swag v0.23.0 v0.24.1 https://github.com/go-openapi/swag/compare/v0.23.0...v0.24.1
github.com/golang-jwt/jwt/v5 v5.2.2 v5.3.0 https://github.com/golang-jwt/jwt/v5/compare/v5.2.2...v5.3.0
github.com/google/cel-go v0.26.0 v0.26.1 https://github.com/google/cel-go/compare/v0.26.0...v0.26.1
github.com/google/pprof d1b30febd7db c28834ac2320 https://github.com/google/pprof/compare/d1b30febd7db...c28834ac2320
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 v1.1.0 https://github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus/compare/v1.0.1...v1.1.0
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0 v2.3.2 https://github.com/grpc-ecosystem/go-grpc-middleware/v2/compare/v2.3.0...v2.3.2
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 v2.27.2 https://github.com/grpc-ecosystem/grpc-gateway/v2/compare/v2.26.3...v2.27.2
github.com/ishidawataru/sctp ae8eb7fa7995 4b890084db30 https://github.com/ishidawataru/sctp/compare/ae8eb7fa7995...4b890084db30
github.com/mailru/easyjson v0.7.7 v0.9.1 https://github.com/mailru/easyjson/compare/v0.7.7...v0.9.1
github.com/moby/term v0.5.0 v0.5.2 https://github.com/moby/term/compare/v0.5.0...v0.5.2
github.com/onsi/ginkgo/v2 v2.21.0 v2.25.3 https://github.com/onsi/ginkgo/v2/compare/v2.21.0...v2.25.3
github.com/onsi/gomega v1.35.1 v1.38.2 https://github.com/onsi/gomega/compare/v1.35.1...v1.38.2
github.com/opencontainers/cgroups v0.0.3 v0.0.5 https://github.com/opencontainers/cgroups/compare/v0.0.3...v0.0.5
github.com/opencontainers/selinux v1.11.1 v1.12.0 https://github.com/opencontainers/selinux/compare/v1.11.1...v1.12.0
github.com/pquerna/cachecontrol v0.1.0 v0.2.0 https://github.com/pquerna/cachecontrol/compare/v0.1.0...v0.2.0
github.com/prometheus/procfs v0.16.1 v0.17.0 https://github.com/prometheus/procfs/compare/v0.16.1...v0.17.0
github.com/spf13/cobra v1.10.0 v1.10.1 https://github.com/spf13/cobra/compare/v1.10.0...v1.10.1
github.com/spf13/pflag v1.0.9 v1.0.10 https://github.com/spf13/pflag/compare/v1.0.9...v1.0.10
github.com/stoewer/go-strcase v1.3.0 v1.3.1 https://github.com/stoewer/go-strcase/compare/v1.3.0...v1.3.1
go.etcd.io/bbolt v1.4.2 v1.4.3 https://go.etcd.io/bbolt/compare/v1.4.2...v1.4.3
go.opentelemetry.io/auto/sdk v1.1.0 v1.2.1 https://github.com/open-telemetry/opentelemetry-go/compare/sdk/v1.1.0...sdk/v1.2.1
go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful v0.44.0 v0.63.0 https://github.com/open-telemetry/opentelemetry-go-contrib/compare/instrumentation/github.com/emicklei/go-restful/otelrestful/v0.44.0...instrumentation/github.com/emicklei/go-restful/otelrestful/v0.63.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 v0.63.0 https://github.com/open-telemetry/opentelemetry-go-contrib/compare/instrumentation/google.golang.org/grpc/otelgrpc/v0.60.0...instrumentation/google.golang.org/grpc/otelgrpc/v0.63.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 v0.63.0 https://github.com/open-telemetry/opentelemetry-go-contrib/compare/instrumentation/net/http/otelhttp/v0.61.0...instrumentation/net/http/otelhttp/v0.63.0
go.opentelemetry.io/otel v1.36.0 v1.38.0 https://github.com/open-telemetry/opentelemetry-go/compare/v1.36.0...v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 v1.38.0 https://github.com/open-telemetry/opentelemetry-go/compare/exporters/otlp/otlptrace/v1.34.0...exporters/otlp/otlptrace/v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 v1.38.0 https://github.com/open-telemetry/opentelemetry-go/compare/exporters/otlp/otlptrace/otlptracegrpc/v1.34.0...exporters/otlp/otlptrace/otlptracegrpc/v1.38.0
go.opentelemetry.io/otel/metric v1.36.0 v1.38.0 https://github.com/open-telemetry/opentelemetry-go/compare/metric/v1.36.0...metric/v1.38.0
go.opentelemetry.io/otel/sdk v1.36.0 v1.38.0 https://github.com/open-telemetry/opentelemetry-go/compare/sdk/v1.36.0...sdk/v1.38.0
go.opentelemetry.io/otel/trace v1.36.0 v1.38.0 https://github.com/open-telemetry/opentelemetry-go/compare/trace/v1.36.0...trace/v1.38.0
go.opentelemetry.io/proto/otlp v1.5.0 v1.8.0 https://github.com/open-telemetry/opentelemetry-proto-go/compare/otlp/v1.5.0...otlp/v1.8.0
go.yaml.in/yaml/v2 v2.4.2 v2.4.3 https://go.yaml.in/yaml/v2/compare/v2.4.2...v2.4.3
golang.org/x/crypto v0.41.0 v0.42.0 https://github.com/golang/crypto/compare/v0.41.0...v0.42.0
golang.org/x/exp 8a7402abbf56 df9299821621 https://github.com/golang/exp/compare/8a7402abbf56...df9299821621
golang.org/x/mod v0.27.0 v0.28.0 https://github.com/golang/mod/compare/v0.27.0...v0.28.0
golang.org/x/net v0.43.0 v0.44.0 https://github.com/golang/net/compare/v0.43.0...v0.44.0
golang.org/x/oauth2 v0.30.0 v0.31.0 https://github.com/golang/oauth2/compare/v0.30.0...v0.31.0
golang.org/x/sync v0.16.0 v0.17.0 https://github.com/golang/sync/compare/v0.16.0...v0.17.0
golang.org/x/sys v0.35.0 v0.36.0 https://github.com/golang/sys/compare/v0.35.0...v0.36.0
golang.org/x/term v0.34.0 v0.35.0 https://github.com/golang/term/compare/v0.34.0...v0.35.0
golang.org/x/text v0.28.0 v0.29.0 https://github.com/golang/text/compare/v0.28.0...v0.29.0
golang.org/x/time v0.9.0 v0.13.0 https://github.com/golang/time/compare/v0.9.0...v0.13.0
golang.org/x/tools v0.36.0 v0.37.0 https://github.com/golang/tools/compare/v0.36.0...v0.37.0
google.golang.org/genproto/googleapis/api a0af3efb3deb 97024824d090 https://github.com/googleapis/go-genproto/compare/a0af3efb3deb...97024824d090
google.golang.org/genproto/googleapis/rpc 200df99c418a 97024824d090 https://github.com/googleapis/go-genproto/compare/200df99c418a...97024824d090
google.golang.org/grpc v1.72.2 v1.75.1 https://github.com/protocolbuffers/protobuf-go/compare/v1.72.2...v1.75.1
google.golang.org/protobuf v1.36.8 v1.36.9 https://github.com/protocolbuffers/protobuf-go/compare/v1.36.8...v1.36.9
#!/usr/bin/python
import json
import subprocess
import logging
import os
def get_dependencies():
dependencies = {}
f = subprocess.Popen('go mod edit -json', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
(stdout, stderr) = f.communicate()
if stderr:
logging.fatal(stderr)
data = json.loads(stdout)
for dep in data["Require"]:
if dep['Path'].startswith("k8s.io/") != -1:
dependencies[dep['Path']] = dep['Version']
return dependencies
def sanitize(param):
# v0.0.0-20190331200053-3d26580ed485
if param.count('-') == 2:
return param.split('-')[-1]
# v11.1.2+incompatible
if param.count('+') == 1:
return param.split('+')[0]
return param
def source(pkg, old, new):
if pkg.startswith("cloud.google.com/go"):
return "github.com/googleapis/google-cloud-go", old, new
elif pkg.startswith("golang.org/x/"):
return "github.com/golang" + pkg[len("golang.org/x"):], old, new
elif pkg.startswith("go.uber.org/"):
return "github.com/uber-go" + pkg[len("go.uber.org"):], old, new
elif pkg.startswith("go.starlark.net"):
return "github.com/google/starlark-go", old, new
elif pkg.startswith("gopkg.in"):
repo = pkg.split('/', 1)[1] # get the last part of `gopkg.in/gcfg.v1` which is `gcfg.v1`
repo = repo.split('.', 1)[0] # get the part before the `.` which is `gcfg`
# we could end up with `gcfg` or `square/go-jose` here, deal with them separately
if '/' not in repo:
repo = "github.com/go-" + repo + "/" + repo
else:
repo = "github.com/" + repo
return repo, old, new
elif pkg.startswith("google.golang.org"):
array = pkg.split('/', 2)
if array[1] == "api":
repo = "github.com/googleapis/google-api-go-client"
elif array[1] == "genproto":
repo = "github.com/googleapis/go-genproto"
else: # repo = "protobuf"
repo = "github.com/protocolbuffers/protobuf-go"
return repo, old, new
elif pkg.startswith("go.opentelemetry.io/"):
array = pkg.split('/', 2)
if array[1] == "contrib":
repo = "github.com/open-telemetry/opentelemetry-go-contrib"
elif array[1] == "proto":
repo = "github.com/open-telemetry/opentelemetry-proto-go"
else: # repo = "otel"
repo = "github.com/open-telemetry/opentelemetry-go"
if len(array) > 2:
path = array[2] + "/"
else:
path = ""
return repo, path + old, path + new
return pkg, old, new
def main():
cleanup_command = """git reset --hard HEAD"""
print(">>>> Running command %r" % cleanup_command)
os.system(cleanup_command)
print(">>>> parsing go.mod before updates")
before = get_dependencies()
print("Found %d packages before updating dependencies" % len(before.values()))
update_command = """\
go mod edit -json | jq -r ".Require[] | .Path | select(contains(\\"k8s.io/\\") | not)" | xargs -L1 go get -d\
"""
print(">>>> Running command %r" % update_command)
os.system(update_command)
print(">>>> parsing go.mod after updates")
after = get_dependencies()
print("Found %d packages after updating dependencies" % len(before.values()))
print(">>>> Packages that got dropped %r" % (list(set(before.keys()) - set(after.keys()))))
print(">>>> Packages that were added %r" % (list(set(after.keys()) - set(before.keys()))))
print(">>>>> Mark down of differences <<<<")
print("Package | Current | Latest | URL")
print("------------ | ------------- | ------------- |------------- ")
for pkg in sorted(before.keys()):
if pkg.startswith("k8s.io"):
continue
old = sanitize(before[pkg])
if pkg not in after:
print("~%s~ | %s | Dropped | NONE" % (pkg, old))
continue
new = sanitize(after[pkg])
repo, oldtag, newtag = source(pkg, old, new)
if old != new:
print("%s | %s | %s | https://%s/compare/%s...%s " % (pkg, old, new, repo, oldtag, newtag))
else:
print("~%s~ | %s | %s | No changes" % (pkg, old, new))
if __name__ == "__main__":
main()
please check the markdown in https://gist.githubusercontent.com/dims/c0857b86441442b15852a4c2355db130/raw/b4fa76d27f13a959a01be98f0d2645d65abcac10/differences.md
this has the differences between the current dependency versions of different packages we have in this (and directories recursively under this) and the newest versions available.
please make a through analysis (3-4 pages) of each dependency. compare what we have and what is available. consult the changelog, check their websites, look at the code differences,
use whatever tools you have possible to find out how urgently we have to update to the newer packages and through discussion of what are the newer things available.
please be as through as possible, use all tools at your disposal (check website, docs, github, changelogs everything you can think of!)
@dims
Copy link
Author

dims commented May 20, 2025

This gist is deprecated! please see comment here - kubernetes/kubernetes#131839 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment