diff --git a/Makefile b/Makefile index 061df399f8c..c07cca120d0 100755 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ COMMIT := v1beta1-$(shell git rev-parse --short=7 HEAD) KATIB_REGISTRY := docker.io/kubeflowkatib CPU_ARCH ?= linux/amd64,linux/arm64 ENVTEST_K8S_VERSION ?= 1.29 -MOCKGEN_VERSION ?= $(shell grep 'github.com/golang/mock' go.mod | cut -d ' ' -f 2) +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) # for pytest @@ -97,7 +97,7 @@ ifndef GOPATH $(error GOPATH not defined, please define GOPATH. Run "go help gopath" to learn more about GOPATH) endif ifndef HAS_MOCKGEN - go install github.com/golang/mock/mockgen@$(MOCKGEN_VERSION) + go install go.uber.org/mock/mockgen@$(MOCKGEN_VERSION) $(info "mockgen has been installed") endif go generate ./pkg/... ./cmd/... diff --git a/cmd/db-manager/v1beta1/main_test.go b/cmd/db-manager/v1beta1/main_test.go index 1e2376a286d..9993c48e669 100644 --- a/cmd/db-manager/v1beta1/main_test.go +++ b/cmd/db-manager/v1beta1/main_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" health_pb "github.com/kubeflow/katib/pkg/apis/manager/health" api_pb "github.com/kubeflow/katib/pkg/apis/manager/v1beta1" diff --git a/go.mod b/go.mod index e908c993958..f9e4e94fd48 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/awalterschulze/gographviz v2.0.3+incompatible github.com/c-bata/goptuna v0.8.0 github.com/go-sql-driver/mysql v1.5.0 - github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/google/go-cmp v0.6.0 github.com/google/go-containerregistry v0.15.2 @@ -22,6 +21,7 @@ require ( github.com/shirou/gopsutil/v3 v3.22.5 github.com/spf13/viper v1.9.0 github.com/tidwall/gjson v1.14.1 + go.uber.org/mock v0.4.0 golang.org/x/net v0.23.0 google.golang.org/grpc v1.58.3 k8s.io/api v0.29.3 diff --git a/go.sum b/go.sum index f0f3ee30e17..5acf7a2b5c5 100644 --- a/go.sum +++ b/go.sum @@ -263,7 +263,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= @@ -695,6 +694,8 @@ go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= diff --git a/hack/update-mockgen.sh b/hack/update-mockgen.sh index db738cdb067..38a273c480b 100755 --- a/hack/update-mockgen.sh +++ b/hack/update-mockgen.sh @@ -26,11 +26,11 @@ SCRIPT_ROOT="$(dirname "${BASH_SOURCE[0]}")/.." cd "${SCRIPT_ROOT}" # Grab mockgen version from go.mod -MOCKGEN_VERSION=$(grep 'github.com/golang/mock' go.mod | awk '{print $2}') +MOCKGEN_VERSION=$(grep 'go.uber.org/mock' go.mod | awk '{print $2}') if [[ ! $(mockgen -version) == "${MOCKGEN_VERSION}" ]]; then echo "You must use ${MOCKGEN_VERSION} mockgen version to run this script" - echo "To install mockgen follow this doc: https://github.com/golang/mock/tree/main#installation" + echo "To install mockgen follow this doc: https://github.com/uber-go/mock#installation" echo "Run 'mockgen -version' to check the installed version" exit 1 fi diff --git a/pkg/controller.v1beta1/experiment/experiment_controller_test.go b/pkg/controller.v1beta1/experiment/experiment_controller_test.go index a98c404eac7..0459e93c59b 100644 --- a/pkg/controller.v1beta1/experiment/experiment_controller_test.go +++ b/pkg/controller.v1beta1/experiment/experiment_controller_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/onsi/gomega" "github.com/prometheus/client_golang/prometheus" + "go.uber.org/mock/gomock" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/controller.v1beta1/experiment/manifest/generator_test.go b/pkg/controller.v1beta1/experiment/manifest/generator_test.go index c6ca427a3bc..dabd2631063 100644 --- a/pkg/controller.v1beta1/experiment/manifest/generator_test.go +++ b/pkg/controller.v1beta1/experiment/manifest/generator_test.go @@ -22,7 +22,7 @@ import ( "reflect" "testing" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" batchv1 "k8s.io/api/batch/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/controller.v1beta1/suggestion/suggestion_controller_test.go b/pkg/controller.v1beta1/suggestion/suggestion_controller_test.go index 97c5d158e15..a6a28016435 100644 --- a/pkg/controller.v1beta1/suggestion/suggestion_controller_test.go +++ b/pkg/controller.v1beta1/suggestion/suggestion_controller_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/onsi/gomega" + "go.uber.org/mock/gomock" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" diff --git a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go index 26fa209a32b..862e82b4636 100644 --- a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go +++ b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go @@ -23,8 +23,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/onsi/gomega" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/pkg/controller.v1beta1/trial/trial_controller_test.go b/pkg/controller.v1beta1/trial/trial_controller_test.go index 085f2e7c0fb..558cdba563e 100644 --- a/pkg/controller.v1beta1/trial/trial_controller_test.go +++ b/pkg/controller.v1beta1/trial/trial_controller_test.go @@ -21,10 +21,10 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/onsi/gomega" "github.com/prometheus/client_golang/prometheus" "github.com/spf13/viper" + "go.uber.org/mock/gomock" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/mock/v1beta1/api/earlystopping.go b/pkg/mock/v1beta1/api/earlystopping.go index 416269d6eaf..5d65bf6b482 100644 --- a/pkg/mock/v1beta1/api/earlystopping.go +++ b/pkg/mock/v1beta1/api/earlystopping.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/apis/manager/v1beta1 (interfaces: EarlyStoppingClient) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/api/earlystopping.go github.com/kubeflow/katib/pkg/apis/manager/v1beta1 EarlyStoppingClient +// // Package mock is a generated GoMock package. package mock @@ -8,8 +13,8 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" api_v1_beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -39,7 +44,7 @@ func (m *MockEarlyStoppingClient) EXPECT() *MockEarlyStoppingClientMockRecorder // GetEarlyStoppingRules mocks base method. func (m *MockEarlyStoppingClient) GetEarlyStoppingRules(arg0 context.Context, arg1 *api_v1_beta1.GetEarlyStoppingRulesRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.GetEarlyStoppingRulesReply, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -50,16 +55,16 @@ func (m *MockEarlyStoppingClient) GetEarlyStoppingRules(arg0 context.Context, ar } // GetEarlyStoppingRules indicates an expected call of GetEarlyStoppingRules. -func (mr *MockEarlyStoppingClientMockRecorder) GetEarlyStoppingRules(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockEarlyStoppingClientMockRecorder) GetEarlyStoppingRules(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEarlyStoppingRules", reflect.TypeOf((*MockEarlyStoppingClient)(nil).GetEarlyStoppingRules), varargs...) } // SetTrialStatus mocks base method. func (m *MockEarlyStoppingClient) SetTrialStatus(arg0 context.Context, arg1 *api_v1_beta1.SetTrialStatusRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.SetTrialStatusReply, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -70,16 +75,16 @@ func (m *MockEarlyStoppingClient) SetTrialStatus(arg0 context.Context, arg1 *api } // SetTrialStatus indicates an expected call of SetTrialStatus. -func (mr *MockEarlyStoppingClientMockRecorder) SetTrialStatus(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockEarlyStoppingClientMockRecorder) SetTrialStatus(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrialStatus", reflect.TypeOf((*MockEarlyStoppingClient)(nil).SetTrialStatus), varargs...) } // ValidateEarlyStoppingSettings mocks base method. func (m *MockEarlyStoppingClient) ValidateEarlyStoppingSettings(arg0 context.Context, arg1 *api_v1_beta1.ValidateEarlyStoppingSettingsRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.ValidateEarlyStoppingSettingsReply, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -90,8 +95,8 @@ func (m *MockEarlyStoppingClient) ValidateEarlyStoppingSettings(arg0 context.Con } // ValidateEarlyStoppingSettings indicates an expected call of ValidateEarlyStoppingSettings. -func (mr *MockEarlyStoppingClientMockRecorder) ValidateEarlyStoppingSettings(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockEarlyStoppingClientMockRecorder) ValidateEarlyStoppingSettings(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateEarlyStoppingSettings", reflect.TypeOf((*MockEarlyStoppingClient)(nil).ValidateEarlyStoppingSettings), varargs...) } diff --git a/pkg/mock/v1beta1/api/suggestion.go b/pkg/mock/v1beta1/api/suggestion.go index 6eee7a3a9cb..ba1bd776986 100644 --- a/pkg/mock/v1beta1/api/suggestion.go +++ b/pkg/mock/v1beta1/api/suggestion.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/apis/manager/v1beta1 (interfaces: SuggestionClient) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/api/suggestion.go github.com/kubeflow/katib/pkg/apis/manager/v1beta1 SuggestionClient +// // Package mock is a generated GoMock package. package mock @@ -8,8 +13,8 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" api_v1_beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -39,7 +44,7 @@ func (m *MockSuggestionClient) EXPECT() *MockSuggestionClientMockRecorder { // GetSuggestions mocks base method. func (m *MockSuggestionClient) GetSuggestions(arg0 context.Context, arg1 *api_v1_beta1.GetSuggestionsRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.GetSuggestionsReply, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -50,16 +55,16 @@ func (m *MockSuggestionClient) GetSuggestions(arg0 context.Context, arg1 *api_v1 } // GetSuggestions indicates an expected call of GetSuggestions. -func (mr *MockSuggestionClientMockRecorder) GetSuggestions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockSuggestionClientMockRecorder) GetSuggestions(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSuggestions", reflect.TypeOf((*MockSuggestionClient)(nil).GetSuggestions), varargs...) } // ValidateAlgorithmSettings mocks base method. func (m *MockSuggestionClient) ValidateAlgorithmSettings(arg0 context.Context, arg1 *api_v1_beta1.ValidateAlgorithmSettingsRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.ValidateAlgorithmSettingsReply, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -70,8 +75,8 @@ func (m *MockSuggestionClient) ValidateAlgorithmSettings(arg0 context.Context, a } // ValidateAlgorithmSettings indicates an expected call of ValidateAlgorithmSettings. -func (mr *MockSuggestionClientMockRecorder) ValidateAlgorithmSettings(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockSuggestionClientMockRecorder) ValidateAlgorithmSettings(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAlgorithmSettings", reflect.TypeOf((*MockSuggestionClient)(nil).ValidateAlgorithmSettings), varargs...) } diff --git a/pkg/mock/v1beta1/db/db.go b/pkg/mock/v1beta1/db/db.go index 0298262ec89..66784cc2443 100644 --- a/pkg/mock/v1beta1/db/db.go +++ b/pkg/mock/v1beta1/db/db.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/db/v1beta1/common (interfaces: KatibDBInterface) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/db/db.go github.com/kubeflow/katib/pkg/db/v1beta1/common KatibDBInterface +// // Package mock is a generated GoMock package. package mock @@ -7,8 +12,8 @@ package mock import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" api_v1_beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1" + gomock "go.uber.org/mock/gomock" ) // MockKatibDBInterface is a mock of KatibDBInterface interface. @@ -55,7 +60,7 @@ func (m *MockKatibDBInterface) DeleteObservationLog(arg0 string) error { } // DeleteObservationLog indicates an expected call of DeleteObservationLog. -func (mr *MockKatibDBInterfaceMockRecorder) DeleteObservationLog(arg0 interface{}) *gomock.Call { +func (mr *MockKatibDBInterfaceMockRecorder) DeleteObservationLog(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObservationLog", reflect.TypeOf((*MockKatibDBInterface)(nil).DeleteObservationLog), arg0) } @@ -70,7 +75,7 @@ func (m *MockKatibDBInterface) GetObservationLog(arg0, arg1, arg2, arg3 string) } // GetObservationLog indicates an expected call of GetObservationLog. -func (mr *MockKatibDBInterfaceMockRecorder) GetObservationLog(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockKatibDBInterfaceMockRecorder) GetObservationLog(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObservationLog", reflect.TypeOf((*MockKatibDBInterface)(nil).GetObservationLog), arg0, arg1, arg2, arg3) } @@ -84,7 +89,7 @@ func (m *MockKatibDBInterface) RegisterObservationLog(arg0 string, arg1 *api_v1_ } // RegisterObservationLog indicates an expected call of RegisterObservationLog. -func (mr *MockKatibDBInterfaceMockRecorder) RegisterObservationLog(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockKatibDBInterfaceMockRecorder) RegisterObservationLog(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterObservationLog", reflect.TypeOf((*MockKatibDBInterface)(nil).RegisterObservationLog), arg0, arg1) } diff --git a/pkg/mock/v1beta1/experiment/manifest/generator.go b/pkg/mock/v1beta1/experiment/manifest/generator.go index cdc286f50aa..594cf2d83ca 100644 --- a/pkg/mock/v1beta1/experiment/manifest/generator.go +++ b/pkg/mock/v1beta1/experiment/manifest/generator.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/manifest (interfaces: Generator) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/experiment/manifest/generator.go github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/manifest Generator +// // Package mock is a generated GoMock package. package mock @@ -7,10 +12,10 @@ package mock import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" v1beta1 "github.com/kubeflow/katib/pkg/apis/config/v1beta1" v1beta10 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1" v1beta11 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" + gomock "go.uber.org/mock/gomock" unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -48,7 +53,7 @@ func (m *MockGenerator) GetEarlyStoppingConfigData(arg0 string) (v1beta1.EarlySt } // GetEarlyStoppingConfigData indicates an expected call of GetEarlyStoppingConfigData. -func (mr *MockGeneratorMockRecorder) GetEarlyStoppingConfigData(arg0 interface{}) *gomock.Call { +func (mr *MockGeneratorMockRecorder) GetEarlyStoppingConfigData(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEarlyStoppingConfigData", reflect.TypeOf((*MockGenerator)(nil).GetEarlyStoppingConfigData), arg0) } @@ -63,7 +68,7 @@ func (m *MockGenerator) GetMetricsCollectorConfigData(arg0 v1beta10.CollectorKin } // GetMetricsCollectorConfigData indicates an expected call of GetMetricsCollectorConfigData. -func (mr *MockGeneratorMockRecorder) GetMetricsCollectorConfigData(arg0 interface{}) *gomock.Call { +func (mr *MockGeneratorMockRecorder) GetMetricsCollectorConfigData(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsCollectorConfigData", reflect.TypeOf((*MockGenerator)(nil).GetMetricsCollectorConfigData), arg0) } @@ -78,7 +83,7 @@ func (m *MockGenerator) GetRunSpecWithHyperParameters(arg0 *v1beta11.Experiment, } // GetRunSpecWithHyperParameters indicates an expected call of GetRunSpecWithHyperParameters. -func (mr *MockGeneratorMockRecorder) GetRunSpecWithHyperParameters(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockGeneratorMockRecorder) GetRunSpecWithHyperParameters(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRunSpecWithHyperParameters", reflect.TypeOf((*MockGenerator)(nil).GetRunSpecWithHyperParameters), arg0, arg1, arg2, arg3) } @@ -93,7 +98,7 @@ func (m *MockGenerator) GetSuggestionConfigData(arg0 string) (v1beta1.Suggestion } // GetSuggestionConfigData indicates an expected call of GetSuggestionConfigData. -func (mr *MockGeneratorMockRecorder) GetSuggestionConfigData(arg0 interface{}) *gomock.Call { +func (mr *MockGeneratorMockRecorder) GetSuggestionConfigData(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSuggestionConfigData", reflect.TypeOf((*MockGenerator)(nil).GetSuggestionConfigData), arg0) } @@ -108,7 +113,7 @@ func (m *MockGenerator) GetTrialTemplate(arg0 *v1beta11.Experiment) (string, err } // GetTrialTemplate indicates an expected call of GetTrialTemplate. -func (mr *MockGeneratorMockRecorder) GetTrialTemplate(arg0 interface{}) *gomock.Call { +func (mr *MockGeneratorMockRecorder) GetTrialTemplate(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTrialTemplate", reflect.TypeOf((*MockGenerator)(nil).GetTrialTemplate), arg0) } @@ -120,7 +125,7 @@ func (m *MockGenerator) InjectClient(arg0 client.Client) { } // InjectClient indicates an expected call of InjectClient. -func (mr *MockGeneratorMockRecorder) InjectClient(arg0 interface{}) *gomock.Call { +func (mr *MockGeneratorMockRecorder) InjectClient(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InjectClient", reflect.TypeOf((*MockGenerator)(nil).InjectClient), arg0) } diff --git a/pkg/mock/v1beta1/experiment/suggestion/suggestion.go b/pkg/mock/v1beta1/experiment/suggestion/suggestion.go index 59c1b4b3b3e..cb6e734ba8f 100644 --- a/pkg/mock/v1beta1/experiment/suggestion/suggestion.go +++ b/pkg/mock/v1beta1/experiment/suggestion/suggestion.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/suggestion (interfaces: Suggestion) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/experiment/suggestion/suggestion.go github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/suggestion Suggestion +// // Package mock is a generated GoMock package. package mock @@ -7,9 +12,9 @@ package mock import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" v1beta10 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" + gomock "go.uber.org/mock/gomock" ) // MockSuggestion is a mock of Suggestion interface. @@ -45,7 +50,7 @@ func (m *MockSuggestion) GetOrCreateSuggestion(arg0 *v1beta1.Experiment, arg1 in } // GetOrCreateSuggestion indicates an expected call of GetOrCreateSuggestion. -func (mr *MockSuggestionMockRecorder) GetOrCreateSuggestion(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSuggestionMockRecorder) GetOrCreateSuggestion(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrCreateSuggestion", reflect.TypeOf((*MockSuggestion)(nil).GetOrCreateSuggestion), arg0, arg1) } @@ -59,7 +64,7 @@ func (m *MockSuggestion) UpdateSuggestion(arg0 *v1beta10.Suggestion) error { } // UpdateSuggestion indicates an expected call of UpdateSuggestion. -func (mr *MockSuggestionMockRecorder) UpdateSuggestion(arg0 interface{}) *gomock.Call { +func (mr *MockSuggestionMockRecorder) UpdateSuggestion(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuggestion", reflect.TypeOf((*MockSuggestion)(nil).UpdateSuggestion), arg0) } @@ -73,7 +78,7 @@ func (m *MockSuggestion) UpdateSuggestionStatus(arg0 *v1beta10.Suggestion) error } // UpdateSuggestionStatus indicates an expected call of UpdateSuggestionStatus. -func (mr *MockSuggestionMockRecorder) UpdateSuggestionStatus(arg0 interface{}) *gomock.Call { +func (mr *MockSuggestionMockRecorder) UpdateSuggestionStatus(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuggestionStatus", reflect.TypeOf((*MockSuggestion)(nil).UpdateSuggestionStatus), arg0) } diff --git a/pkg/mock/v1beta1/suggestion/suggestionclient/suggestionclient.go b/pkg/mock/v1beta1/suggestion/suggestionclient/suggestionclient.go index f6ef886d773..9091cfded9d 100644 --- a/pkg/mock/v1beta1/suggestion/suggestionclient/suggestionclient.go +++ b/pkg/mock/v1beta1/suggestion/suggestionclient/suggestionclient.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/controller.v1beta1/suggestion/suggestionclient (interfaces: SuggestionClient) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/suggestion/suggestionclient/suggestionclient.go github.com/kubeflow/katib/pkg/controller.v1beta1/suggestion/suggestionclient SuggestionClient +// // Package mock is a generated GoMock package. package mock @@ -7,10 +12,10 @@ package mock import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" v1beta10 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" v1beta11 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" + gomock "go.uber.org/mock/gomock" ) // MockSuggestionClient is a mock of SuggestionClient interface. @@ -45,7 +50,7 @@ func (m *MockSuggestionClient) SyncAssignments(arg0 *v1beta10.Suggestion, arg1 * } // SyncAssignments indicates an expected call of SyncAssignments. -func (mr *MockSuggestionClientMockRecorder) SyncAssignments(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSuggestionClientMockRecorder) SyncAssignments(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncAssignments", reflect.TypeOf((*MockSuggestionClient)(nil).SyncAssignments), arg0, arg1, arg2) } @@ -59,7 +64,7 @@ func (m *MockSuggestionClient) ValidateAlgorithmSettings(arg0 *v1beta10.Suggesti } // ValidateAlgorithmSettings indicates an expected call of ValidateAlgorithmSettings. -func (mr *MockSuggestionClientMockRecorder) ValidateAlgorithmSettings(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSuggestionClientMockRecorder) ValidateAlgorithmSettings(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAlgorithmSettings", reflect.TypeOf((*MockSuggestionClient)(nil).ValidateAlgorithmSettings), arg0, arg1) } @@ -73,7 +78,7 @@ func (m *MockSuggestionClient) ValidateEarlyStoppingSettings(arg0 *v1beta10.Sugg } // ValidateEarlyStoppingSettings indicates an expected call of ValidateEarlyStoppingSettings. -func (mr *MockSuggestionClientMockRecorder) ValidateEarlyStoppingSettings(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSuggestionClientMockRecorder) ValidateEarlyStoppingSettings(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateEarlyStoppingSettings", reflect.TypeOf((*MockSuggestionClient)(nil).ValidateEarlyStoppingSettings), arg0, arg1) } diff --git a/pkg/mock/v1beta1/trial/managerclient/katibmanager.go b/pkg/mock/v1beta1/trial/managerclient/katibmanager.go index 3b7737d3a44..4706cc1d877 100644 --- a/pkg/mock/v1beta1/trial/managerclient/katibmanager.go +++ b/pkg/mock/v1beta1/trial/managerclient/katibmanager.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/controller.v1beta1/trial/managerclient (interfaces: ManagerClient) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/trial/managerclient/katibmanager.go github.com/kubeflow/katib/pkg/controller.v1beta1/trial/managerclient ManagerClient +// // Package mock is a generated GoMock package. package mock @@ -7,9 +12,9 @@ package mock import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" api_v1_beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1" + gomock "go.uber.org/mock/gomock" ) // MockManagerClient is a mock of ManagerClient interface. @@ -45,7 +50,7 @@ func (m *MockManagerClient) DeleteTrialObservationLog(arg0 *v1beta1.Trial) (*api } // DeleteTrialObservationLog indicates an expected call of DeleteTrialObservationLog. -func (mr *MockManagerClientMockRecorder) DeleteTrialObservationLog(arg0 interface{}) *gomock.Call { +func (mr *MockManagerClientMockRecorder) DeleteTrialObservationLog(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTrialObservationLog", reflect.TypeOf((*MockManagerClient)(nil).DeleteTrialObservationLog), arg0) } @@ -60,7 +65,7 @@ func (m *MockManagerClient) GetTrialObservationLog(arg0 *v1beta1.Trial) (*api_v1 } // GetTrialObservationLog indicates an expected call of GetTrialObservationLog. -func (mr *MockManagerClientMockRecorder) GetTrialObservationLog(arg0 interface{}) *gomock.Call { +func (mr *MockManagerClientMockRecorder) GetTrialObservationLog(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTrialObservationLog", reflect.TypeOf((*MockManagerClient)(nil).GetTrialObservationLog), arg0) } diff --git a/pkg/mock/v1beta1/util/katibclient/katibclient.go b/pkg/mock/v1beta1/util/katibclient/katibclient.go index 183e78368d6..5245d904e47 100644 --- a/pkg/mock/v1beta1/util/katibclient/katibclient.go +++ b/pkg/mock/v1beta1/util/katibclient/katibclient.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/kubeflow/katib/pkg/util/v1beta1/katibclient (interfaces: Client) +// +// Generated by this command: +// +// mockgen -package mock -destination pkg/mock/v1beta1/util/katibclient/katibclient.go github.com/kubeflow/katib/pkg/util/v1beta1/katibclient Client +// // Package mock is a generated GoMock package. package mock @@ -7,10 +12,10 @@ package mock import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1" v1beta10 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1" v1beta11 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1" + gomock "go.uber.org/mock/gomock" v1 "k8s.io/api/core/v1" client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -47,7 +52,7 @@ func (m *MockClient) CreateRuntimeObject(arg0 client.Object) error { } // CreateRuntimeObject indicates an expected call of CreateRuntimeObject. -func (mr *MockClientMockRecorder) CreateRuntimeObject(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateRuntimeObject(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRuntimeObject", reflect.TypeOf((*MockClient)(nil).CreateRuntimeObject), arg0) } @@ -61,7 +66,7 @@ func (m *MockClient) DeleteRuntimeObject(arg0 client.Object) error { } // DeleteRuntimeObject indicates an expected call of DeleteRuntimeObject. -func (mr *MockClientMockRecorder) DeleteRuntimeObject(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteRuntimeObject(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRuntimeObject", reflect.TypeOf((*MockClient)(nil).DeleteRuntimeObject), arg0) } @@ -83,7 +88,7 @@ func (mr *MockClientMockRecorder) GetClient() *gomock.Call { // GetConfigMap mocks base method. func (m *MockClient) GetConfigMap(arg0 string, arg1 ...string) (map[string]string, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -94,16 +99,16 @@ func (m *MockClient) GetConfigMap(arg0 string, arg1 ...string) (map[string]strin } // GetConfigMap indicates an expected call of GetConfigMap. -func (mr *MockClientMockRecorder) GetConfigMap(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetConfigMap(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfigMap", reflect.TypeOf((*MockClient)(nil).GetConfigMap), varargs...) } // GetExperiment mocks base method. func (m *MockClient) GetExperiment(arg0 string, arg1 ...string) (*v1beta1.Experiment, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -114,16 +119,16 @@ func (m *MockClient) GetExperiment(arg0 string, arg1 ...string) (*v1beta1.Experi } // GetExperiment indicates an expected call of GetExperiment. -func (mr *MockClientMockRecorder) GetExperiment(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetExperiment(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExperiment", reflect.TypeOf((*MockClient)(nil).GetExperiment), varargs...) } // GetExperimentList mocks base method. func (m *MockClient) GetExperimentList(arg0 ...string) (*v1beta1.ExperimentList, error) { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -134,7 +139,7 @@ func (m *MockClient) GetExperimentList(arg0 ...string) (*v1beta1.ExperimentList, } // GetExperimentList indicates an expected call of GetExperimentList. -func (mr *MockClientMockRecorder) GetExperimentList(arg0 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetExperimentList(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExperimentList", reflect.TypeOf((*MockClient)(nil).GetExperimentList), arg0...) } @@ -157,7 +162,7 @@ func (mr *MockClientMockRecorder) GetNamespaceList() *gomock.Call { // GetSuggestion mocks base method. func (m *MockClient) GetSuggestion(arg0 string, arg1 ...string) (*v1beta10.Suggestion, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -168,16 +173,16 @@ func (m *MockClient) GetSuggestion(arg0 string, arg1 ...string) (*v1beta10.Sugge } // GetSuggestion indicates an expected call of GetSuggestion. -func (mr *MockClientMockRecorder) GetSuggestion(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetSuggestion(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSuggestion", reflect.TypeOf((*MockClient)(nil).GetSuggestion), varargs...) } // GetTrial mocks base method. func (m *MockClient) GetTrial(arg0 string, arg1 ...string) (*v1beta11.Trial, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -188,16 +193,16 @@ func (m *MockClient) GetTrial(arg0 string, arg1 ...string) (*v1beta11.Trial, err } // GetTrial indicates an expected call of GetTrial. -func (mr *MockClientMockRecorder) GetTrial(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetTrial(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTrial", reflect.TypeOf((*MockClient)(nil).GetTrial), varargs...) } // GetTrialList mocks base method. func (m *MockClient) GetTrialList(arg0 string, arg1 ...string) (*v1beta11.TrialList, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -208,16 +213,16 @@ func (m *MockClient) GetTrialList(arg0 string, arg1 ...string) (*v1beta11.TrialL } // GetTrialList indicates an expected call of GetTrialList. -func (mr *MockClientMockRecorder) GetTrialList(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetTrialList(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTrialList", reflect.TypeOf((*MockClient)(nil).GetTrialList), varargs...) } // GetTrialTemplates mocks base method. func (m *MockClient) GetTrialTemplates(arg0 ...string) (*v1.ConfigMapList, error) { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -228,7 +233,7 @@ func (m *MockClient) GetTrialTemplates(arg0 ...string) (*v1.ConfigMapList, error } // GetTrialTemplates indicates an expected call of GetTrialTemplates. -func (mr *MockClientMockRecorder) GetTrialTemplates(arg0 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetTrialTemplates(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTrialTemplates", reflect.TypeOf((*MockClient)(nil).GetTrialTemplates), arg0...) } @@ -240,7 +245,7 @@ func (m *MockClient) InjectClient(arg0 client.Client) { } // InjectClient indicates an expected call of InjectClient. -func (mr *MockClientMockRecorder) InjectClient(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) InjectClient(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InjectClient", reflect.TypeOf((*MockClient)(nil).InjectClient), arg0) } @@ -254,7 +259,7 @@ func (m *MockClient) UpdateRuntimeObject(arg0 client.Object) error { } // UpdateRuntimeObject indicates an expected call of UpdateRuntimeObject. -func (mr *MockClientMockRecorder) UpdateRuntimeObject(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) UpdateRuntimeObject(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRuntimeObject", reflect.TypeOf((*MockClient)(nil).UpdateRuntimeObject), arg0) } diff --git a/pkg/webhook/v1beta1/experiment/validator/validator_test.go b/pkg/webhook/v1beta1/experiment/validator/validator_test.go index 0bc33acbb8d..883e4ccec48 100644 --- a/pkg/webhook/v1beta1/experiment/validator/validator_test.go +++ b/pkg/webhook/v1beta1/experiment/validator/validator_test.go @@ -20,7 +20,7 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" batchv1 "k8s.io/api/batch/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"