Skip to content

Commit

Permalink
upgrade to latest dependencies (#600)
Browse files Browse the repository at this point in the history
bumping knative.dev/hack b979959...9c9eed6:
  > 9c9eed6 💝 Vendorless codegen via shell scripting (# 386)
bumping knative.dev/eventing c3baeda...1aa3407:
  > 1aa3407 fix: workflow syntax for weekly reminder (# 8115)
  > d7708f9 feat: add github workflow to send slack reminder for office hours (# 8113)
bumping knative.dev/serving 34cef98...873602a:
  > 873602a clean up (# 15415)
  > 7411254 Do not run TestTLSCertificateRotation in parallel with other tests (# 15417)
  > 7643497 Update net-kourier nightly (# 15413)
  > 2792dcb Update net-contour nightly (# 15411)
  > 7ed4aa0 Update net-gateway-api nightly (# 15410)
  > dec852b Update net-istio nightly (# 15412)
  > 7d318cd Use a different 'static' image that supports s390x and ppc (# 15407)
  > 79dd728 Update net-istio nightly (# 15406)
  > b41a9e3 Update net-gateway-api nightly (# 15404)
  > 53810f8 Update net-istio nightly (# 15403)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Jul 30, 2024
1 parent bf7b08d commit 177de07
Show file tree
Hide file tree
Showing 11 changed files with 415 additions and 115 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ require (
k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
knative.dev/eventing v0.42.0
knative.dev/hack v0.0.0-20240704013904-b9799599afcf
knative.dev/eventing v0.42.1-0.20240726162305-1aa34076f937
knative.dev/hack v0.0.0-20240719133331-9c9eed6f6679
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608
knative.dev/serving v0.42.0
knative.dev/serving v0.42.1-0.20240729144911-873602a410ce
)

require (
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -789,16 +789,16 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/eventing v0.42.0 h1:pbPPhV4JlgpHBZxLBhJTUf+4HuZe5y/zlkOGHZfvtZ0=
knative.dev/eventing v0.42.0/go.mod h1:hW5BMYcihtCelT9pqaMtK8gmNOo1ybxcigjBY+/fU+k=
knative.dev/hack v0.0.0-20240704013904-b9799599afcf h1:n92FmZRywgtHso7pFAku7CW0qvRAs1hXtMQqO0R6eiE=
knative.dev/hack v0.0.0-20240704013904-b9799599afcf/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/eventing v0.42.1-0.20240726162305-1aa34076f937 h1:uM7sTfLYbYKeCPQJ5UV31HsNFyKjU5/+thtHXKZmxts=
knative.dev/eventing v0.42.1-0.20240726162305-1aa34076f937/go.mod h1:hW5BMYcihtCelT9pqaMtK8gmNOo1ybxcigjBY+/fU+k=
knative.dev/hack v0.0.0-20240719133331-9c9eed6f6679 h1:tvbANb4KIO91DT1FGR4yCLA5E0qAmIeQ3DAGOkZGg4k=
knative.dev/hack v0.0.0-20240719133331-9c9eed6f6679/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556 h1:9OTyJkrjiFh/burZiti3WucGv8Qtt91VJTnXfO5dC2g=
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556/go.mod h1:1PosUDkXqoHNzYxtLIwa7LFqSsIXBShHOseAb6XBeEU=
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608 h1:BOiRzcnRS9Z5ruxlCiS/K1/Hb5bUN0X4W3xCegdcYQE=
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608/go.mod h1:M67lDZ4KbltYSon0Ox4/6qjlZNOIXW4Ldequ81yofbw=
knative.dev/serving v0.42.0 h1:utItXW+L6inUfJ7Y1LgnbAMc/RyxvvAQNliGU2XC34s=
knative.dev/serving v0.42.0/go.mod h1:3cgU8/864RcqA0ZPrc3jFcmS3uJL/mOlUZiYsXonwaE=
knative.dev/serving v0.42.1-0.20240729144911-873602a410ce h1:aFTzN4fK7Lce3MnAhxrVbeL39E7DDQz+6hrqcEP3fkA=
knative.dev/serving v0.42.1-0.20240729144911-873602a410ce/go.mod h1:3cgU8/864RcqA0ZPrc3jFcmS3uJL/mOlUZiYsXonwaE=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
15 changes: 15 additions & 0 deletions vendor/knative.dev/hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
Copyright #{YEAR} The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
159 changes: 147 additions & 12 deletions vendor/knative.dev/hack/codegen-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,156 @@

# Setup the env for doing Knative style codegen.

kn_hack_library=${kn_hack_library:-"$(dirname $0)/../vendor/knative.dev/hack/library.sh"}
# Store Bash options
oldstate="$(set +o)"

set -Eeuo pipefail

export repodir kn_hack_dir kn_hack_library \
MODULE_NAME CODEGEN_TMP_GOPATH CODEGEN_ORIGINAL_GOPATH GOPATH GOBIN \
CODEGEN_PKG KNATIVE_CODEGEN_PKG

kn_hack_dir="$(realpath "$(dirname "${BASH_SOURCE[0]:-$0}")")"
kn_hack_library=${kn_hack_library:-"${kn_hack_dir}/library.sh"}

if [[ -f "$kn_hack_library" ]]; then
source $kn_hack_library
# shellcheck disable=SC1090
source "$kn_hack_library"
else
echo "this file is intended to be imported from a golang project that vendors knative.dev/hack"
exit
echo "The \$kn_hack_library points to a non-existent file: $kn_hack_library" >&2
exit 42
fi

export MODULE_NAME=$(go_mod_module_name)
export GOPATH=$(go_mod_gopath_hack)
export GOBIN=${GOPATH}/bin # Set GOBIN explicitly as deepcopy-gen is installed by go install.
export CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
export KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/knative.dev/pkg 2>/dev/null || echo "${REPO_ROOT_DIR}")}
repodir="$(go_run knative.dev/toolbox/modscope@latest current --path)"

function go-resolve-pkg-dir() {
local pkg="${1:?Pass the package name}"
local pkgdir
if [ -d "${repodir}/vendor" ]; then
pkgdir="${repodir}/vendor/${pkg}"
if [ -d "${pkgdir}" ]; then
echo "${pkgdir}"
return 0
else
return 1
fi
else
go mod download -x > /dev/stderr
go list -m -f '{{.Dir}}' "${pkg}" 2>/dev/null
return $?
fi
}

# Change dir to the original executing script's directory, not the current source!
pushd "$(dirname "$(realpath "$0")")" > /dev/null

if ! CODEGEN_PKG="${CODEGEN_PKG:-"$(go-resolve-pkg-dir k8s.io/code-generator)"}"; then
warning "Failed to determine the k8s.io/code-generator package"
fi
if ! KNATIVE_CODEGEN_PKG="${KNATIVE_CODEGEN_PKG:-"$(go-resolve-pkg-dir knative.dev/pkg)"}"; then
warning "Failed to determine the knative.dev/pkg package"
fi

popd > /dev/null

CODEGEN_ORIGINAL_GOPATH="$(go env GOPATH)"
CODEGEN_TMP_GOPATH=$(go_mod_gopath_hack)
GOPATH="${CODEGEN_TMP_GOPATH}"
GOBIN="${GOPATH}/bin" # Set GOBIN explicitly as k8s-gen' are installed by go install.

if [[ -n "${CODEGEN_PKG}" ]] && ! [ -x "${CODEGEN_PKG}/generate-groups.sh" ]; then
chmod +x "${CODEGEN_PKG}/generate-groups.sh"
chmod +x "${CODEGEN_PKG}/generate-internal-groups.sh"
fi
if [[ -n "${KNATIVE_CODEGEN_PKG}" ]] && ! [ -x "${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh" ]; then
chmod +x "${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh"
fi

# Generate boilerplate file with the current year
function boilerplate() {
local go_header_file="${kn_hack_dir}/boilerplate.go.txt"
local current_boilerplate_file="${TMPDIR}/boilerplate.go.txt"
# Replace #{YEAR} with the current year
sed "s/#{YEAR}/$(date +%Y)/" \
< "${go_header_file}" \
> "${current_boilerplate_file}"
echo "${current_boilerplate_file}"
}

# Generate K8s' groups codegen
function generate-groups() {
if [[ -z "${CODEGEN_PKG}" ]]; then
abort "CODEGEN_PKG is not set"
fi
"${CODEGEN_PKG}"/generate-groups.sh \
"$@" \
--go-header-file "$(boilerplate)"
}

# Generate K8s' internal groups codegen
function generate-internal-groups() {
if [[ -z "${CODEGEN_PKG}" ]]; then
abort "CODEGEN_PKG is not set"
fi
"${CODEGEN_PKG}"/generate-internal-groups.sh \
"$@" \
--go-header-file "$(boilerplate)"
}

# Generate Knative style codegen
function generate-knative() {
if [[ -z "${KNATIVE_CODEGEN_PKG}" ]]; then
abort "KNATIVE_CODEGEN_PKG is not set"
fi
"${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh" \
"$@" \
--go-header-file "$(boilerplate)"
}

# Cleanup after generating code
function cleanup-codegen() {
restore-changes-if-its-copyright-year-only
restore-gopath
}

# Restore changes if the file contains only the change in the copyright year
function restore-changes-if-its-copyright-year-only() {
local difflist
log "Cleaning up generated code"
difflist="$(mktemp)"
git diff --exit-code --name-only > "$difflist"
# list git changes and skip those which differ only in the boilerplate year
while read -r file; do
# check if the file contains just the change in the boilerplate year
if [ "$(LANG=C git diff --exit-code --shortstat -- "$file")" = ' 1 file changed, 1 insertion(+), 1 deletion(-)' ] && \
[[ "$(git diff --exit-code -U1 -- "$file" | grep -Ec '^[+-]\s*[*#]?\s*Copyright 2[0-9]{3}')" -eq 2 ]]; then
# restore changes to that file
git checkout -- "$file"
fi
done < "$difflist"
rm -f "$difflist"
}

# Restore the GOPATH and clean up the temporary directory
function restore-gopath() {
# Skip this if the directory is already checked out onto the GOPATH.
if __is_checkout_onto_gopath; then
return
fi
if [ -d "$CODEGEN_TMP_GOPATH" ]; then
chmod -R u+w "${CODEGEN_TMP_GOPATH}"
rm -rf "${CODEGEN_TMP_GOPATH}"
unset CODEGEN_TMP_GOPATH
fi
unset GOPATH GOBIN
# Restore the original GOPATH, if it was different from the default one.
if [ "$CODEGEN_ORIGINAL_GOPATH" != "$(go env GOPATH)" ]; then
export GOPATH="$CODEGEN_ORIGINAL_GOPATH"
fi
unset CODEGEN_ORIGINAL_GOPATH
}

add_trap cleanup-codegen EXIT

[ -x ${CODEGEN_PKG}/generate-groups.sh ] || chmod +x ${CODEGEN_PKG}/generate-groups.sh
[ -x ${CODEGEN_PKG}/generate-internal-groups.sh ] || chmod +x ${CODEGEN_PKG}/generate-internal-groups.sh
[ -x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh ] || chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh
# Restore Bash options
eval "$oldstate"
2 changes: 1 addition & 1 deletion vendor/knative.dev/hack/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ import (
"embed"
)

//go:embed *.sh
//go:embed *.sh *.go.txt
var Scripts embed.FS
2 changes: 1 addition & 1 deletion vendor/knative.dev/hack/go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.18
go 1.21

use (
.
Expand Down
Loading

0 comments on commit 177de07

Please sign in to comment.