Merge pull request #9912 from prezha/fix-update-kubernetes-version

fix: use release tags and add make targets
pull/9928/head
Medya Ghazizadeh 2020-12-10 16:03:38 -08:00 committed by GitHub
commit 9aac4f7f42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View File

@ -801,3 +801,20 @@ help:
@printf "\033[1mAvailable targets for minikube ${VERSION}\033[21m\n"
@printf "\033[1m--------------------------------------\033[21m\n"
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: update-kubernetes-version
update-kubernetes-version:
(cd hack/update/kubernetes_version && \
go run update_kubernetes_version.go)
.PHONY: update-kubernetes-version-pr
update-kubernetes-version-pr:
ifndef GITHUB_TOKEN
@echo "⚠️ please set GITHUB_TOKEN environment variable with your GitHub token"
@echo "you can use https://github.com/settings/tokens/new?scopes=repo,write:packages to create new one"
else
(cd hack/update/kubernetes_version && \
export UPDATE_TARGET="all" && \
go run update_kubernetes_version.go)
endif

View File

@ -216,12 +216,12 @@ func GHReleases(ctx context.Context, owner, repo string) (stable, latest string,
// walk through the paginated list of up to ghSearchLimit newest releases
opts := &github.ListOptions{PerPage: ghListPerPage}
for (opts.Page+1)*ghListPerPage <= ghSearchLimit {
rls, resp, err := ghc.Repositories.ListReleases(ctx, owner, repo, opts)
rls, resp, err := ghc.Repositories.ListTags(ctx, owner, repo, opts)
if err != nil {
return "", "", err
}
for _, rl := range rls {
ver := rl.GetTagName()
ver := *rl.Name
if !semver.IsValid(ver) {
continue
}