Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Kubernetes dependencies to v1.30 #45

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.6
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
Expand All @@ -36,7 +38,7 @@ jobs:
- name: install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.6
- name: verify
run: hack/verify-all.sh -v
env:
Expand All @@ -54,7 +56,7 @@ jobs:
- name: install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.6
- name: make test
run: make test
env:
Expand All @@ -71,7 +73,7 @@ jobs:
- name: install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.6
- name: images
run: make docker-build
env:
Expand Down
2 changes: 1 addition & 1 deletion cmd/workcontroller/workcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (

func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(v1alpha1.Install(scheme))
}

func main() {
Expand Down
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module sigs.k8s.io/work-api

go 1.21
go 1.22.6

require (
github.com/go-logr/logr v1.4.1
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
k8s.io/api v0.29.8
k8s.io/apimachinery v0.29.8
k8s.io/client-go v0.29.8
k8s.io/code-generator v0.29.8
sigs.k8s.io/controller-runtime v0.17.5
sigs.k8s.io/controller-tools v0.14.0
github.com/onsi/gomega v1.33.0
k8s.io/api v0.30.4
k8s.io/apimachinery v0.30.4
k8s.io/client-go v0.30.4
k8s.io/code-generator v0.30.4
sigs.k8s.io/controller-runtime v0.18.3
sigs.k8s.io/controller-tools v0.15.0
)

require (
Expand All @@ -20,7 +20,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
Expand Down Expand Up @@ -57,26 +57,26 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.16.1 // indirect
golang.org/x/tools v0.20.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
86 changes: 38 additions & 48 deletions go.sum

Large diffs are not rendered by default.

43 changes: 18 additions & 25 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,44 @@ gobin="${GOBIN:-$(go env GOPATH)/bin}"

OUTPUT_PKG=sigs.k8s.io/work-api/pkg/client
FQ_APIS=sigs.k8s.io/work-api/pkg/apis/v1alpha1
APIS_PKG=sigs.k8s.io/work-api
CLIENTSET_NAME=versioned
CLIENTSET_PKG_NAME=clientset

if [[ "${VERIFY_CODEGEN:-}" == "true" ]]; then
echo "Running in verification mode"
VERIFY_FLAG="--verify-only"
fi
COMMON_FLAGS="${VERIFY_FLAG:-} --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt"

# code generator tools rely on the environment variable GOPATH and generates files to $GOPATH/src/.
export GOPATH=$(go env GOPATH | awk -F ':' '{print $1}')

echo "Generating deepcopy funcs"
"${gobin}/deepcopy-gen" \
--input-dirs=sigs.k8s.io/work-api/pkg/apis/v1alpha1 \
--output-package=sigs.k8s.io/work-api/pkg/apis/v1alpha1 \
--output-file-base=zz_generated.deepcopy \
${COMMON_FLAGS}
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt \
--output-file=zz_generated.deepcopy.go \
sigs.k8s.io/work-api/pkg/apis/v1alpha1

echo "Generating register at ${FQ_APIS}"
"${gobin}/register-gen" \
--input-dirs=sigs.k8s.io/work-api/pkg/apis/v1alpha1 \
--output-package=sigs.k8s.io/work-api/pkg/apis/v1alpha1 \
--output-file-base=zz_generated.register \
${COMMON_FLAGS}
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt \
--output-file=zz_generated.register.go \
sigs.k8s.io/work-api/pkg/apis/v1alpha1

echo "Generating clientset at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}"
"${gobin}/client-gen" \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt \
--input-base="" \
--input=sigs.k8s.io/work-api/pkg/apis/v1alpha1 \
--output-package=sigs.k8s.io/work-api/pkg/client/clientset \
--clientset-name=versioned \
${COMMON_FLAGS}
--output-pkg=sigs.k8s.io/work-api/pkg/client/clientset \
--output-dir=pkg/client/clientset \
--clientset-name=versioned

echo "Generating listers at ${OUTPUT_PKG}/listers"
"${gobin}/lister-gen" \
--input-dirs=sigs.k8s.io/work-api/pkg/apis/v1alpha1 \
--output-package=sigs.k8s.io/work-api/pkg/client/listers \
${COMMON_FLAGS}
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt \
--output-pkg=sigs.k8s.io/work-api/pkg/client/listers \
--output-dir=pkg/client/listers \
sigs.k8s.io/work-api/pkg/apis/v1alpha1

echo "Generating informers at ${OUTPUT_PKG}/informers"
"${gobin}/informer-gen" \
--input-dirs=sigs.k8s.io/work-api/pkg/apis/v1alpha1 \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt \
--versioned-clientset-package=sigs.k8s.io/work-api/pkg/client/clientset/versioned \
--listers-package=sigs.k8s.io/work-api/pkg/client/listers \
--output-package=sigs.k8s.io/work-api/pkg/client/informers \
${COMMON_FLAGS}
--output-pkg=sigs.k8s.io/work-api/pkg/client/informers \
--output-dir=pkg/client/informers \
sigs.k8s.io/work-api/pkg/apis/v1alpha1
28 changes: 27 additions & 1 deletion hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,30 @@ set -o pipefail
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..

cd $SCRIPT_ROOT
VERIFY_CODEGEN=true $SCRIPT_ROOT/hack/update-codegen.sh

DIFFROOT="${SCRIPT_ROOT}/pkg"
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
_tmp="${SCRIPT_ROOT}/_tmp"

cleanup() {
rm -rf "${_tmp}"
}
trap "cleanup" EXIT SIGINT

cleanup

mkdir -p "${TMP_DIFFROOT}"
cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"

bash "${SCRIPT_ROOT}/hack/update-codegen.sh"
echo "diffing ${DIFFROOT} against freshly generated codegen"
ret=0
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}"
if [[ $ret -eq 0 ]]
then
echo "${DIFFROOT} up to date."
else
echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh"
exit 1
fi
5 changes: 4 additions & 1 deletion pkg/apis/v1alpha1/zz_generated.register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var _ = BeforeSuite(func(done Done) {
Expect(err).ToNot(HaveOccurred())
Expect(cfg).ToNot(BeNil())

err = workv1alpha1.AddToScheme(scheme.Scheme)
err = workv1alpha1.Install(scheme.Scheme)
Expect(err).NotTo(HaveOccurred())

opts := ctrl.Options{
Expand Down
Loading