diff --git a/.github/workflows/e2e-test-darts-cifar10.yaml b/.github/workflows/e2e-test-darts-cifar10.yaml index 17b5ae0986d..7091ec3dd9a 100644 --- a/.github/workflows/e2e-test-darts-cifar10.yaml +++ b/.github/workflows/e2e-test-darts-cifar10.yaml @@ -33,6 +33,6 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3"] + kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3", "v1.32.2"] # Comma Delimited experiments: ["darts-cpu"] diff --git a/.github/workflows/e2e-test-enas-cifar10.yaml b/.github/workflows/e2e-test-enas-cifar10.yaml index 8d95aed17e4..2328900a7c2 100644 --- a/.github/workflows/e2e-test-enas-cifar10.yaml +++ b/.github/workflows/e2e-test-enas-cifar10.yaml @@ -33,6 +33,6 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3"] + kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3", "v1.32.2"] # Comma Delimited experiments: ["enas-cpu"] diff --git a/.github/workflows/e2e-test-pytorch-mnist.yaml b/.github/workflows/e2e-test-pytorch-mnist.yaml index 629e321710b..7275336a210 100644 --- a/.github/workflows/e2e-test-pytorch-mnist.yaml +++ b/.github/workflows/e2e-test-pytorch-mnist.yaml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3"] + kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3", "v1.32.2"] # Comma Delimited experiments: # suggestion-hyperopt diff --git a/.github/workflows/e2e-test-simple-pbt.yaml b/.github/workflows/e2e-test-simple-pbt.yaml index 259f793903e..28519977a30 100644 --- a/.github/workflows/e2e-test-simple-pbt.yaml +++ b/.github/workflows/e2e-test-simple-pbt.yaml @@ -33,6 +33,6 @@ jobs: fail-fast: false matrix: # Detail: https://hub.docker.com/r/kindest/node - kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3"] + kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3", "v1.32.2"] # Comma Delimited experiments: ["simple-pbt"] diff --git a/.github/workflows/e2e-test-tf-mnist-with-summaries.yaml b/.github/workflows/e2e-test-tf-mnist-with-summaries.yaml index 5072ce43e31..47a4de10c07 100644 --- a/.github/workflows/e2e-test-tf-mnist-with-summaries.yaml +++ b/.github/workflows/e2e-test-tf-mnist-with-summaries.yaml @@ -33,6 +33,6 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3"] + kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3", "v1.32.2"] # Comma Delimited experiments: ["tfjob-mnist-with-summaries"] diff --git a/.github/workflows/e2e-test-tune-api.yaml b/.github/workflows/e2e-test-tune-api.yaml index 998ced775f9..2203e123a89 100644 --- a/.github/workflows/e2e-test-tune-api.yaml +++ b/.github/workflows/e2e-test-tune-api.yaml @@ -32,4 +32,4 @@ jobs: fail-fast: false matrix: # Detail: https://hub.docker.com/r/kindest/node - kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3"] + kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3", "v1.32.2"] diff --git a/.github/workflows/e2e-test-ui-random-search-postgres.yaml b/.github/workflows/e2e-test-ui-random-search-postgres.yaml index a3bcb1ff8c2..2689a532a3b 100644 --- a/.github/workflows/e2e-test-ui-random-search-postgres.yaml +++ b/.github/workflows/e2e-test-ui-random-search-postgres.yaml @@ -32,4 +32,4 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3"] + kubernetes-version: ["v1.29.2", "v1.30.7", "v1.31.3", "v1.32.2"] diff --git a/.github/workflows/test-go.yaml b/.github/workflows/test-go.yaml index 723e1664b92..6d080c794b1 100644 --- a/.github/workflows/test-go.yaml +++ b/.github/workflows/test-go.yaml @@ -67,7 +67,7 @@ jobs: fail-fast: false matrix: # Detail: `setup-envtest list` - kubernetes-version: ["1.29.3", "1.30.0", "1.31.0"] + kubernetes-version: ["1.29.3", "1.30.0", "1.31.0", "1.32.0"] # notifies that all test jobs are finished. finish: diff --git a/Makefile b/Makefile index bd6ce2c4e64..c15fd6a62d4 100755 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ HAS_MOCKGEN := $(shell command -v mockgen;) COMMIT := v1beta1-$(shell git rev-parse --short=7 HEAD) KATIB_REGISTRY := docker.io/kubeflowkatib CPU_ARCH ?= linux/amd64,linux/arm64 -ENVTEST_K8S_VERSION ?= 1.31 +ENVTEST_K8S_VERSION ?= 1.32 MOCKGEN_VERSION ?= $(shell grep 'go.uber.org/mock' go.mod | cut -d ' ' -f 2) GO_VERSION=$(shell grep '^go' go.mod | cut -d ' ' -f 2) GOPATH ?= $(shell go env GOPATH) @@ -21,7 +21,7 @@ test: envtest envtest: ifndef HAS_SETUP_ENVTEST - go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.19 + go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.20 $(info "setup-envtest has been installed") endif $(info "setup-envtest has already installed") @@ -33,7 +33,7 @@ fmt: lint: ifndef HAS_LINT - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 $(info "golangci-lint has been installed") endif hack/verify-golangci-lint.sh @@ -86,7 +86,7 @@ go-mod-download: CONTROLLER_GEN = $(shell pwd)/bin/controller-gen .PHONY: controller-gen controller-gen: - @GOBIN=$(shell pwd)/bin GO111MODULE=on go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5 + @GOBIN=$(shell pwd)/bin GO111MODULE=on go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2 # Run this if you update any existing controller APIs. # 1. Generate deepcopy, clientset, listers, informers for the APIs (hack/update-codegen.sh) diff --git a/go.mod b/go.mod index 507612a2853..39b43268319 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubeflow/katib -go 1.22.0 +go 1.23.0 require ( github.com/DATA-DOG/go-sqlmock v1.5.0 @@ -14,7 +14,7 @@ require ( github.com/lib/pq v1.10.6 github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a github.com/nxadm/tail v1.4.11 - github.com/onsi/gomega v1.35.1 + github.com/onsi/gomega v1.36.1 github.com/open-policy-agent/cert-controller v0.12.0 github.com/prometheus/client_golang v1.20.2 github.com/shirou/gopsutil/v3 v3.22.5 @@ -23,15 +23,15 @@ require ( go.uber.org/mock v0.4.0 google.golang.org/grpc v1.65.0 google.golang.org/protobuf v1.35.1 - k8s.io/api v0.31.3 - k8s.io/apimachinery v0.31.3 - k8s.io/client-go v0.31.3 - k8s.io/code-generator v0.31.3 + k8s.io/api v0.32.2 + k8s.io/apimachinery v0.32.2 + k8s.io/client-go v0.32.2 + k8s.io/code-generator v0.32.2 k8s.io/klog/v2 v2.130.1 - k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f - k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.19.1 - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 + sigs.k8s.io/controller-runtime v0.20.2 + sigs.k8s.io/structured-merge-diff/v4 v4.4.2 sigs.k8s.io/yaml v1.4.0 ) @@ -73,7 +73,7 @@ require ( github.com/docker/docker-credential-helpers v0.7.0 // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -84,14 +84,13 @@ require ( github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.1 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect + github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20230516205744-dbecb1de8cfa // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -127,28 +126,27 @@ require ( github.com/yusufpapurcu/wmi v1.2.2 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/mod v0.20.0 // indirect + golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.24.0 // indirect + golang.org/x/time v0.7.0 // indirect + golang.org/x/tools v0.26.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect gonum.org/v1/gonum v0.8.2 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.63.2 // 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.31.2 // indirect - k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + k8s.io/apiextensions-apiserver v0.32.1 // indirect + k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect ) diff --git a/go.sum b/go.sum index e241a03b415..ac1588e69ac 100644 --- a/go.sum +++ b/go.sum @@ -195,8 +195,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= -github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -252,8 +252,6 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -287,6 +285,8 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v1.10.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= @@ -335,8 +335,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -386,8 +386,6 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -533,10 +531,10 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= -github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= -github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= -github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= +github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw= +github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/open-policy-agent/cert-controller v0.12.0 h1:RKXlBafMcCh+++I1geJetXo77tAjyb4542DQc/+aZIw= github.com/open-policy-agent/cert-controller v0.12.0/go.mod h1:N5bCFXdAXMYx0PdS6ZQ9lrDQQMz+F6deoChym6VleXw= github.com/open-policy-agent/frameworks/constraint v0.0.0-20241101234656-e78c8abd754a h1:gQtOJ50XFyL2Xh3lDD9zP4KQ2PY4mZKQ9hDcWc81Sp8= @@ -706,8 +704,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -773,8 +771,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -839,8 +837,8 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -952,8 +950,8 @@ golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= +golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1019,8 +1017,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1129,8 +1127,8 @@ google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKr google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1205,7 +1203,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorgonia.org/cu v0.9.0-beta/go.mod h1:RPEPIfaxxqUmeRe7T1T8a0NER+KxBI2McoLEXhP1Vd8= @@ -1236,26 +1233,26 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= -k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= -k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= -k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= -k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= -k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= -k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= -k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI= -k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= +k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= +k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw= +k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto= +k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ= +k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= +k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= +k8s.io/code-generator v0.32.2 h1:CIvyPrLWP7cMgrqval2qYT839YAwCDeSvGfXgWSNpHQ= +k8s.io/code-generator v0.32.2/go.mod h1:plh7bWk7JztAUkHM4zpbdy0KOMdrhsePcZL2HLWFH7Y= +k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 h1:si3PfKm8dDYxgfbeA6orqrtLkvvIeH8UqffFJDl0bz4= +k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-aggregator v0.31.2 h1:Uw1zUP2D/4wiSjKWVVzSOcCGLuW/+IdRwjjC0FJooYU= k8s.io/kube-aggregator v0.31.2/go.mod h1:41/VIXH+/Qcg9ERNAY6bRF/WQR6xL1wFgYagdHac1X4= -k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f h1:0LQagt0gDpKqvIkAMPaRGcXawNMouPECM1+F9BVxEaM= -k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f/go.mod h1:S9tOR0FxgyusSNR+MboCuiDpVWkAifZvaYI1Q2ubgro= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -1265,11 +1262,11 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= -sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/controller-runtime v0.20.2 h1:/439OZVxoEc02psi1h4QO3bHzTgu49bb347Xp4gW1pc= +sigs.k8s.io/controller-runtime v0.20.2/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/hack/verify-golangci-lint.sh b/hack/verify-golangci-lint.sh index 3d6a952a1c0..7572c57b7fd 100755 --- a/hack/verify-golangci-lint.sh +++ b/hack/verify-golangci-lint.sh @@ -25,4 +25,4 @@ if [ -z "$(command -v golangci-lint)" ]; then fi echo 'Running golangci-lint' -golangci-lint run --timeout 5m --go 1.22 +golangci-lint run --timeout 5m --go 1.23 diff --git a/pkg/client/controller/applyconfiguration/experiments/v1beta1/experiment.go b/pkg/client/controller/applyconfiguration/experiments/v1beta1/experiment.go index 9e4378a4b16..cbea3f720a5 100644 --- a/pkg/client/controller/applyconfiguration/experiments/v1beta1/experiment.go +++ b/pkg/client/controller/applyconfiguration/experiments/v1beta1/experiment.go @@ -48,7 +48,7 @@ func Experiment(name, namespace string) *ExperimentApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithKind(value string) *ExperimentApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -56,7 +56,7 @@ func (b *ExperimentApplyConfiguration) WithKind(value string) *ExperimentApplyCo // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithAPIVersion(value string) *ExperimentApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -65,7 +65,7 @@ func (b *ExperimentApplyConfiguration) WithAPIVersion(value string) *ExperimentA // If called multiple times, the Name field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithName(value string) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -74,7 +74,7 @@ func (b *ExperimentApplyConfiguration) WithName(value string) *ExperimentApplyCo // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithGenerateName(value string) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -83,7 +83,7 @@ func (b *ExperimentApplyConfiguration) WithGenerateName(value string) *Experimen // If called multiple times, the Namespace field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithNamespace(value string) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -92,7 +92,7 @@ func (b *ExperimentApplyConfiguration) WithNamespace(value string) *ExperimentAp // If called multiple times, the UID field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithUID(value types.UID) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -101,7 +101,7 @@ func (b *ExperimentApplyConfiguration) WithUID(value types.UID) *ExperimentApply // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithResourceVersion(value string) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -110,7 +110,7 @@ func (b *ExperimentApplyConfiguration) WithResourceVersion(value string) *Experi // If called multiple times, the Generation field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithGeneration(value int64) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -119,7 +119,7 @@ func (b *ExperimentApplyConfiguration) WithGeneration(value int64) *ExperimentAp // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -128,7 +128,7 @@ func (b *ExperimentApplyConfiguration) WithCreationTimestamp(value metav1.Time) // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -137,7 +137,7 @@ func (b *ExperimentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ExperimentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -147,11 +147,11 @@ func (b *ExperimentApplyConfiguration) WithDeletionGracePeriodSeconds(value int6 // overwriting an existing map entries in Labels field with the same key. func (b *ExperimentApplyConfiguration) WithLabels(entries map[string]string) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -162,11 +162,11 @@ func (b *ExperimentApplyConfiguration) WithLabels(entries map[string]string) *Ex // overwriting an existing map entries in Annotations field with the same key. func (b *ExperimentApplyConfiguration) WithAnnotations(entries map[string]string) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -180,7 +180,7 @@ func (b *ExperimentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRe if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -191,7 +191,7 @@ func (b *ExperimentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRe func (b *ExperimentApplyConfiguration) WithFinalizers(values ...string) *ExperimentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -221,5 +221,5 @@ func (b *ExperimentApplyConfiguration) WithStatus(value *ExperimentStatusApplyCo // GetName retrieves the value of the Name field in the declarative configuration. func (b *ExperimentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/pkg/client/controller/applyconfiguration/experiments/v1beta1/experimentcondition.go b/pkg/client/controller/applyconfiguration/experiments/v1beta1/experimentcondition.go index d84466f0c25..0cbb90d551f 100644 --- a/pkg/client/controller/applyconfiguration/experiments/v1beta1/experimentcondition.go +++ b/pkg/client/controller/applyconfiguration/experiments/v1beta1/experimentcondition.go @@ -19,7 +19,7 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -27,12 +27,12 @@ import ( // ExperimentConditionApplyConfiguration represents a declarative configuration of the ExperimentCondition type for use // with apply. type ExperimentConditionApplyConfiguration struct { - Type *v1beta1.ExperimentConditionType `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` - LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Type *experimentsv1beta1.ExperimentConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` + LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } // ExperimentConditionApplyConfiguration constructs a declarative configuration of the ExperimentCondition type for use with @@ -44,7 +44,7 @@ func ExperimentCondition() *ExperimentConditionApplyConfiguration { // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. -func (b *ExperimentConditionApplyConfiguration) WithType(value v1beta1.ExperimentConditionType) *ExperimentConditionApplyConfiguration { +func (b *ExperimentConditionApplyConfiguration) WithType(value experimentsv1beta1.ExperimentConditionType) *ExperimentConditionApplyConfiguration { b.Type = &value return b } diff --git a/pkg/client/controller/applyconfiguration/experiments/v1beta1/feasiblespace.go b/pkg/client/controller/applyconfiguration/experiments/v1beta1/feasiblespace.go index 36efba7b9f8..772335d9531 100644 --- a/pkg/client/controller/applyconfiguration/experiments/v1beta1/feasiblespace.go +++ b/pkg/client/controller/applyconfiguration/experiments/v1beta1/feasiblespace.go @@ -19,17 +19,17 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" ) // FeasibleSpaceApplyConfiguration represents a declarative configuration of the FeasibleSpace type for use // with apply. type FeasibleSpaceApplyConfiguration struct { - Max *string `json:"max,omitempty"` - Min *string `json:"min,omitempty"` - List []string `json:"list,omitempty"` - Step *string `json:"step,omitempty"` - Distribution *v1beta1.Distribution `json:"distribution,omitempty"` + Max *string `json:"max,omitempty"` + Min *string `json:"min,omitempty"` + List []string `json:"list,omitempty"` + Step *string `json:"step,omitempty"` + Distribution *experimentsv1beta1.Distribution `json:"distribution,omitempty"` } // FeasibleSpaceApplyConfiguration constructs a declarative configuration of the FeasibleSpace type for use with @@ -75,7 +75,7 @@ func (b *FeasibleSpaceApplyConfiguration) WithStep(value string) *FeasibleSpaceA // WithDistribution sets the Distribution field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Distribution field is set to the value of the last call. -func (b *FeasibleSpaceApplyConfiguration) WithDistribution(value v1beta1.Distribution) *FeasibleSpaceApplyConfiguration { +func (b *FeasibleSpaceApplyConfiguration) WithDistribution(value experimentsv1beta1.Distribution) *FeasibleSpaceApplyConfiguration { b.Distribution = &value return b } diff --git a/pkg/client/controller/applyconfiguration/experiments/v1beta1/optimaltrial.go b/pkg/client/controller/applyconfiguration/experiments/v1beta1/optimaltrial.go index 89668bd99e3..da7865b4154 100644 --- a/pkg/client/controller/applyconfiguration/experiments/v1beta1/optimaltrial.go +++ b/pkg/client/controller/applyconfiguration/experiments/v1beta1/optimaltrial.go @@ -19,15 +19,15 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" + commonv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" ) // OptimalTrialApplyConfiguration represents a declarative configuration of the OptimalTrial type for use // with apply. type OptimalTrialApplyConfiguration struct { - BestTrialName *string `json:"bestTrialName,omitempty"` - ParameterAssignments []v1beta1.ParameterAssignment `json:"parameterAssignments,omitempty"` - Observation *v1beta1.Observation `json:"observation,omitempty"` + BestTrialName *string `json:"bestTrialName,omitempty"` + ParameterAssignments []commonv1beta1.ParameterAssignment `json:"parameterAssignments,omitempty"` + Observation *commonv1beta1.Observation `json:"observation,omitempty"` } // OptimalTrialApplyConfiguration constructs a declarative configuration of the OptimalTrial type for use with @@ -47,7 +47,7 @@ func (b *OptimalTrialApplyConfiguration) WithBestTrialName(value string) *Optima // WithParameterAssignments adds the given value to the ParameterAssignments field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ParameterAssignments field. -func (b *OptimalTrialApplyConfiguration) WithParameterAssignments(values ...v1beta1.ParameterAssignment) *OptimalTrialApplyConfiguration { +func (b *OptimalTrialApplyConfiguration) WithParameterAssignments(values ...commonv1beta1.ParameterAssignment) *OptimalTrialApplyConfiguration { for i := range values { b.ParameterAssignments = append(b.ParameterAssignments, values[i]) } @@ -57,7 +57,7 @@ func (b *OptimalTrialApplyConfiguration) WithParameterAssignments(values ...v1be // WithObservation sets the Observation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Observation field is set to the value of the last call. -func (b *OptimalTrialApplyConfiguration) WithObservation(value v1beta1.Observation) *OptimalTrialApplyConfiguration { +func (b *OptimalTrialApplyConfiguration) WithObservation(value commonv1beta1.Observation) *OptimalTrialApplyConfiguration { b.Observation = &value return b } diff --git a/pkg/client/controller/applyconfiguration/experiments/v1beta1/parameterspec.go b/pkg/client/controller/applyconfiguration/experiments/v1beta1/parameterspec.go index acff6225928..29a8d4eec4b 100644 --- a/pkg/client/controller/applyconfiguration/experiments/v1beta1/parameterspec.go +++ b/pkg/client/controller/applyconfiguration/experiments/v1beta1/parameterspec.go @@ -19,15 +19,15 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" ) // ParameterSpecApplyConfiguration represents a declarative configuration of the ParameterSpec type for use // with apply. type ParameterSpecApplyConfiguration struct { - Name *string `json:"name,omitempty"` - ParameterType *v1beta1.ParameterType `json:"parameterType,omitempty"` - FeasibleSpace *FeasibleSpaceApplyConfiguration `json:"feasibleSpace,omitempty"` + Name *string `json:"name,omitempty"` + ParameterType *experimentsv1beta1.ParameterType `json:"parameterType,omitempty"` + FeasibleSpace *FeasibleSpaceApplyConfiguration `json:"feasibleSpace,omitempty"` } // ParameterSpecApplyConfiguration constructs a declarative configuration of the ParameterSpec type for use with @@ -47,7 +47,7 @@ func (b *ParameterSpecApplyConfiguration) WithName(value string) *ParameterSpecA // WithParameterType sets the ParameterType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParameterType field is set to the value of the last call. -func (b *ParameterSpecApplyConfiguration) WithParameterType(value v1beta1.ParameterType) *ParameterSpecApplyConfiguration { +func (b *ParameterSpecApplyConfiguration) WithParameterType(value experimentsv1beta1.ParameterType) *ParameterSpecApplyConfiguration { b.ParameterType = &value return b } diff --git a/pkg/client/controller/applyconfiguration/experiments/v1beta1/trialtemplate.go b/pkg/client/controller/applyconfiguration/experiments/v1beta1/trialtemplate.go index 7e68910093e..21e8a1e4312 100644 --- a/pkg/client/controller/applyconfiguration/experiments/v1beta1/trialtemplate.go +++ b/pkg/client/controller/applyconfiguration/experiments/v1beta1/trialtemplate.go @@ -52,7 +52,7 @@ func (b *TrialTemplateApplyConfiguration) WithRetain(value bool) *TrialTemplateA // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TrialSpec field is set to the value of the last call. func (b *TrialTemplateApplyConfiguration) WithTrialSpec(value unstructured.Unstructured) *TrialTemplateApplyConfiguration { - b.TrialSpec = &value + b.TrialSourceApplyConfiguration.TrialSpec = &value return b } @@ -60,7 +60,7 @@ func (b *TrialTemplateApplyConfiguration) WithTrialSpec(value unstructured.Unstr // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigMap field is set to the value of the last call. func (b *TrialTemplateApplyConfiguration) WithConfigMap(value *ConfigMapSourceApplyConfiguration) *TrialTemplateApplyConfiguration { - b.ConfigMap = value + b.TrialSourceApplyConfiguration.ConfigMap = value return b } diff --git a/pkg/client/controller/applyconfiguration/internal/internal.go b/pkg/client/controller/applyconfiguration/internal/internal.go index a5a7728af3b..e4d18167f24 100644 --- a/pkg/client/controller/applyconfiguration/internal/internal.go +++ b/pkg/client/controller/applyconfiguration/internal/internal.go @@ -19,8 +19,8 @@ limitations under the License. package internal import ( - "fmt" - "sync" + fmt "fmt" + sync "sync" typed "sigs.k8s.io/structured-merge-diff/v4/typed" ) diff --git a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestion.go b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestion.go index 02606deaafe..e2e579f1775 100644 --- a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestion.go +++ b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestion.go @@ -48,7 +48,7 @@ func Suggestion(name, namespace string) *SuggestionApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithKind(value string) *SuggestionApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -56,7 +56,7 @@ func (b *SuggestionApplyConfiguration) WithKind(value string) *SuggestionApplyCo // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithAPIVersion(value string) *SuggestionApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -65,7 +65,7 @@ func (b *SuggestionApplyConfiguration) WithAPIVersion(value string) *SuggestionA // If called multiple times, the Name field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithName(value string) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -74,7 +74,7 @@ func (b *SuggestionApplyConfiguration) WithName(value string) *SuggestionApplyCo // If called multiple times, the GenerateName field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithGenerateName(value string) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -83,7 +83,7 @@ func (b *SuggestionApplyConfiguration) WithGenerateName(value string) *Suggestio // If called multiple times, the Namespace field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithNamespace(value string) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -92,7 +92,7 @@ func (b *SuggestionApplyConfiguration) WithNamespace(value string) *SuggestionAp // If called multiple times, the UID field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithUID(value types.UID) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -101,7 +101,7 @@ func (b *SuggestionApplyConfiguration) WithUID(value types.UID) *SuggestionApply // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithResourceVersion(value string) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -110,7 +110,7 @@ func (b *SuggestionApplyConfiguration) WithResourceVersion(value string) *Sugges // If called multiple times, the Generation field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithGeneration(value int64) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -119,7 +119,7 @@ func (b *SuggestionApplyConfiguration) WithGeneration(value int64) *SuggestionAp // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -128,7 +128,7 @@ func (b *SuggestionApplyConfiguration) WithCreationTimestamp(value metav1.Time) // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -137,7 +137,7 @@ func (b *SuggestionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *SuggestionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -147,11 +147,11 @@ func (b *SuggestionApplyConfiguration) WithDeletionGracePeriodSeconds(value int6 // overwriting an existing map entries in Labels field with the same key. func (b *SuggestionApplyConfiguration) WithLabels(entries map[string]string) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -162,11 +162,11 @@ func (b *SuggestionApplyConfiguration) WithLabels(entries map[string]string) *Su // overwriting an existing map entries in Annotations field with the same key. func (b *SuggestionApplyConfiguration) WithAnnotations(entries map[string]string) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -180,7 +180,7 @@ func (b *SuggestionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRe if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -191,7 +191,7 @@ func (b *SuggestionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRe func (b *SuggestionApplyConfiguration) WithFinalizers(values ...string) *SuggestionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -221,5 +221,5 @@ func (b *SuggestionApplyConfiguration) WithStatus(value *SuggestionStatusApplyCo // GetName retrieves the value of the Name field in the declarative configuration. func (b *SuggestionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestioncondition.go b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestioncondition.go index d9c4f0728f6..ae048cd7880 100644 --- a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestioncondition.go +++ b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestioncondition.go @@ -19,7 +19,7 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" + suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -27,12 +27,12 @@ import ( // SuggestionConditionApplyConfiguration represents a declarative configuration of the SuggestionCondition type for use // with apply. type SuggestionConditionApplyConfiguration struct { - Type *v1beta1.SuggestionConditionType `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` - LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Type *suggestionsv1beta1.SuggestionConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` + LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } // SuggestionConditionApplyConfiguration constructs a declarative configuration of the SuggestionCondition type for use with @@ -44,7 +44,7 @@ func SuggestionCondition() *SuggestionConditionApplyConfiguration { // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. -func (b *SuggestionConditionApplyConfiguration) WithType(value v1beta1.SuggestionConditionType) *SuggestionConditionApplyConfiguration { +func (b *SuggestionConditionApplyConfiguration) WithType(value suggestionsv1beta1.SuggestionConditionType) *SuggestionConditionApplyConfiguration { b.Type = &value return b } diff --git a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionspec.go b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionspec.go index 452174a6058..347f6963717 100644 --- a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionspec.go +++ b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionspec.go @@ -19,15 +19,15 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" + commonv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" ) // SuggestionSpecApplyConfiguration represents a declarative configuration of the SuggestionSpec type for use // with apply. type SuggestionSpecApplyConfiguration struct { - Algorithm *v1beta1.AlgorithmSpec `json:"algorithm,omitempty"` - EarlyStopping *v1beta1.EarlyStoppingSpec `json:"earlyStopping,omitempty"` + Algorithm *commonv1beta1.AlgorithmSpec `json:"algorithm,omitempty"` + EarlyStopping *commonv1beta1.EarlyStoppingSpec `json:"earlyStopping,omitempty"` Requests *int32 `json:"requests,omitempty"` ResumePolicy *experimentsv1beta1.ResumePolicyType `json:"resumePolicy,omitempty"` } @@ -41,7 +41,7 @@ func SuggestionSpec() *SuggestionSpecApplyConfiguration { // WithAlgorithm sets the Algorithm field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Algorithm field is set to the value of the last call. -func (b *SuggestionSpecApplyConfiguration) WithAlgorithm(value v1beta1.AlgorithmSpec) *SuggestionSpecApplyConfiguration { +func (b *SuggestionSpecApplyConfiguration) WithAlgorithm(value commonv1beta1.AlgorithmSpec) *SuggestionSpecApplyConfiguration { b.Algorithm = &value return b } @@ -49,7 +49,7 @@ func (b *SuggestionSpecApplyConfiguration) WithAlgorithm(value v1beta1.Algorithm // WithEarlyStopping sets the EarlyStopping field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EarlyStopping field is set to the value of the last call. -func (b *SuggestionSpecApplyConfiguration) WithEarlyStopping(value v1beta1.EarlyStoppingSpec) *SuggestionSpecApplyConfiguration { +func (b *SuggestionSpecApplyConfiguration) WithEarlyStopping(value commonv1beta1.EarlyStoppingSpec) *SuggestionSpecApplyConfiguration { b.EarlyStopping = &value return b } diff --git a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionstatus.go b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionstatus.go index 9a052ce0584..968c5c60172 100644 --- a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionstatus.go +++ b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/suggestionstatus.go @@ -19,14 +19,14 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" + commonv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // SuggestionStatusApplyConfiguration represents a declarative configuration of the SuggestionStatus type for use // with apply. type SuggestionStatusApplyConfiguration struct { - AlgorithmSettings []v1beta1.AlgorithmSetting `json:"algorithmSettings,omitempty"` + AlgorithmSettings []commonv1beta1.AlgorithmSetting `json:"algorithmSettings,omitempty"` SuggestionCount *int32 `json:"suggestionCount,omitempty"` Suggestions []TrialAssignmentApplyConfiguration `json:"suggestions,omitempty"` StartTime *v1.Time `json:"startTime,omitempty"` @@ -44,7 +44,7 @@ func SuggestionStatus() *SuggestionStatusApplyConfiguration { // WithAlgorithmSettings adds the given value to the AlgorithmSettings field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AlgorithmSettings field. -func (b *SuggestionStatusApplyConfiguration) WithAlgorithmSettings(values ...v1beta1.AlgorithmSetting) *SuggestionStatusApplyConfiguration { +func (b *SuggestionStatusApplyConfiguration) WithAlgorithmSettings(values ...commonv1beta1.AlgorithmSetting) *SuggestionStatusApplyConfiguration { for i := range values { b.AlgorithmSettings = append(b.AlgorithmSettings, values[i]) } diff --git a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/trialassignment.go b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/trialassignment.go index e89a6d71daf..770cbe389cb 100644 --- a/pkg/client/controller/applyconfiguration/suggestions/v1beta1/trialassignment.go +++ b/pkg/client/controller/applyconfiguration/suggestions/v1beta1/trialassignment.go @@ -19,16 +19,16 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" + commonv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" ) // TrialAssignmentApplyConfiguration represents a declarative configuration of the TrialAssignment type for use // with apply. type TrialAssignmentApplyConfiguration struct { - ParameterAssignments []v1beta1.ParameterAssignment `json:"parameterAssignments,omitempty"` - Name *string `json:"name,omitempty"` - EarlyStoppingRules []v1beta1.EarlyStoppingRule `json:"earlyStoppingRules,omitempty"` - Labels map[string]string `json:"labels,omitempty"` + ParameterAssignments []commonv1beta1.ParameterAssignment `json:"parameterAssignments,omitempty"` + Name *string `json:"name,omitempty"` + EarlyStoppingRules []commonv1beta1.EarlyStoppingRule `json:"earlyStoppingRules,omitempty"` + Labels map[string]string `json:"labels,omitempty"` } // TrialAssignmentApplyConfiguration constructs a declarative configuration of the TrialAssignment type for use with @@ -40,7 +40,7 @@ func TrialAssignment() *TrialAssignmentApplyConfiguration { // WithParameterAssignments adds the given value to the ParameterAssignments field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ParameterAssignments field. -func (b *TrialAssignmentApplyConfiguration) WithParameterAssignments(values ...v1beta1.ParameterAssignment) *TrialAssignmentApplyConfiguration { +func (b *TrialAssignmentApplyConfiguration) WithParameterAssignments(values ...commonv1beta1.ParameterAssignment) *TrialAssignmentApplyConfiguration { for i := range values { b.ParameterAssignments = append(b.ParameterAssignments, values[i]) } @@ -58,7 +58,7 @@ func (b *TrialAssignmentApplyConfiguration) WithName(value string) *TrialAssignm // WithEarlyStoppingRules adds the given value to the EarlyStoppingRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EarlyStoppingRules field. -func (b *TrialAssignmentApplyConfiguration) WithEarlyStoppingRules(values ...v1beta1.EarlyStoppingRule) *TrialAssignmentApplyConfiguration { +func (b *TrialAssignmentApplyConfiguration) WithEarlyStoppingRules(values ...commonv1beta1.EarlyStoppingRule) *TrialAssignmentApplyConfiguration { for i := range values { b.EarlyStoppingRules = append(b.EarlyStoppingRules, values[i]) } diff --git a/pkg/client/controller/applyconfiguration/trials/v1beta1/trial.go b/pkg/client/controller/applyconfiguration/trials/v1beta1/trial.go index e3e38e95a31..f227d8642e0 100644 --- a/pkg/client/controller/applyconfiguration/trials/v1beta1/trial.go +++ b/pkg/client/controller/applyconfiguration/trials/v1beta1/trial.go @@ -48,7 +48,7 @@ func Trial(name, namespace string) *TrialApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *TrialApplyConfiguration) WithKind(value string) *TrialApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -56,7 +56,7 @@ func (b *TrialApplyConfiguration) WithKind(value string) *TrialApplyConfiguratio // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *TrialApplyConfiguration) WithAPIVersion(value string) *TrialApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -65,7 +65,7 @@ func (b *TrialApplyConfiguration) WithAPIVersion(value string) *TrialApplyConfig // If called multiple times, the Name field is set to the value of the last call. func (b *TrialApplyConfiguration) WithName(value string) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -74,7 +74,7 @@ func (b *TrialApplyConfiguration) WithName(value string) *TrialApplyConfiguratio // If called multiple times, the GenerateName field is set to the value of the last call. func (b *TrialApplyConfiguration) WithGenerateName(value string) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -83,7 +83,7 @@ func (b *TrialApplyConfiguration) WithGenerateName(value string) *TrialApplyConf // If called multiple times, the Namespace field is set to the value of the last call. func (b *TrialApplyConfiguration) WithNamespace(value string) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -92,7 +92,7 @@ func (b *TrialApplyConfiguration) WithNamespace(value string) *TrialApplyConfigu // If called multiple times, the UID field is set to the value of the last call. func (b *TrialApplyConfiguration) WithUID(value types.UID) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -101,7 +101,7 @@ func (b *TrialApplyConfiguration) WithUID(value types.UID) *TrialApplyConfigurat // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *TrialApplyConfiguration) WithResourceVersion(value string) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -110,7 +110,7 @@ func (b *TrialApplyConfiguration) WithResourceVersion(value string) *TrialApplyC // If called multiple times, the Generation field is set to the value of the last call. func (b *TrialApplyConfiguration) WithGeneration(value int64) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -119,7 +119,7 @@ func (b *TrialApplyConfiguration) WithGeneration(value int64) *TrialApplyConfigu // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *TrialApplyConfiguration) WithCreationTimestamp(value metav1.Time) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -128,7 +128,7 @@ func (b *TrialApplyConfiguration) WithCreationTimestamp(value metav1.Time) *Tria // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *TrialApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -137,7 +137,7 @@ func (b *TrialApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *Tria // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *TrialApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -147,11 +147,11 @@ func (b *TrialApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *T // overwriting an existing map entries in Labels field with the same key. func (b *TrialApplyConfiguration) WithLabels(entries map[string]string) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -162,11 +162,11 @@ func (b *TrialApplyConfiguration) WithLabels(entries map[string]string) *TrialAp // overwriting an existing map entries in Annotations field with the same key. func (b *TrialApplyConfiguration) WithAnnotations(entries map[string]string) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -180,7 +180,7 @@ func (b *TrialApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferen if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -191,7 +191,7 @@ func (b *TrialApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferen func (b *TrialApplyConfiguration) WithFinalizers(values ...string) *TrialApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -221,5 +221,5 @@ func (b *TrialApplyConfiguration) WithStatus(value *TrialStatusApplyConfiguratio // GetName retrieves the value of the Name field in the declarative configuration. func (b *TrialApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/pkg/client/controller/applyconfiguration/trials/v1beta1/trialcondition.go b/pkg/client/controller/applyconfiguration/trials/v1beta1/trialcondition.go index 76703947c3a..8a2783a4f4a 100644 --- a/pkg/client/controller/applyconfiguration/trials/v1beta1/trialcondition.go +++ b/pkg/client/controller/applyconfiguration/trials/v1beta1/trialcondition.go @@ -19,7 +19,7 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" + trialsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -27,12 +27,12 @@ import ( // TrialConditionApplyConfiguration represents a declarative configuration of the TrialCondition type for use // with apply. type TrialConditionApplyConfiguration struct { - Type *v1beta1.TrialConditionType `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` - LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Type *trialsv1beta1.TrialConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` + LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } // TrialConditionApplyConfiguration constructs a declarative configuration of the TrialCondition type for use with @@ -44,7 +44,7 @@ func TrialCondition() *TrialConditionApplyConfiguration { // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. -func (b *TrialConditionApplyConfiguration) WithType(value v1beta1.TrialConditionType) *TrialConditionApplyConfiguration { +func (b *TrialConditionApplyConfiguration) WithType(value trialsv1beta1.TrialConditionType) *TrialConditionApplyConfiguration { b.Type = &value return b } diff --git a/pkg/client/controller/applyconfiguration/trials/v1beta1/trialspec.go b/pkg/client/controller/applyconfiguration/trials/v1beta1/trialspec.go index 06699f56693..d48055a36cf 100644 --- a/pkg/client/controller/applyconfiguration/trials/v1beta1/trialspec.go +++ b/pkg/client/controller/applyconfiguration/trials/v1beta1/trialspec.go @@ -19,24 +19,24 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" + commonv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) // TrialSpecApplyConfiguration represents a declarative configuration of the TrialSpec type for use // with apply. type TrialSpecApplyConfiguration struct { - Objective *v1beta1.ObjectiveSpec `json:"objective,omitempty"` - ParameterAssignments []v1beta1.ParameterAssignment `json:"parameterAssignments,omitempty"` - EarlyStoppingRules []v1beta1.EarlyStoppingRule `json:"earlyStoppingRules,omitempty"` - RunSpec *unstructured.Unstructured `json:"runSpec,omitempty"` - RetainRun *bool `json:"retainRun,omitempty"` - MetricsCollector *v1beta1.MetricsCollectorSpec `json:"metricsCollector,omitempty"` - PrimaryPodLabels map[string]string `json:"primaryPodLabels,omitempty"` - PrimaryContainerName *string `json:"primaryContainerName,omitempty"` - SuccessCondition *string `json:"successCondition,omitempty"` - FailureCondition *string `json:"failureCondition,omitempty"` - Labels map[string]string `json:"labels,omitempty"` + Objective *commonv1beta1.ObjectiveSpec `json:"objective,omitempty"` + ParameterAssignments []commonv1beta1.ParameterAssignment `json:"parameterAssignments,omitempty"` + EarlyStoppingRules []commonv1beta1.EarlyStoppingRule `json:"earlyStoppingRules,omitempty"` + RunSpec *unstructured.Unstructured `json:"runSpec,omitempty"` + RetainRun *bool `json:"retainRun,omitempty"` + MetricsCollector *commonv1beta1.MetricsCollectorSpec `json:"metricsCollector,omitempty"` + PrimaryPodLabels map[string]string `json:"primaryPodLabels,omitempty"` + PrimaryContainerName *string `json:"primaryContainerName,omitempty"` + SuccessCondition *string `json:"successCondition,omitempty"` + FailureCondition *string `json:"failureCondition,omitempty"` + Labels map[string]string `json:"labels,omitempty"` } // TrialSpecApplyConfiguration constructs a declarative configuration of the TrialSpec type for use with @@ -48,7 +48,7 @@ func TrialSpec() *TrialSpecApplyConfiguration { // WithObjective sets the Objective field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Objective field is set to the value of the last call. -func (b *TrialSpecApplyConfiguration) WithObjective(value v1beta1.ObjectiveSpec) *TrialSpecApplyConfiguration { +func (b *TrialSpecApplyConfiguration) WithObjective(value commonv1beta1.ObjectiveSpec) *TrialSpecApplyConfiguration { b.Objective = &value return b } @@ -56,7 +56,7 @@ func (b *TrialSpecApplyConfiguration) WithObjective(value v1beta1.ObjectiveSpec) // WithParameterAssignments adds the given value to the ParameterAssignments field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ParameterAssignments field. -func (b *TrialSpecApplyConfiguration) WithParameterAssignments(values ...v1beta1.ParameterAssignment) *TrialSpecApplyConfiguration { +func (b *TrialSpecApplyConfiguration) WithParameterAssignments(values ...commonv1beta1.ParameterAssignment) *TrialSpecApplyConfiguration { for i := range values { b.ParameterAssignments = append(b.ParameterAssignments, values[i]) } @@ -66,7 +66,7 @@ func (b *TrialSpecApplyConfiguration) WithParameterAssignments(values ...v1beta1 // WithEarlyStoppingRules adds the given value to the EarlyStoppingRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EarlyStoppingRules field. -func (b *TrialSpecApplyConfiguration) WithEarlyStoppingRules(values ...v1beta1.EarlyStoppingRule) *TrialSpecApplyConfiguration { +func (b *TrialSpecApplyConfiguration) WithEarlyStoppingRules(values ...commonv1beta1.EarlyStoppingRule) *TrialSpecApplyConfiguration { for i := range values { b.EarlyStoppingRules = append(b.EarlyStoppingRules, values[i]) } @@ -92,7 +92,7 @@ func (b *TrialSpecApplyConfiguration) WithRetainRun(value bool) *TrialSpecApplyC // WithMetricsCollector sets the MetricsCollector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricsCollector field is set to the value of the last call. -func (b *TrialSpecApplyConfiguration) WithMetricsCollector(value v1beta1.MetricsCollectorSpec) *TrialSpecApplyConfiguration { +func (b *TrialSpecApplyConfiguration) WithMetricsCollector(value commonv1beta1.MetricsCollectorSpec) *TrialSpecApplyConfiguration { b.MetricsCollector = &value return b } diff --git a/pkg/client/controller/clientset/versioned/clientset.go b/pkg/client/controller/clientset/versioned/clientset.go index 2547b8526ed..d88a7ce199f 100644 --- a/pkg/client/controller/clientset/versioned/clientset.go +++ b/pkg/client/controller/clientset/versioned/clientset.go @@ -19,8 +19,8 @@ limitations under the License. package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" experimentv1beta1 "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1" suggestionv1beta1 "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1" diff --git a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiment.go b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiment.go index 0283e558be9..20e598bb501 100644 --- a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiment.go +++ b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiment.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - "context" + context "context" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" - experimentsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/experiments/v1beta1" + experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + applyconfigurationexperimentsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/experiments/v1beta1" scheme "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -38,36 +38,37 @@ type ExperimentsGetter interface { // ExperimentInterface has methods to work with Experiment resources. type ExperimentInterface interface { - Create(ctx context.Context, experiment *v1beta1.Experiment, opts v1.CreateOptions) (*v1beta1.Experiment, error) - Update(ctx context.Context, experiment *v1beta1.Experiment, opts v1.UpdateOptions) (*v1beta1.Experiment, error) + Create(ctx context.Context, experiment *experimentsv1beta1.Experiment, opts v1.CreateOptions) (*experimentsv1beta1.Experiment, error) + Update(ctx context.Context, experiment *experimentsv1beta1.Experiment, opts v1.UpdateOptions) (*experimentsv1beta1.Experiment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, experiment *v1beta1.Experiment, opts v1.UpdateOptions) (*v1beta1.Experiment, error) + UpdateStatus(ctx context.Context, experiment *experimentsv1beta1.Experiment, opts v1.UpdateOptions) (*experimentsv1beta1.Experiment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Experiment, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ExperimentList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*experimentsv1beta1.Experiment, error) + List(ctx context.Context, opts v1.ListOptions) (*experimentsv1beta1.ExperimentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Experiment, err error) - Apply(ctx context.Context, experiment *experimentsv1beta1.ExperimentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Experiment, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *experimentsv1beta1.Experiment, err error) + Apply(ctx context.Context, experiment *applyconfigurationexperimentsv1beta1.ExperimentApplyConfiguration, opts v1.ApplyOptions) (result *experimentsv1beta1.Experiment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, experiment *experimentsv1beta1.ExperimentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Experiment, err error) + ApplyStatus(ctx context.Context, experiment *applyconfigurationexperimentsv1beta1.ExperimentApplyConfiguration, opts v1.ApplyOptions) (result *experimentsv1beta1.Experiment, err error) ExperimentExpansion } // experiments implements ExperimentInterface type experiments struct { - *gentype.ClientWithListAndApply[*v1beta1.Experiment, *v1beta1.ExperimentList, *experimentsv1beta1.ExperimentApplyConfiguration] + *gentype.ClientWithListAndApply[*experimentsv1beta1.Experiment, *experimentsv1beta1.ExperimentList, *applyconfigurationexperimentsv1beta1.ExperimentApplyConfiguration] } // newExperiments returns a Experiments func newExperiments(c *ExperimentV1beta1Client, namespace string) *experiments { return &experiments{ - gentype.NewClientWithListAndApply[*v1beta1.Experiment, *v1beta1.ExperimentList, *experimentsv1beta1.ExperimentApplyConfiguration]( + gentype.NewClientWithListAndApply[*experimentsv1beta1.Experiment, *experimentsv1beta1.ExperimentList, *applyconfigurationexperimentsv1beta1.ExperimentApplyConfiguration]( "experiments", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1beta1.Experiment { return &v1beta1.Experiment{} }, - func() *v1beta1.ExperimentList { return &v1beta1.ExperimentList{} }), + func() *experimentsv1beta1.Experiment { return &experimentsv1beta1.Experiment{} }, + func() *experimentsv1beta1.ExperimentList { return &experimentsv1beta1.ExperimentList{} }, + ), } } diff --git a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiments_client.go b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiments_client.go index c49e58b55e9..4e801bc3881 100644 --- a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiments_client.go +++ b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/experiments_client.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - "net/http" + http "net/http" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" - "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" + experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + scheme "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -85,10 +85,10 @@ func New(c rest.Interface) *ExperimentV1beta1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion + gv := experimentsv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiment.go b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiment.go index 326ccedd476..e1fcf1d4cfe 100644 --- a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiment.go +++ b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiment.go @@ -19,179 +19,33 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" experimentsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/experiments/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + typedexperimentsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1" + gentype "k8s.io/client-go/gentype" ) -// FakeExperiments implements ExperimentInterface -type FakeExperiments struct { +// fakeExperiments implements ExperimentInterface +type fakeExperiments struct { + *gentype.FakeClientWithListAndApply[*v1beta1.Experiment, *v1beta1.ExperimentList, *experimentsv1beta1.ExperimentApplyConfiguration] Fake *FakeExperimentV1beta1 - ns string -} - -var experimentsResource = v1beta1.SchemeGroupVersion.WithResource("experiments") - -var experimentsKind = v1beta1.SchemeGroupVersion.WithKind("Experiment") - -// Get takes name of the experiment, and returns the corresponding experiment object, and an error if there is any. -func (c *FakeExperiments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Experiment, err error) { - emptyResult := &v1beta1.Experiment{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(experimentsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Experiment), err -} - -// List takes label and field selectors, and returns the list of Experiments that match those selectors. -func (c *FakeExperiments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ExperimentList, err error) { - emptyResult := &v1beta1.ExperimentList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(experimentsResource, experimentsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ExperimentList{ListMeta: obj.(*v1beta1.ExperimentList).ListMeta} - for _, item := range obj.(*v1beta1.ExperimentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested experiments. -func (c *FakeExperiments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(experimentsResource, c.ns, opts)) - -} - -// Create takes the representation of a experiment and creates it. Returns the server's representation of the experiment, and an error, if there is any. -func (c *FakeExperiments) Create(ctx context.Context, experiment *v1beta1.Experiment, opts v1.CreateOptions) (result *v1beta1.Experiment, err error) { - emptyResult := &v1beta1.Experiment{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(experimentsResource, c.ns, experiment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Experiment), err -} - -// Update takes the representation of a experiment and updates it. Returns the server's representation of the experiment, and an error, if there is any. -func (c *FakeExperiments) Update(ctx context.Context, experiment *v1beta1.Experiment, opts v1.UpdateOptions) (result *v1beta1.Experiment, err error) { - emptyResult := &v1beta1.Experiment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(experimentsResource, c.ns, experiment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Experiment), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeExperiments) UpdateStatus(ctx context.Context, experiment *v1beta1.Experiment, opts v1.UpdateOptions) (result *v1beta1.Experiment, err error) { - emptyResult := &v1beta1.Experiment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(experimentsResource, "status", c.ns, experiment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Experiment), err -} - -// Delete takes name of the experiment and deletes it. Returns an error if one occurs. -func (c *FakeExperiments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(experimentsResource, c.ns, name, opts), &v1beta1.Experiment{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeExperiments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(experimentsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ExperimentList{}) - return err -} - -// Patch applies the patch and returns the patched experiment. -func (c *FakeExperiments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Experiment, err error) { - emptyResult := &v1beta1.Experiment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(experimentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Experiment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied experiment. -func (c *FakeExperiments) Apply(ctx context.Context, experiment *experimentsv1beta1.ExperimentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Experiment, err error) { - if experiment == nil { - return nil, fmt.Errorf("experiment provided to Apply must not be nil") - } - data, err := json.Marshal(experiment) - if err != nil { - return nil, err - } - name := experiment.Name - if name == nil { - return nil, fmt.Errorf("experiment.Name must be provided to Apply") - } - emptyResult := &v1beta1.Experiment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(experimentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Experiment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeExperiments) ApplyStatus(ctx context.Context, experiment *experimentsv1beta1.ExperimentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Experiment, err error) { - if experiment == nil { - return nil, fmt.Errorf("experiment provided to Apply must not be nil") - } - data, err := json.Marshal(experiment) - if err != nil { - return nil, err - } - name := experiment.Name - if name == nil { - return nil, fmt.Errorf("experiment.Name must be provided to Apply") - } - emptyResult := &v1beta1.Experiment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(experimentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeExperiments(fake *FakeExperimentV1beta1, namespace string) typedexperimentsv1beta1.ExperimentInterface { + return &fakeExperiments{ + gentype.NewFakeClientWithListAndApply[*v1beta1.Experiment, *v1beta1.ExperimentList, *experimentsv1beta1.ExperimentApplyConfiguration]( + fake.Fake, + namespace, + v1beta1.SchemeGroupVersion.WithResource("experiments"), + v1beta1.SchemeGroupVersion.WithKind("Experiment"), + func() *v1beta1.Experiment { return &v1beta1.Experiment{} }, + func() *v1beta1.ExperimentList { return &v1beta1.ExperimentList{} }, + func(dst, src *v1beta1.ExperimentList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta1.ExperimentList) []*v1beta1.Experiment { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta1.ExperimentList, items []*v1beta1.Experiment) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1beta1.Experiment), err } diff --git a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiments_client.go b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiments_client.go index cece21fd893..704aa8b18b1 100644 --- a/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiments_client.go +++ b/pkg/client/controller/clientset/versioned/typed/experiments/v1beta1/fake/fake_experiments_client.go @@ -29,7 +29,7 @@ type FakeExperimentV1beta1 struct { } func (c *FakeExperimentV1beta1) Experiments(namespace string) v1beta1.ExperimentInterface { - return &FakeExperiments{c, namespace} + return newFakeExperiments(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestion.go b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestion.go index 3a5f0e9d214..e463f42f7d1 100644 --- a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestion.go +++ b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestion.go @@ -19,179 +19,33 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" suggestionsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/suggestions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + typedsuggestionsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1" + gentype "k8s.io/client-go/gentype" ) -// FakeSuggestions implements SuggestionInterface -type FakeSuggestions struct { +// fakeSuggestions implements SuggestionInterface +type fakeSuggestions struct { + *gentype.FakeClientWithListAndApply[*v1beta1.Suggestion, *v1beta1.SuggestionList, *suggestionsv1beta1.SuggestionApplyConfiguration] Fake *FakeSuggestionV1beta1 - ns string -} - -var suggestionsResource = v1beta1.SchemeGroupVersion.WithResource("suggestions") - -var suggestionsKind = v1beta1.SchemeGroupVersion.WithKind("Suggestion") - -// Get takes name of the suggestion, and returns the corresponding suggestion object, and an error if there is any. -func (c *FakeSuggestions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Suggestion, err error) { - emptyResult := &v1beta1.Suggestion{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(suggestionsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Suggestion), err -} - -// List takes label and field selectors, and returns the list of Suggestions that match those selectors. -func (c *FakeSuggestions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SuggestionList, err error) { - emptyResult := &v1beta1.SuggestionList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(suggestionsResource, suggestionsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.SuggestionList{ListMeta: obj.(*v1beta1.SuggestionList).ListMeta} - for _, item := range obj.(*v1beta1.SuggestionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested suggestions. -func (c *FakeSuggestions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(suggestionsResource, c.ns, opts)) - -} - -// Create takes the representation of a suggestion and creates it. Returns the server's representation of the suggestion, and an error, if there is any. -func (c *FakeSuggestions) Create(ctx context.Context, suggestion *v1beta1.Suggestion, opts v1.CreateOptions) (result *v1beta1.Suggestion, err error) { - emptyResult := &v1beta1.Suggestion{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(suggestionsResource, c.ns, suggestion, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Suggestion), err -} - -// Update takes the representation of a suggestion and updates it. Returns the server's representation of the suggestion, and an error, if there is any. -func (c *FakeSuggestions) Update(ctx context.Context, suggestion *v1beta1.Suggestion, opts v1.UpdateOptions) (result *v1beta1.Suggestion, err error) { - emptyResult := &v1beta1.Suggestion{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(suggestionsResource, c.ns, suggestion, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Suggestion), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeSuggestions) UpdateStatus(ctx context.Context, suggestion *v1beta1.Suggestion, opts v1.UpdateOptions) (result *v1beta1.Suggestion, err error) { - emptyResult := &v1beta1.Suggestion{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(suggestionsResource, "status", c.ns, suggestion, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Suggestion), err -} - -// Delete takes name of the suggestion and deletes it. Returns an error if one occurs. -func (c *FakeSuggestions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(suggestionsResource, c.ns, name, opts), &v1beta1.Suggestion{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSuggestions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(suggestionsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.SuggestionList{}) - return err -} - -// Patch applies the patch and returns the patched suggestion. -func (c *FakeSuggestions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Suggestion, err error) { - emptyResult := &v1beta1.Suggestion{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(suggestionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Suggestion), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied suggestion. -func (c *FakeSuggestions) Apply(ctx context.Context, suggestion *suggestionsv1beta1.SuggestionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Suggestion, err error) { - if suggestion == nil { - return nil, fmt.Errorf("suggestion provided to Apply must not be nil") - } - data, err := json.Marshal(suggestion) - if err != nil { - return nil, err - } - name := suggestion.Name - if name == nil { - return nil, fmt.Errorf("suggestion.Name must be provided to Apply") - } - emptyResult := &v1beta1.Suggestion{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(suggestionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Suggestion), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeSuggestions) ApplyStatus(ctx context.Context, suggestion *suggestionsv1beta1.SuggestionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Suggestion, err error) { - if suggestion == nil { - return nil, fmt.Errorf("suggestion provided to Apply must not be nil") - } - data, err := json.Marshal(suggestion) - if err != nil { - return nil, err - } - name := suggestion.Name - if name == nil { - return nil, fmt.Errorf("suggestion.Name must be provided to Apply") - } - emptyResult := &v1beta1.Suggestion{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(suggestionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeSuggestions(fake *FakeSuggestionV1beta1, namespace string) typedsuggestionsv1beta1.SuggestionInterface { + return &fakeSuggestions{ + gentype.NewFakeClientWithListAndApply[*v1beta1.Suggestion, *v1beta1.SuggestionList, *suggestionsv1beta1.SuggestionApplyConfiguration]( + fake.Fake, + namespace, + v1beta1.SchemeGroupVersion.WithResource("suggestions"), + v1beta1.SchemeGroupVersion.WithKind("Suggestion"), + func() *v1beta1.Suggestion { return &v1beta1.Suggestion{} }, + func() *v1beta1.SuggestionList { return &v1beta1.SuggestionList{} }, + func(dst, src *v1beta1.SuggestionList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta1.SuggestionList) []*v1beta1.Suggestion { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta1.SuggestionList, items []*v1beta1.Suggestion) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1beta1.Suggestion), err } diff --git a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestions_client.go b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestions_client.go index 3d87fa9d4a2..f527e487f3b 100644 --- a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestions_client.go +++ b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/fake/fake_suggestions_client.go @@ -29,7 +29,7 @@ type FakeSuggestionV1beta1 struct { } func (c *FakeSuggestionV1beta1) Suggestions(namespace string) v1beta1.SuggestionInterface { - return &FakeSuggestions{c, namespace} + return newFakeSuggestions(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestion.go b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestion.go index 7b5be565d87..a117899556b 100644 --- a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestion.go +++ b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestion.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - "context" + context "context" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" - suggestionsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/suggestions/v1beta1" + suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" + applyconfigurationsuggestionsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/suggestions/v1beta1" scheme "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -38,36 +38,37 @@ type SuggestionsGetter interface { // SuggestionInterface has methods to work with Suggestion resources. type SuggestionInterface interface { - Create(ctx context.Context, suggestion *v1beta1.Suggestion, opts v1.CreateOptions) (*v1beta1.Suggestion, error) - Update(ctx context.Context, suggestion *v1beta1.Suggestion, opts v1.UpdateOptions) (*v1beta1.Suggestion, error) + Create(ctx context.Context, suggestion *suggestionsv1beta1.Suggestion, opts v1.CreateOptions) (*suggestionsv1beta1.Suggestion, error) + Update(ctx context.Context, suggestion *suggestionsv1beta1.Suggestion, opts v1.UpdateOptions) (*suggestionsv1beta1.Suggestion, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, suggestion *v1beta1.Suggestion, opts v1.UpdateOptions) (*v1beta1.Suggestion, error) + UpdateStatus(ctx context.Context, suggestion *suggestionsv1beta1.Suggestion, opts v1.UpdateOptions) (*suggestionsv1beta1.Suggestion, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Suggestion, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SuggestionList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*suggestionsv1beta1.Suggestion, error) + List(ctx context.Context, opts v1.ListOptions) (*suggestionsv1beta1.SuggestionList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Suggestion, err error) - Apply(ctx context.Context, suggestion *suggestionsv1beta1.SuggestionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Suggestion, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *suggestionsv1beta1.Suggestion, err error) + Apply(ctx context.Context, suggestion *applyconfigurationsuggestionsv1beta1.SuggestionApplyConfiguration, opts v1.ApplyOptions) (result *suggestionsv1beta1.Suggestion, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, suggestion *suggestionsv1beta1.SuggestionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Suggestion, err error) + ApplyStatus(ctx context.Context, suggestion *applyconfigurationsuggestionsv1beta1.SuggestionApplyConfiguration, opts v1.ApplyOptions) (result *suggestionsv1beta1.Suggestion, err error) SuggestionExpansion } // suggestions implements SuggestionInterface type suggestions struct { - *gentype.ClientWithListAndApply[*v1beta1.Suggestion, *v1beta1.SuggestionList, *suggestionsv1beta1.SuggestionApplyConfiguration] + *gentype.ClientWithListAndApply[*suggestionsv1beta1.Suggestion, *suggestionsv1beta1.SuggestionList, *applyconfigurationsuggestionsv1beta1.SuggestionApplyConfiguration] } // newSuggestions returns a Suggestions func newSuggestions(c *SuggestionV1beta1Client, namespace string) *suggestions { return &suggestions{ - gentype.NewClientWithListAndApply[*v1beta1.Suggestion, *v1beta1.SuggestionList, *suggestionsv1beta1.SuggestionApplyConfiguration]( + gentype.NewClientWithListAndApply[*suggestionsv1beta1.Suggestion, *suggestionsv1beta1.SuggestionList, *applyconfigurationsuggestionsv1beta1.SuggestionApplyConfiguration]( "suggestions", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1beta1.Suggestion { return &v1beta1.Suggestion{} }, - func() *v1beta1.SuggestionList { return &v1beta1.SuggestionList{} }), + func() *suggestionsv1beta1.Suggestion { return &suggestionsv1beta1.Suggestion{} }, + func() *suggestionsv1beta1.SuggestionList { return &suggestionsv1beta1.SuggestionList{} }, + ), } } diff --git a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestions_client.go b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestions_client.go index 2fc6c6ba148..33251461c2b 100644 --- a/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestions_client.go +++ b/pkg/client/controller/clientset/versioned/typed/suggestions/v1beta1/suggestions_client.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - "net/http" + http "net/http" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" - "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" + suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" + scheme "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -85,10 +85,10 @@ func New(c rest.Interface) *SuggestionV1beta1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion + gv := suggestionsv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trial.go b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trial.go index c046b353438..6188efc8dcc 100644 --- a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trial.go +++ b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trial.go @@ -19,179 +19,31 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" trialsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/trials/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + typedtrialsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/typed/trials/v1beta1" + gentype "k8s.io/client-go/gentype" ) -// FakeTrials implements TrialInterface -type FakeTrials struct { +// fakeTrials implements TrialInterface +type fakeTrials struct { + *gentype.FakeClientWithListAndApply[*v1beta1.Trial, *v1beta1.TrialList, *trialsv1beta1.TrialApplyConfiguration] Fake *FakeTrialV1beta1 - ns string -} - -var trialsResource = v1beta1.SchemeGroupVersion.WithResource("trials") - -var trialsKind = v1beta1.SchemeGroupVersion.WithKind("Trial") - -// Get takes name of the trial, and returns the corresponding trial object, and an error if there is any. -func (c *FakeTrials) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Trial, err error) { - emptyResult := &v1beta1.Trial{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(trialsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Trial), err -} - -// List takes label and field selectors, and returns the list of Trials that match those selectors. -func (c *FakeTrials) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TrialList, err error) { - emptyResult := &v1beta1.TrialList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(trialsResource, trialsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.TrialList{ListMeta: obj.(*v1beta1.TrialList).ListMeta} - for _, item := range obj.(*v1beta1.TrialList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested trials. -func (c *FakeTrials) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(trialsResource, c.ns, opts)) - -} - -// Create takes the representation of a trial and creates it. Returns the server's representation of the trial, and an error, if there is any. -func (c *FakeTrials) Create(ctx context.Context, trial *v1beta1.Trial, opts v1.CreateOptions) (result *v1beta1.Trial, err error) { - emptyResult := &v1beta1.Trial{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(trialsResource, c.ns, trial, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Trial), err -} - -// Update takes the representation of a trial and updates it. Returns the server's representation of the trial, and an error, if there is any. -func (c *FakeTrials) Update(ctx context.Context, trial *v1beta1.Trial, opts v1.UpdateOptions) (result *v1beta1.Trial, err error) { - emptyResult := &v1beta1.Trial{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(trialsResource, c.ns, trial, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Trial), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeTrials) UpdateStatus(ctx context.Context, trial *v1beta1.Trial, opts v1.UpdateOptions) (result *v1beta1.Trial, err error) { - emptyResult := &v1beta1.Trial{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(trialsResource, "status", c.ns, trial, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Trial), err -} - -// Delete takes name of the trial and deletes it. Returns an error if one occurs. -func (c *FakeTrials) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(trialsResource, c.ns, name, opts), &v1beta1.Trial{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeTrials) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(trialsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.TrialList{}) - return err -} - -// Patch applies the patch and returns the patched trial. -func (c *FakeTrials) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Trial, err error) { - emptyResult := &v1beta1.Trial{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(trialsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Trial), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied trial. -func (c *FakeTrials) Apply(ctx context.Context, trial *trialsv1beta1.TrialApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Trial, err error) { - if trial == nil { - return nil, fmt.Errorf("trial provided to Apply must not be nil") - } - data, err := json.Marshal(trial) - if err != nil { - return nil, err - } - name := trial.Name - if name == nil { - return nil, fmt.Errorf("trial.Name must be provided to Apply") - } - emptyResult := &v1beta1.Trial{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(trialsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Trial), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeTrials) ApplyStatus(ctx context.Context, trial *trialsv1beta1.TrialApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Trial, err error) { - if trial == nil { - return nil, fmt.Errorf("trial provided to Apply must not be nil") - } - data, err := json.Marshal(trial) - if err != nil { - return nil, err - } - name := trial.Name - if name == nil { - return nil, fmt.Errorf("trial.Name must be provided to Apply") - } - emptyResult := &v1beta1.Trial{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(trialsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeTrials(fake *FakeTrialV1beta1, namespace string) typedtrialsv1beta1.TrialInterface { + return &fakeTrials{ + gentype.NewFakeClientWithListAndApply[*v1beta1.Trial, *v1beta1.TrialList, *trialsv1beta1.TrialApplyConfiguration]( + fake.Fake, + namespace, + v1beta1.SchemeGroupVersion.WithResource("trials"), + v1beta1.SchemeGroupVersion.WithKind("Trial"), + func() *v1beta1.Trial { return &v1beta1.Trial{} }, + func() *v1beta1.TrialList { return &v1beta1.TrialList{} }, + func(dst, src *v1beta1.TrialList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta1.TrialList) []*v1beta1.Trial { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta1.TrialList, items []*v1beta1.Trial) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1beta1.Trial), err } diff --git a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trials_client.go b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trials_client.go index eb538c2460e..80e54d8ae84 100644 --- a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trials_client.go +++ b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/fake/fake_trials_client.go @@ -29,7 +29,7 @@ type FakeTrialV1beta1 struct { } func (c *FakeTrialV1beta1) Trials(namespace string) v1beta1.TrialInterface { - return &FakeTrials{c, namespace} + return newFakeTrials(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trial.go b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trial.go index 69fe0e88525..d175b5f7c4f 100644 --- a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trial.go +++ b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trial.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - "context" + context "context" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" - trialsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/trials/v1beta1" + trialsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" + applyconfigurationtrialsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/applyconfiguration/trials/v1beta1" scheme "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -38,36 +38,37 @@ type TrialsGetter interface { // TrialInterface has methods to work with Trial resources. type TrialInterface interface { - Create(ctx context.Context, trial *v1beta1.Trial, opts v1.CreateOptions) (*v1beta1.Trial, error) - Update(ctx context.Context, trial *v1beta1.Trial, opts v1.UpdateOptions) (*v1beta1.Trial, error) + Create(ctx context.Context, trial *trialsv1beta1.Trial, opts v1.CreateOptions) (*trialsv1beta1.Trial, error) + Update(ctx context.Context, trial *trialsv1beta1.Trial, opts v1.UpdateOptions) (*trialsv1beta1.Trial, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, trial *v1beta1.Trial, opts v1.UpdateOptions) (*v1beta1.Trial, error) + UpdateStatus(ctx context.Context, trial *trialsv1beta1.Trial, opts v1.UpdateOptions) (*trialsv1beta1.Trial, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Trial, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TrialList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*trialsv1beta1.Trial, error) + List(ctx context.Context, opts v1.ListOptions) (*trialsv1beta1.TrialList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Trial, err error) - Apply(ctx context.Context, trial *trialsv1beta1.TrialApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Trial, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *trialsv1beta1.Trial, err error) + Apply(ctx context.Context, trial *applyconfigurationtrialsv1beta1.TrialApplyConfiguration, opts v1.ApplyOptions) (result *trialsv1beta1.Trial, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, trial *trialsv1beta1.TrialApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Trial, err error) + ApplyStatus(ctx context.Context, trial *applyconfigurationtrialsv1beta1.TrialApplyConfiguration, opts v1.ApplyOptions) (result *trialsv1beta1.Trial, err error) TrialExpansion } // trials implements TrialInterface type trials struct { - *gentype.ClientWithListAndApply[*v1beta1.Trial, *v1beta1.TrialList, *trialsv1beta1.TrialApplyConfiguration] + *gentype.ClientWithListAndApply[*trialsv1beta1.Trial, *trialsv1beta1.TrialList, *applyconfigurationtrialsv1beta1.TrialApplyConfiguration] } // newTrials returns a Trials func newTrials(c *TrialV1beta1Client, namespace string) *trials { return &trials{ - gentype.NewClientWithListAndApply[*v1beta1.Trial, *v1beta1.TrialList, *trialsv1beta1.TrialApplyConfiguration]( + gentype.NewClientWithListAndApply[*trialsv1beta1.Trial, *trialsv1beta1.TrialList, *applyconfigurationtrialsv1beta1.TrialApplyConfiguration]( "trials", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1beta1.Trial { return &v1beta1.Trial{} }, - func() *v1beta1.TrialList { return &v1beta1.TrialList{} }), + func() *trialsv1beta1.Trial { return &trialsv1beta1.Trial{} }, + func() *trialsv1beta1.TrialList { return &trialsv1beta1.TrialList{} }, + ), } } diff --git a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trials_client.go b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trials_client.go index b1f7673d393..0cca2f9669a 100644 --- a/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trials_client.go +++ b/pkg/client/controller/clientset/versioned/typed/trials/v1beta1/trials_client.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - "net/http" + http "net/http" - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" - "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" + trialsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" + scheme "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -85,10 +85,10 @@ func New(c rest.Interface) *TrialV1beta1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion + gv := trialsv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/pkg/client/controller/informers/externalversions/experiments/v1beta1/experiment.go b/pkg/client/controller/informers/externalversions/experiments/v1beta1/experiment.go index 6b8152ce68c..8a10dc2c367 100644 --- a/pkg/client/controller/informers/externalversions/experiments/v1beta1/experiment.go +++ b/pkg/client/controller/informers/externalversions/experiments/v1beta1/experiment.go @@ -19,13 +19,13 @@ limitations under the License. package v1beta1 import ( - "context" + context "context" time "time" - experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + controllerexperimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" versioned "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned" internalinterfaces "github.com/kubeflow/katib/pkg/client/controller/informers/externalversions/internalinterfaces" - v1beta1 "github.com/kubeflow/katib/pkg/client/controller/listers/experiments/v1beta1" + experimentsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/listers/experiments/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // Experiments. type ExperimentInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.ExperimentLister + Lister() experimentsv1beta1.ExperimentLister } type experimentInformer struct { @@ -71,7 +71,7 @@ func NewFilteredExperimentInformer(client versioned.Interface, namespace string, return client.ExperimentV1beta1().Experiments(namespace).Watch(context.TODO(), options) }, }, - &experimentsv1beta1.Experiment{}, + &controllerexperimentsv1beta1.Experiment{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *experimentInformer) defaultInformer(client versioned.Interface, resyncP } func (f *experimentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&experimentsv1beta1.Experiment{}, f.defaultInformer) + return f.factory.InformerFor(&controllerexperimentsv1beta1.Experiment{}, f.defaultInformer) } -func (f *experimentInformer) Lister() v1beta1.ExperimentLister { - return v1beta1.NewExperimentLister(f.Informer().GetIndexer()) +func (f *experimentInformer) Lister() experimentsv1beta1.ExperimentLister { + return experimentsv1beta1.NewExperimentLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/controller/informers/externalversions/generic.go b/pkg/client/controller/informers/externalversions/generic.go index 05e715cae29..90491d64dc6 100644 --- a/pkg/client/controller/informers/externalversions/generic.go +++ b/pkg/client/controller/informers/externalversions/generic.go @@ -19,7 +19,7 @@ limitations under the License. package externalversions import ( - "fmt" + fmt "fmt" v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" diff --git a/pkg/client/controller/informers/externalversions/suggestions/v1beta1/suggestion.go b/pkg/client/controller/informers/externalversions/suggestions/v1beta1/suggestion.go index ca51b5a5835..4c6d0192c65 100644 --- a/pkg/client/controller/informers/externalversions/suggestions/v1beta1/suggestion.go +++ b/pkg/client/controller/informers/externalversions/suggestions/v1beta1/suggestion.go @@ -19,13 +19,13 @@ limitations under the License. package v1beta1 import ( - "context" + context "context" time "time" - suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" + controllersuggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" versioned "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned" internalinterfaces "github.com/kubeflow/katib/pkg/client/controller/informers/externalversions/internalinterfaces" - v1beta1 "github.com/kubeflow/katib/pkg/client/controller/listers/suggestions/v1beta1" + suggestionsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/listers/suggestions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // Suggestions. type SuggestionInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.SuggestionLister + Lister() suggestionsv1beta1.SuggestionLister } type suggestionInformer struct { @@ -71,7 +71,7 @@ func NewFilteredSuggestionInformer(client versioned.Interface, namespace string, return client.SuggestionV1beta1().Suggestions(namespace).Watch(context.TODO(), options) }, }, - &suggestionsv1beta1.Suggestion{}, + &controllersuggestionsv1beta1.Suggestion{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *suggestionInformer) defaultInformer(client versioned.Interface, resyncP } func (f *suggestionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&suggestionsv1beta1.Suggestion{}, f.defaultInformer) + return f.factory.InformerFor(&controllersuggestionsv1beta1.Suggestion{}, f.defaultInformer) } -func (f *suggestionInformer) Lister() v1beta1.SuggestionLister { - return v1beta1.NewSuggestionLister(f.Informer().GetIndexer()) +func (f *suggestionInformer) Lister() suggestionsv1beta1.SuggestionLister { + return suggestionsv1beta1.NewSuggestionLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/controller/informers/externalversions/trials/v1beta1/trial.go b/pkg/client/controller/informers/externalversions/trials/v1beta1/trial.go index 66c3d9cc907..859b4a0aae8 100644 --- a/pkg/client/controller/informers/externalversions/trials/v1beta1/trial.go +++ b/pkg/client/controller/informers/externalversions/trials/v1beta1/trial.go @@ -19,13 +19,13 @@ limitations under the License. package v1beta1 import ( - "context" + context "context" time "time" - trialsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" + controllertrialsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" versioned "github.com/kubeflow/katib/pkg/client/controller/clientset/versioned" internalinterfaces "github.com/kubeflow/katib/pkg/client/controller/informers/externalversions/internalinterfaces" - v1beta1 "github.com/kubeflow/katib/pkg/client/controller/listers/trials/v1beta1" + trialsv1beta1 "github.com/kubeflow/katib/pkg/client/controller/listers/trials/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // Trials. type TrialInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.TrialLister + Lister() trialsv1beta1.TrialLister } type trialInformer struct { @@ -71,7 +71,7 @@ func NewFilteredTrialInformer(client versioned.Interface, namespace string, resy return client.TrialV1beta1().Trials(namespace).Watch(context.TODO(), options) }, }, - &trialsv1beta1.Trial{}, + &controllertrialsv1beta1.Trial{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *trialInformer) defaultInformer(client versioned.Interface, resyncPeriod } func (f *trialInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&trialsv1beta1.Trial{}, f.defaultInformer) + return f.factory.InformerFor(&controllertrialsv1beta1.Trial{}, f.defaultInformer) } -func (f *trialInformer) Lister() v1beta1.TrialLister { - return v1beta1.NewTrialLister(f.Informer().GetIndexer()) +func (f *trialInformer) Lister() trialsv1beta1.TrialLister { + return trialsv1beta1.NewTrialLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/controller/listers/experiments/v1beta1/experiment.go b/pkg/client/controller/listers/experiments/v1beta1/experiment.go index 945d5ceb983..b525b33840d 100644 --- a/pkg/client/controller/listers/experiments/v1beta1/experiment.go +++ b/pkg/client/controller/listers/experiments/v1beta1/experiment.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // ExperimentLister helps list Experiments. @@ -30,7 +30,7 @@ import ( type ExperimentLister interface { // List lists all Experiments in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.Experiment, err error) + List(selector labels.Selector) (ret []*experimentsv1beta1.Experiment, err error) // Experiments returns an object that can list and get Experiments. Experiments(namespace string) ExperimentNamespaceLister ExperimentListerExpansion @@ -38,17 +38,17 @@ type ExperimentLister interface { // experimentLister implements the ExperimentLister interface. type experimentLister struct { - listers.ResourceIndexer[*v1beta1.Experiment] + listers.ResourceIndexer[*experimentsv1beta1.Experiment] } // NewExperimentLister returns a new ExperimentLister. func NewExperimentLister(indexer cache.Indexer) ExperimentLister { - return &experimentLister{listers.New[*v1beta1.Experiment](indexer, v1beta1.Resource("experiment"))} + return &experimentLister{listers.New[*experimentsv1beta1.Experiment](indexer, experimentsv1beta1.Resource("experiment"))} } // Experiments returns an object that can list and get Experiments. func (s *experimentLister) Experiments(namespace string) ExperimentNamespaceLister { - return experimentNamespaceLister{listers.NewNamespaced[*v1beta1.Experiment](s.ResourceIndexer, namespace)} + return experimentNamespaceLister{listers.NewNamespaced[*experimentsv1beta1.Experiment](s.ResourceIndexer, namespace)} } // ExperimentNamespaceLister helps list and get Experiments. @@ -56,15 +56,15 @@ func (s *experimentLister) Experiments(namespace string) ExperimentNamespaceList type ExperimentNamespaceLister interface { // List lists all Experiments in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.Experiment, err error) + List(selector labels.Selector) (ret []*experimentsv1beta1.Experiment, err error) // Get retrieves the Experiment from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.Experiment, error) + Get(name string) (*experimentsv1beta1.Experiment, error) ExperimentNamespaceListerExpansion } // experimentNamespaceLister implements the ExperimentNamespaceLister // interface. type experimentNamespaceLister struct { - listers.ResourceIndexer[*v1beta1.Experiment] + listers.ResourceIndexer[*experimentsv1beta1.Experiment] } diff --git a/pkg/client/controller/listers/suggestions/v1beta1/suggestion.go b/pkg/client/controller/listers/suggestions/v1beta1/suggestion.go index 2f7e6b23021..1f62d04f1a8 100644 --- a/pkg/client/controller/listers/suggestions/v1beta1/suggestion.go +++ b/pkg/client/controller/listers/suggestions/v1beta1/suggestion.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + suggestionsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // SuggestionLister helps list Suggestions. @@ -30,7 +30,7 @@ import ( type SuggestionLister interface { // List lists all Suggestions in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.Suggestion, err error) + List(selector labels.Selector) (ret []*suggestionsv1beta1.Suggestion, err error) // Suggestions returns an object that can list and get Suggestions. Suggestions(namespace string) SuggestionNamespaceLister SuggestionListerExpansion @@ -38,17 +38,17 @@ type SuggestionLister interface { // suggestionLister implements the SuggestionLister interface. type suggestionLister struct { - listers.ResourceIndexer[*v1beta1.Suggestion] + listers.ResourceIndexer[*suggestionsv1beta1.Suggestion] } // NewSuggestionLister returns a new SuggestionLister. func NewSuggestionLister(indexer cache.Indexer) SuggestionLister { - return &suggestionLister{listers.New[*v1beta1.Suggestion](indexer, v1beta1.Resource("suggestion"))} + return &suggestionLister{listers.New[*suggestionsv1beta1.Suggestion](indexer, suggestionsv1beta1.Resource("suggestion"))} } // Suggestions returns an object that can list and get Suggestions. func (s *suggestionLister) Suggestions(namespace string) SuggestionNamespaceLister { - return suggestionNamespaceLister{listers.NewNamespaced[*v1beta1.Suggestion](s.ResourceIndexer, namespace)} + return suggestionNamespaceLister{listers.NewNamespaced[*suggestionsv1beta1.Suggestion](s.ResourceIndexer, namespace)} } // SuggestionNamespaceLister helps list and get Suggestions. @@ -56,15 +56,15 @@ func (s *suggestionLister) Suggestions(namespace string) SuggestionNamespaceList type SuggestionNamespaceLister interface { // List lists all Suggestions in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.Suggestion, err error) + List(selector labels.Selector) (ret []*suggestionsv1beta1.Suggestion, err error) // Get retrieves the Suggestion from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.Suggestion, error) + Get(name string) (*suggestionsv1beta1.Suggestion, error) SuggestionNamespaceListerExpansion } // suggestionNamespaceLister implements the SuggestionNamespaceLister // interface. type suggestionNamespaceLister struct { - listers.ResourceIndexer[*v1beta1.Suggestion] + listers.ResourceIndexer[*suggestionsv1beta1.Suggestion] } diff --git a/pkg/client/controller/listers/trials/v1beta1/trial.go b/pkg/client/controller/listers/trials/v1beta1/trial.go index cb3bde28a31..f3be67f376d 100644 --- a/pkg/client/controller/listers/trials/v1beta1/trial.go +++ b/pkg/client/controller/listers/trials/v1beta1/trial.go @@ -19,10 +19,10 @@ limitations under the License. package v1beta1 import ( - v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + trialsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // TrialLister helps list Trials. @@ -30,7 +30,7 @@ import ( type TrialLister interface { // List lists all Trials in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.Trial, err error) + List(selector labels.Selector) (ret []*trialsv1beta1.Trial, err error) // Trials returns an object that can list and get Trials. Trials(namespace string) TrialNamespaceLister TrialListerExpansion @@ -38,17 +38,17 @@ type TrialLister interface { // trialLister implements the TrialLister interface. type trialLister struct { - listers.ResourceIndexer[*v1beta1.Trial] + listers.ResourceIndexer[*trialsv1beta1.Trial] } // NewTrialLister returns a new TrialLister. func NewTrialLister(indexer cache.Indexer) TrialLister { - return &trialLister{listers.New[*v1beta1.Trial](indexer, v1beta1.Resource("trial"))} + return &trialLister{listers.New[*trialsv1beta1.Trial](indexer, trialsv1beta1.Resource("trial"))} } // Trials returns an object that can list and get Trials. func (s *trialLister) Trials(namespace string) TrialNamespaceLister { - return trialNamespaceLister{listers.NewNamespaced[*v1beta1.Trial](s.ResourceIndexer, namespace)} + return trialNamespaceLister{listers.NewNamespaced[*trialsv1beta1.Trial](s.ResourceIndexer, namespace)} } // TrialNamespaceLister helps list and get Trials. @@ -56,15 +56,15 @@ func (s *trialLister) Trials(namespace string) TrialNamespaceLister { type TrialNamespaceLister interface { // List lists all Trials in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.Trial, err error) + List(selector labels.Selector) (ret []*trialsv1beta1.Trial, err error) // Get retrieves the Trial from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.Trial, error) + Get(name string) (*trialsv1beta1.Trial, error) TrialNamespaceListerExpansion } // trialNamespaceLister implements the TrialNamespaceLister // interface. type trialNamespaceLister struct { - listers.ResourceIndexer[*v1beta1.Trial] + listers.ResourceIndexer[*trialsv1beta1.Trial] } diff --git a/pkg/controller.v1beta1/trial/trial_controller_test.go b/pkg/controller.v1beta1/trial/trial_controller_test.go index d52d77e78e5..80a70051d25 100644 --- a/pkg/controller.v1beta1/trial/trial_controller_test.go +++ b/pkg/controller.v1beta1/trial/trial_controller_test.go @@ -18,6 +18,8 @@ package trial import ( "context" + "os" + "strings" "testing" "time" @@ -49,14 +51,18 @@ import ( ) const ( - namespace = "default" - batchJobName = "test-job" - objectiveMetric = "accuracy" - timeout = time.Second * 10 + namespace = "default" + succeededBatchJobName = "test-job-succeeded" + failedBatchJobName = "test-job-failed" + objectiveMetric = "accuracy" + timeout = time.Second * 10 ) var ( - batchJobKey = types.NamespacedName{Name: batchJobName, Namespace: namespace} + startTime = time.Now() + completionTime = time.Now().Add(time.Second) + succeededBatchJobKey = types.NamespacedName{Name: succeededBatchJobName, Namespace: namespace} + failedBatchJobKey = types.NamespacedName{Name: failedBatchJobName, Namespace: namespace} observationLogAvailable = &api_pb.GetObservationLogReply{ ObservationLog: &api_pb.ObservationLog{ MetricLogs: []*api_pb.MetricLog{ @@ -184,7 +190,7 @@ func TestReconcileBatchJob(t *testing.T) { g := gomega.NewGomegaWithT(t) mockManagerClient.EXPECT().DeleteTrialObservationLog(gomock.Any()).Return(nil, nil) - trial := newFakeTrialBatchJob(commonv1beta1.StdOutCollector, "test-failed-batch-job") + trial := newFakeTrialBatchJob(commonv1beta1.StdOutCollector, "test-failed-batch-job", failedBatchJobName) trialKey := types.NamespacedName{Name: "test-failed-batch-job", Namespace: namespace} batchJob := &batchv1.Job{} @@ -193,7 +199,7 @@ func TestReconcileBatchJob(t *testing.T) { // Expect that BatchJob with appropriate name is created g.Eventually(func(g gomega.Gomega) { - g.Expect(c.Get(ctx, batchJobKey, batchJob)).Should(gomega.Succeed()) + g.Expect(c.Get(ctx, failedBatchJobKey, batchJob)).Should(gomega.Succeed()) }, timeout).Should(gomega.Succeed()) // Expect that Trial status is running @@ -204,17 +210,26 @@ func TestReconcileBatchJob(t *testing.T) { // Manually update BatchJob status to failed // Expect that Trial status is failed + batchJobFailedMessage := "BatchJob completed test message" + batchJobFailedReason := "BatchJob completed test reason" g.Eventually(func(g gomega.Gomega) { - g.Expect(c.Get(ctx, batchJobKey, batchJob)).Should(gomega.Succeed()) + g.Expect(c.Get(ctx, failedBatchJobKey, batchJob)).Should(gomega.Succeed()) batchJob.Status = batchv1.JobStatus{ Conditions: []batchv1.JobCondition{ + { + Type: batchv1.JobFailureTarget, + Status: corev1.ConditionTrue, + Message: batchJobFailedMessage, + Reason: batchJobFailedReason, + }, { Type: batchv1.JobFailed, Status: corev1.ConditionTrue, - Message: "BatchJob failed test message", - Reason: "BatchJob failed test reason", + Message: batchJobFailedMessage, + Reason: batchJobFailedReason, }, }, + StartTime: &metav1.Time{Time: startTime}, } g.Expect(c.Status().Update(ctx, batchJob)).Should(gomega.Succeed()) g.Expect(c.Get(ctx, trialKey, trial)).Should(gomega.Succeed()) @@ -238,28 +253,70 @@ func TestReconcileBatchJob(t *testing.T) { mockManagerClient.EXPECT().GetTrialObservationLog(gomock.Any()).Return(observationLogAvailable, nil).MinTimes(1), mockManagerClient.EXPECT().DeleteTrialObservationLog(gomock.Any()).Return(nil, nil), ) - batchJob := &batchv1.Job{} - batchJobCompleteMessage := "BatchJob completed test message" - batchJobCompleteReason := "BatchJob completed test reason" - // Update BatchJob status to Complete. - g.Expect(c.Get(ctx, batchJobKey, batchJob)).NotTo(gomega.HaveOccurred()) - batchJob.Status = batchv1.JobStatus{ - Conditions: []batchv1.JobCondition{ - { - Type: batchv1.JobComplete, - Status: corev1.ConditionTrue, - Message: batchJobCompleteMessage, - Reason: batchJobCompleteReason, - }, - }, - } - g.Expect(c.Status().Update(ctx, batchJob)).NotTo(gomega.HaveOccurred()) // Create the Trial with StdOut MC - trial := newFakeTrialBatchJob(commonv1beta1.StdOutCollector, "test-available-stdout") + trial := newFakeTrialBatchJob(commonv1beta1.StdOutCollector, "test-available-stdout", succeededBatchJobName) trialKey := types.NamespacedName{Name: "test-available-stdout", Namespace: namespace} + batchJob := &batchv1.Job{} g.Expect(c.Create(ctx, trial)).NotTo(gomega.HaveOccurred()) + // Expect that BatchJob with appropriate name is created + g.Eventually(func(g gomega.Gomega) { + g.Expect(c.Get(ctx, succeededBatchJobKey, batchJob)).Should(gomega.Succeed()) + }, timeout).Should(gomega.Succeed()) + + // Expect that Trial status is running + g.Eventually(func(g gomega.Gomega) { + g.Expect(c.Get(ctx, trialKey, trial)).Should(gomega.Succeed()) + g.Expect(trial.IsRunning()).Should(gomega.BeTrue()) + }, timeout).Should(gomega.Succeed()) + + // Update BatchJob status to Complete. + batchJobCompleteMessage := "BatchJob completed test message" + batchJobCompleteReason := "BatchJob completed test reason" + g.Eventually(func(g gomega.Gomega) { + g.Expect(c.Get(ctx, succeededBatchJobKey, batchJob)).Should(gomega.Succeed()) + // TODO(Electronic-Waste): Remove this condition when K8s v1.29 & v1.30 is no longer supported. + // SuccessPolicy is available in K8s 1.31 and later. If we set it in K8s 1.30, it will be ignored. + // And when we set the status with `SuccessCriteriaMet`, it will report error: + // "Invalid value: cannot set SuccessCriteriaMet=True for Job without SuccessPolicy". + // Ref: https://kubernetes.io/docs/concepts/workloads/controllers/job/#success-policy. + isK8sVersionUnder130 := strings.Contains(os.Getenv("KUBEBUILDER_ASSETS"), "1.30") || + strings.Contains(os.Getenv("KUBEBUILDER_ASSETS"), "1.29") + if isK8sVersionUnder130 { + batchJob.Status = batchv1.JobStatus{ + Conditions: []batchv1.JobCondition{ + { + Type: batchv1.JobComplete, + Status: corev1.ConditionTrue, + Message: batchJobCompleteMessage, + Reason: batchJobCompleteReason, + }, + }, + } + } else { + batchJob.Status = batchv1.JobStatus{ + Conditions: []batchv1.JobCondition{ + { + Type: batchv1.JobSuccessCriteriaMet, + Status: corev1.ConditionTrue, + Message: batchJobCompleteMessage, + Reason: batchJobCompleteReason, + }, + { + Type: batchv1.JobComplete, + Status: corev1.ConditionTrue, + Message: batchJobCompleteMessage, + Reason: batchJobCompleteReason, + }, + }, + StartTime: &metav1.Time{Time: startTime}, + CompletionTime: &metav1.Time{Time: completionTime}, + } + } + g.Expect(c.Status().Update(ctx, batchJob)).NotTo(gomega.HaveOccurred()) + }, timeout).Should(gomega.Succeed()) + // Expect that Trial status is succeeded and metrics are properly populated // Metrics available because GetTrialObservationLog returns values g.Eventually(func(g gomega.Gomega) { @@ -290,7 +347,7 @@ func TestReconcileBatchJob(t *testing.T) { mockManagerClient.EXPECT().DeleteTrialObservationLog(gomock.Any()).Return(nil, nil), ) // Create the Trial with StdOut MC - trial := newFakeTrialBatchJob(commonv1beta1.StdOutCollector, "test-unavailable-stdout") + trial := newFakeTrialBatchJob(commonv1beta1.StdOutCollector, "test-unavailable-stdout", succeededBatchJobName) trialKey := types.NamespacedName{Name: "test-unavailable-stdout", Namespace: namespace} g.Expect(c.Create(ctx, trial)).NotTo(gomega.HaveOccurred()) @@ -331,7 +388,7 @@ func TestReconcileBatchJob(t *testing.T) { mockManagerClient.EXPECT().ReportTrialObservationLog(gomock.Any(), gomock.Any()).Return(nil, nil).AnyTimes() // Create the Trial with Push MC - trial := newFakeTrialBatchJob(commonv1beta1.PushCollector, "test-unavailable-push-failed-once") + trial := newFakeTrialBatchJob(commonv1beta1.PushCollector, "test-unavailable-push-failed-once", succeededBatchJobName) trialKey := types.NamespacedName{Name: "test-unavailable-push-failed-once", Namespace: namespace} g.Expect(c.Create(ctx, trial)).NotTo(gomega.HaveOccurred()) @@ -362,6 +419,7 @@ func TestReconcileBatchJob(t *testing.T) { g := gomega.NewGomegaWithT(t) g.Expect(r.updateStatus(&trialsv1beta1.Trial{})).To(gomega.HaveOccurred()) }) + } func TestGetObjectiveMetricValue(t *testing.T) { @@ -422,7 +480,7 @@ func TestGetObjectiveMetricValue(t *testing.T) { g.Expect(err).To(gomega.HaveOccurred()) } -func newFakeTrialBatchJob(mcType commonv1beta1.CollectorKind, trialName string) *trialsv1beta1.Trial { +func newFakeTrialBatchJob(mcType commonv1beta1.CollectorKind, trialName, jobName string) *trialsv1beta1.Trial { primaryContainer := "training-container" job := &batchv1.Job{ @@ -431,7 +489,7 @@ func newFakeTrialBatchJob(mcType commonv1beta1.CollectorKind, trialName string) Kind: "Job", }, ObjectMeta: metav1.ObjectMeta{ - Name: batchJobName, + Name: jobName, Namespace: namespace, }, Spec: batchv1.JobSpec{