From 8f07b9e11bda064d2af051b504a408d3d7ce9e6c Mon Sep 17 00:00:00 2001 From: Vincent Hou Date: Wed, 22 Jan 2025 10:09:48 -0500 Subject: [PATCH] Upgraded the libs for 1.16 --- go.mod | 4 +- go.sum | 8 ++-- vendor/knative.dev/hack/release.sh | 46 +++++++++---------- .../serving/pkg/testing/v1/revision.go | 15 ++++++ vendor/modules.txt | 4 +- 5 files changed, 45 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index 085a9ec6af..e0d9114642 100644 --- a/go.mod +++ b/go.mod @@ -22,10 +22,10 @@ require ( k8s.io/code-generator v0.30.3 knative.dev/caching v0.0.0-20241022012359-41bbaf964d16 knative.dev/eventing v0.43.3 - knative.dev/hack v0.0.0-20250114120502-30344aeba756 + knative.dev/hack v0.0.0-20250117112405-6cb0feb3ac46 knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364 - knative.dev/serving v0.43.0 + knative.dev/serving v0.43.1 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index 704dd9b232..116682f79f 100644 --- a/go.sum +++ b/go.sum @@ -1395,16 +1395,16 @@ knative.dev/caching v0.0.0-20241022012359-41bbaf964d16 h1:vQ0y0mO1ALdOd/FPiw7gf1 knative.dev/caching v0.0.0-20241022012359-41bbaf964d16/go.mod h1:qOvjasSUI+GyF4hsqJmIomblcgjkLzJhng8/zk0B9J4= knative.dev/eventing v0.43.3 h1:xt10rMoe6t1hFPPrnsR5NYe/vWRXQqLgRK8lS6n5mU8= knative.dev/eventing v0.43.3/go.mod h1:pdrF+bEUfRkNn9ifWXS7DoVj5W31gA5KQVd8iwplXUo= -knative.dev/hack v0.0.0-20250114120502-30344aeba756 h1:WOZy3XeC4frTOCHmmPjPj70ojyeAjO8MtNfO02nMq0w= -knative.dev/hack v0.0.0-20250114120502-30344aeba756/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= +knative.dev/hack v0.0.0-20250117112405-6cb0feb3ac46 h1:UWX4qXgehoigmCH/db5ZldJ9V2pLVKA88Qes7Q0+XSI= +knative.dev/hack v0.0.0-20250117112405-6cb0feb3ac46/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= knative.dev/networking v0.0.0-20241022012959-60e29ff520dc h1:0d9XXRLlyuHfINZLlYqo/BYe/+chqqNBMLKJldjTbtw= knative.dev/networking v0.0.0-20241022012959-60e29ff520dc/go.mod h1:G56j6VCLzfaN9yZ4IqfNyN4c3U1czvhUmKeZX4UjQ8Q= knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad h1:Nrjtr2H168rJeamH4QdyLMV1lEKHejNhaj1ymgQMfLk= knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad/go.mod h1:StJI72GWcm/iErmk4RqFJiOo8RLbVqPbHxUqeVwAzeo= knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364 h1:DIc+vbaFKOSGktPXJ1MaXIXoDjlmUIXQkHiZaPcYGbQ= knative.dev/reconciler-test v0.0.0-20241015093232-09111f0f1364/go.mod h1:PVRnK/YQo9s3foRtut00oAxvCPc9f/qV2PApZh/rMPw= -knative.dev/serving v0.43.0 h1:S+nCHYBaKo8r1kge6zF7hDxQrag5rwMkQTSZyDmrYIc= -knative.dev/serving v0.43.0/go.mod h1:qYjwZdjv3SD7t+Tk/hvxml824G5njXZrycmCBBALpJk= +knative.dev/serving v0.43.1 h1:CAD1wtW6rlv8echp2BNGQUsxVKtFv69RWCy/m+dT0x0= +knative.dev/serving v0.43.1/go.mod h1:KhhRhb3HPyKSm924/QRjqtAj2U0x5UZM217SxVTbibs= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= diff --git a/vendor/knative.dev/hack/release.sh b/vendor/knative.dev/hack/release.sh index a378a5f805..a9901aa341 100644 --- a/vendor/knative.dev/hack/release.sh +++ b/vendor/knative.dev/hack/release.sh @@ -90,11 +90,10 @@ export GOFLAGS="-ldflags=-s -ldflags=-w" export GITHUB_TOKEN="" readonly IMAGES_REFS_FILE="${IMAGES_REFS_FILE:-$(mktemp -d)/images_refs.txt}" -# Convenience function to run the hub tool. -# Parameters: $1..$n - arguments to hub. -function hub_tool() { - # Pinned to SHA because of https://github.com/github/hub/issues/2517 - go_run github.com/github/hub/v2@363513a "$@" +# Convenience function to run the GitHub CLI tool `gh`. +# Parameters: $1..$n - arguments to gh. +function gh_tool() { + go_run github.com/cli/cli/v2/cmd/gh@v2.65.0 "$@" } # Shortcut to "git push" that handles authentication. @@ -193,7 +192,7 @@ function prepare_dot_release() { # Support tags in two formats # - knative-v1.0.0 # - v1.0.0 - releases="$(hub_tool release | cut -d '-' -f2)" + releases="$(gh_tool release list --json tagName --jq '.[].tagName' | cut -d '-' -f2)" echo "Current releases are: ${releases}" [[ $? -eq 0 ]] || abort "cannot list releases" # If --release-branch passed, restrict to that release @@ -218,7 +217,7 @@ function prepare_dot_release() { # Ensure there are new commits in the branch, otherwise we don't create a new release setup_branch # Use the original tag (ie. potentially with a knative- prefix) when determining the last version commit sha - local github_tag="$(hub_tool release | grep "${last_version}")" + local github_tag="$(gh_tool release list --json tagName --jq '.[].tagName' | grep "${last_version}")" local last_release_commit="$(git rev-list -n 1 "${github_tag}")" local last_release_commit_filtered="$(git rev-list --invert-grep --grep "\[skip-dot-release\]" -n 1 "${github_tag}")" local release_branch_commit="$(git rev-list -n 1 upstream/"${RELEASE_BRANCH}")" @@ -239,7 +238,7 @@ function prepare_dot_release() { # If --release-notes not used, copy from the latest release if [[ -z "${RELEASE_NOTES}" ]]; then RELEASE_NOTES="$(mktemp)" - hub_tool release show -f "%b" "${github_tag}" > "${RELEASE_NOTES}" + gh_tool release view "${github_tag}" --json "body" --jq '.body' > "${RELEASE_NOTES}" echo "Release notes from ${last_version} copied to ${RELEASE_NOTES}" fi } @@ -640,18 +639,12 @@ function set_latest_to_highest_semver() { local last_version release_id # don't combine with assignment else $? will be 0 - last_version="$(hub_tool -p release | cut -d'-' -f2 | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$'| sort -r -V | head -1)" + last_version="$(gh_tool release list --json tagName --jq '.[].tagName' | cut -d'-' -f2 | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$'| sort -r -V | head -1)" if ! [[ $? -eq 0 ]]; then abort "cannot list releases" fi - - release_id="$(hub_tool api "/repos/${ORG_NAME}/${REPO_NAME}/releases/tags/knative-${last_version}" | jq .id)" - if [[ $? -ne 0 ]]; then - abort "cannot get relase id from github" - fi - - hub_tool api --method PATCH "/repos/${ORG_NAME}/${REPO_NAME}/releases/$release_id" \ - -F make_latest=true > /dev/null || abort "error setting $last_version to 'latest'" + + gh_tool release edit "knative-${last_version}" --latest > /dev/null || abort "error setting $last_version to 'latest'" echo "Github release ${last_version} set as 'latest'" } @@ -742,12 +735,14 @@ function publish_to_github() { local description="$(mktemp)" local attachments_dir="$(mktemp -d)" local commitish="" + local target_branch="" local github_tag="knative-${TAG}" # Copy files to a separate dir + # shellcheck disable=SC2068 for artifact in $@; do cp ${artifact} "${attachments_dir}"/ - attachments+=("--attach=${artifact}#$(basename ${artifact})") + attachments+=("${artifact}#$(basename ${artifact})") done echo -e "${title}\n" > "${description}" if [[ -n "${RELEASE_NOTES}" ]]; then @@ -774,13 +769,16 @@ function publish_to_github() { git tag -a "${github_tag}" -m "${title}" git_push tag "${github_tag}" - [[ -n "${RELEASE_BRANCH}" ]] && commitish="--commitish=${RELEASE_BRANCH}" + [[ -n "${RELEASE_BRANCH}" ]] && target_branch="--target=${RELEASE_BRANCH}" for i in {2..0}; do - hub_tool release create \ - ${attachments[@]} \ - --file="${description}" \ - "${commitish}" \ - "${github_tag}" && return 0 + # shellcheck disable=SC2068 + gh_tool release create \ + "${github_tag}" \ + --title "${title}" \ + --notes-file "${description}" \ + "${target_branch}" \ + ${attachments[@]} && return 0 + if [[ "${i}" -gt 0 ]]; then echo "Error publishing the release, retrying in 15s..." sleep 15 diff --git a/vendor/knative.dev/serving/pkg/testing/v1/revision.go b/vendor/knative.dev/serving/pkg/testing/v1/revision.go index a3cd452fd9..085e8f8e35 100644 --- a/vendor/knative.dev/serving/pkg/testing/v1/revision.go +++ b/vendor/knative.dev/serving/pkg/testing/v1/revision.go @@ -152,12 +152,27 @@ func MarkDeploying(reason string) RevisionOption { } } +// MarkContainerHealthyUnknown changes the ContainerHealthy condition to Unknown with the given reason func MarkContainerHealthyUnknown(reason string) RevisionOption { return func(r *v1.Revision) { r.Status.MarkContainerHealthyUnknown(reason, "") } } +// MarkContainerHealthyFalse changes the ContainerHealthy condition to False with the given reason +func MarkContainerHealthyFalse(reason string) RevisionOption { + return func(r *v1.Revision) { + r.Status.MarkContainerHealthyFalse(reason, "") + } +} + +// MarkContainerHealthyTrue changes the ContainerHealthy condition to True +func MarkContainerHealthyTrue() RevisionOption { + return func(r *v1.Revision) { + r.Status.MarkContainerHealthyTrue() + } +} + // MarkProgressDeadlineExceeded calls the method of the same name on the Revision // with the message we expect the Revision Reconciler to pass. func MarkProgressDeadlineExceeded(message string) RevisionOption { diff --git a/vendor/modules.txt b/vendor/modules.txt index 1090b4e4d9..6769fb4ccf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1453,7 +1453,7 @@ knative.dev/eventing/test/upgrade/prober/wathola/fetcher knative.dev/eventing/test/upgrade/prober/wathola/forwarder knative.dev/eventing/test/upgrade/prober/wathola/receiver knative.dev/eventing/test/upgrade/prober/wathola/sender -# knative.dev/hack v0.0.0-20250114120502-30344aeba756 +# knative.dev/hack v0.0.0-20250117112405-6cb0feb3ac46 ## explicit; go 1.21 knative.dev/hack # knative.dev/networking v0.0.0-20241022012959-60e29ff520dc @@ -1582,7 +1582,7 @@ knative.dev/reconciler-test/pkg/resources/service knative.dev/reconciler-test/pkg/resources/serviceaccount knative.dev/reconciler-test/pkg/state knative.dev/reconciler-test/resources/certificate -# knative.dev/serving v0.43.0 +# knative.dev/serving v0.43.1 ## explicit; go 1.22.0 knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1