Add module generate command and update all generated files

This commit is contained in:
Joshua Casey
2024-05-21 10:43:52 -05:00
parent 0076f1251c
commit 2f9df8c8e2
8 changed files with 18 additions and 16 deletions

View File

@@ -50,6 +50,9 @@ function main() {
KUBE_PANIC_WATCH_DECODE_ERROR=${kube_panic_watch_decode_error} \ KUBE_PANIC_WATCH_DECODE_ERROR=${kube_panic_watch_decode_error} \
go test -short -race ./... go test -short -race ./...
;; ;;
'generate')
go generate ./internal/mocks/...
;;
*) *)
usage usage
;; ;;

View File

@@ -1,6 +1,6 @@
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved. // Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package credentialrequestmocks package mockcredentialrequest
//go:generate go run -v go.uber.org/mock/mockgen -destination=credentialrequestmocks.go -package=credentialrequestmocks -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/registry/credentialrequest TokenCredentialRequestAuthenticator //go:generate go run -v go.uber.org/mock/mockgen -destination=mockcredentialrequest.go -package=mockcredentialrequest -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/registry/credentialrequest TokenCredentialRequestAuthenticator

View File

@@ -7,11 +7,11 @@
// //
// Generated by this command: // Generated by this command:
// //
// mockgen -destination=credentialrequestmocks.go -package=credentialrequestmocks -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/registry/credentialrequest TokenCredentialRequestAuthenticator // mockgen -destination=mockcredentialrequest.go -package=mockcredentialrequest -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/registry/credentialrequest TokenCredentialRequestAuthenticator
// //
// Package credentialrequestmocks is a generated GoMock package. // Package mockcredentialrequest is a generated GoMock package.
package credentialrequestmocks package mockcredentialrequest
import ( import (
context "context" context "context"

View File

@@ -1,6 +1,6 @@
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved. // Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package issuermocks package mockissuer
//go:generate go run -v go.uber.org/mock/mockgen -destination=issuermocks.go -package=issuermocks -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/clientcertissuer ClientCertIssuer //go:generate go run -v go.uber.org/mock/mockgen -destination=mockissuer.go -package=mockissuer -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/clientcertissuer ClientCertIssuer

View File

@@ -7,11 +7,11 @@
// //
// Generated by this command: // Generated by this command:
// //
// mockgen -destination=issuermocks.go -package=issuermocks -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/clientcertissuer ClientCertIssuer // mockgen -destination=mockissuer.go -package=mockissuer -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/clientcertissuer ClientCertIssuer
// //
// Package issuermocks is a generated GoMock package. // Package mockissuer is a generated GoMock package.
package issuermocks package mockissuer
import ( import (
reflect "reflect" reflect "reflect"

View File

@@ -3,5 +3,5 @@
package mocks package mocks
//go:generate go run -v go.uber.org/mock/mockgen -destination=mockpodcommandexecutor.go -package=mocks -copyright_file=../../../../hack/header.txt go.pinniped.dev/internal/controller/kubecertagent PodCommandExecutor //go:generate go run -v go.uber.org/mock/mockgen -destination=mockpodcommandexecutor.go -package=mocks -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/controller/kubecertagent PodCommandExecutor
//go:generate go run -v go.uber.org/mock/mockgen -destination=mockdynamiccert.go -package=mocks -copyright_file=../../../../hack/header.txt -mock_names Private=MockDynamicCertPrivate go.pinniped.dev/internal/dynamiccert Private //go:generate go run -v go.uber.org/mock/mockgen -destination=mockdynamiccert.go -package=mocks -copyright_file=../../../hack/header.txt -mock_names Private=MockDynamicCertPrivate go.pinniped.dev/internal/dynamiccert Private

View File

@@ -7,7 +7,7 @@
// //
// Generated by this command: // Generated by this command:
// //
// mockgen -destination=mockdynamiccert.go -package=mocks -copyright_file=../../../../hack/header.txt -mock_names Private=MockDynamicCertPrivate go.pinniped.dev/internal/dynamiccert Private // mockgen -destination=mockdynamiccert.go -package=mocks -copyright_file=../../../hack/header.txt -mock_names Private=MockDynamicCertPrivate go.pinniped.dev/internal/dynamiccert Private
// //
// Package mocks is a generated GoMock package. // Package mocks is a generated GoMock package.

View File

@@ -7,7 +7,7 @@
// //
// Generated by this command: // Generated by this command:
// //
// mockgen -destination=mockpodcommandexecutor.go -package=mocks -copyright_file=../../../../hack/header.txt go.pinniped.dev/internal/controller/kubecertagent PodCommandExecutor // mockgen -destination=mockpodcommandexecutor.go -package=mocks -copyright_file=../../../hack/header.txt go.pinniped.dev/internal/controller/kubecertagent PodCommandExecutor
// //
// Package mocks is a generated GoMock package. // Package mocks is a generated GoMock package.
@@ -16,7 +16,6 @@ package mocks
import ( import (
context "context" context "context"
reflect "reflect" reflect "reflect"
"slices"
gomock "go.uber.org/mock/gomock" gomock "go.uber.org/mock/gomock"
) )
@@ -60,6 +59,6 @@ func (m *MockPodCommandExecutor) Exec(arg0 context.Context, arg1, arg2, arg3 str
// Exec indicates an expected call of Exec. // Exec indicates an expected call of Exec.
func (mr *MockPodCommandExecutorMockRecorder) Exec(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call { func (mr *MockPodCommandExecutorMockRecorder) Exec(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
varargs := slices.Concat([]any{arg0, arg1, arg2, arg3}, arg4) varargs := append([]any{arg0, arg1, arg2, arg3}, arg4...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockPodCommandExecutor)(nil).Exec), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockPodCommandExecutor)(nil).Exec), varargs...)
} }