Merge pull request #103631 from vikramcse/automate_code_generation

Automate code generated by using mockgen and go:generate
This commit is contained in:
Kubernetes Prow Robot 2021-09-04 07:51:19 -07:00 committed by GitHub
commit f61ed43988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 878 additions and 394 deletions

View File

@ -6,6 +6,7 @@ require (
github.com/aojea/sloppy-netparser v0.0.0-20210819225411-1b3bd8b3b975
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c
github.com/client9/misspell v0.3.4
github.com/golang/mock v1.4.4
github.com/golangci/golangci-lint v1.41.1
github.com/google/go-flow-levee v0.1.5
gotest.tools/gotestsum v1.6.4

View File

@ -236,6 +236,7 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=

View File

@ -33,4 +33,7 @@ import (
// dependencies
_ "sigs.k8s.io/zeitgeist"
// mockgen
_ "github.com/golang/mock/mockgen"
)

141
hack/update-mocks.sh Executable file
View File

@ -0,0 +1,141 @@
#!/usr/bin/env bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script generates mock files using mockgen.
# Usage: `hack/update-mocks.sh`.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
# Explicitly opt into go modules, even though we're inside a GOPATH directory
export GO111MODULE=on
_tmp="${KUBE_ROOT}/_tmp_build_tag_files"
mkdir -p "${_tmp}"
function cleanup {
rm -rf "$_tmp"
rm -f "tempfile"
}
trap cleanup EXIT
kube::golang::verify_go_version
echo 'installing mockgen'
pushd "${KUBE_ROOT}/hack/tools" >/dev/null
go install github.com/golang/mock/mockgen
popd >/dev/null
find_files() {
find . -not \( \
\( \
-wholename './output' \
-o -wholename './.git' \
-o -wholename './_output' \
-o -wholename './_gopath' \
-o -wholename './release' \
-o -wholename './target' \
-o -wholename '*/third_party/*' \
-o -wholename '*/vendor/*' \
-o -wholename './staging/src/k8s.io/client-go/*vendor/*' \
-o -wholename '*/bindata.go' \
\) -prune \
\) -name '*.go'
}
cd "${KUBE_ROOT}"
echo 'executing go generate command on below files'
for IFILE in $(find_files | xargs grep --files-with-matches -e '//go:generate mockgen'); do
temp_file_name=$(mktemp --tmpdir="${_tmp}")
# serach for build tag used in file
build_tag_string=$(grep -o '+build.*$' "$IFILE") || true
# if the file does not have build string
if [ -n "$build_tag_string" ]
then
# write the build tag in the temp file
echo -n "$build_tag_string" > "$temp_file_name"
# if +build tag is defined in interface file
BUILD_TAG_FILE=$temp_file_name go generate -v "$IFILE"
else
# if no +build tag is defined in interface file
go generate -v "$IFILE"
fi
done
# get the changed mock files
files=$(git diff --name-only)
for file in $files; do
if [ "$file" == "hack/update-mocks.sh" ]; then
continue
fi
# serach for build tags used in file
# //go:build !providerless
# // +build !providerless
go_build_tag_string=$(grep -o 'go:build.*$' "$file") || true
build_tag_string=$(grep -o '+build.*$' "$file") || true
new_header=''
# if the file has both headers
if [ -n "$build_tag_string" ] && [ -n "$go_build_tag_string" ]
then
# create a new header with the build string and the copyright text
new_header=$(echo -e "//""$go_build_tag_string""\n""//" "$build_tag_string""\n" | cat - hack/boilerplate/boilerplate.generatego.txt)
# ignore the first line (build tag) from the file
tail -n +3 "$file" > tempfile
fi
# if the file has only // +build !providerless header
if [ -n "$build_tag_string" ] && [ -z "$go_build_tag_string" ]
then
# create a new header with the build string and the copyright text
new_header=$(echo -e "//" "$build_tag_string""\n" | cat - hack/boilerplate/boilerplate.generatego.txt)
# ignore the first line (build tag) from the file
tail -n +2 "$file" > tempfile
fi
# if the file has only //go:build !providerless header
if [ -z "$build_tag_string" ] && [ -n "$go_build_tag_string" ]
then
# create a new header with the build string and the copyright text
new_header=$(echo -e "//""$go_build_tag_string""\n" | cat - hack/boilerplate/boilerplate.generatego.txt)
# ignore the first line (build tag) from the file
tail -n +2 "$file" > tempfile
fi
# if the header if generted
if [ -n "$new_header" ]
then
# write the newly generated header file to the original file
echo -e "$new_header" | cat - tempfile > "$file"
else
# if no build string insert at the top
cat hack/boilerplate/boilerplate.generatego.txt "$file" > tempfile && \
mv tempfile "$file"
fi
done

86
hack/verify-mocks.sh Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script checks whether updating of Mock files generated from Interfaces
# is needed or not. We should run `hack/update-mocks.sh`
# if Mock files are out of date.
# Usage: `hack/verify-mocks.sh`.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
export KUBE_ROOT
source "${KUBE_ROOT}/hack/lib/init.sh"
# Explicitly opt into go modules, even though we're inside a GOPATH directory
export GO111MODULE=on
_tmp="${KUBE_ROOT}/_tmp"
mkdir -p "${_tmp}"
"${KUBE_ROOT}/hack/update-mocks.sh"
# If there are untracked generated mock files which needed to be committed
if git_status=$(git status --porcelain --untracked=normal 2>/dev/null) && [[ -n "${git_status}" ]]; then
echo "!!! You may have untracked mock files."
fi
# get the changed mock files
files=$(git diff --name-only)
# copy the changed files to the _tmp directory for later comparison
mock_files=()
for file in $files; do
if [ "$file" == "hack/verify-mocks.sh" ]; then
continue
fi
# create the directory in _tmp
mkdir -p "$_tmp/""$(dirname "$file")"
cp "$file" "$_tmp/""$file"
mock_files+=("$file")
# reset the current file
git checkout "$file"
done
echo "diffing process started for ${#mock_files[@]} files"
ret=0
for file in "${mock_files[@]}"; do
diff -Naupr -B \
-I '^/\*' \
-I 'Copyright The Kubernetes Authors.' \
-I 'Licensed under the Apache License, Version 2.0 (the "License");' \
-I 'you may not use this file except in compliance with the License.' \
-I 'You may obtain a copy of the License at' \
-I 'http://www.apache.org/licenses/LICENSE-2.0' \
-I 'Unless required by applicable law or agreed to in writing, software' \
-I 'distributed under the License is distributed on an "AS IS" BASIS,' \
-I 'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.' \
-I 'See the License for the specific language governing permissions and' \
-I 'limitations under the License.' \
-I '^\*/' \
"$file" "$_tmp/""$file" || ret=$?
if [[ $ret -ne 0 ]]; then
echo "Mock files are out of date. Please run hack/update-mocks.sh" >&2
exit 1
fi
done
echo "up to date"

View File

@ -27,6 +27,7 @@ import (
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -34,6 +35,7 @@ import (
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
"k8s.io/kubernetes/pkg/kubelet/dockershim/network"
nettest "k8s.io/kubernetes/pkg/kubelet/dockershim/network/testing"
"k8s.io/kubernetes/pkg/kubelet/types"
)
@ -207,9 +209,10 @@ func TestSandboxStatusAfterRestart(t *testing.T) {
// calls are made when we run/stop a sandbox.
func TestNetworkPluginInvocation(t *testing.T) {
ds, _, _ := newTestDockerService()
mockPlugin := newTestNetworkPlugin(t)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockPlugin := nettest.NewMockNetworkPlugin(ctrl)
ds.network = network.NewPluginManager(mockPlugin)
defer mockPlugin.Finish()
name := "foo0"
ns := "bar0"
@ -221,7 +224,7 @@ func TestNetworkPluginInvocation(t *testing.T) {
cID := kubecontainer.ContainerID{Type: runtimeName, ID: libdocker.GetFakeContainerID(fmt.Sprintf("/%v", makeSandboxName(c)))}
mockPlugin.EXPECT().Name().Return("mockNetworkPlugin").AnyTimes()
setup := mockPlugin.EXPECT().SetUpPod(ns, name, cID)
setup := mockPlugin.EXPECT().SetUpPod(ns, name, cID, map[string]string{"annotation": ns}, map[string]string{})
mockPlugin.EXPECT().TearDownPod(ns, name, cID).After(setup)
_, err := ds.RunPodSandbox(getTestCTX(), &runtimeapi.RunPodSandboxRequest{Config: c})
@ -234,9 +237,10 @@ func TestNetworkPluginInvocation(t *testing.T) {
// for host network sandboxes.
func TestHostNetworkPluginInvocation(t *testing.T) {
ds, _, _ := newTestDockerService()
mockPlugin := newTestNetworkPlugin(t)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockPlugin := nettest.NewMockNetworkPlugin(ctrl)
ds.network = network.NewPluginManager(mockPlugin)
defer mockPlugin.Finish()
name := "foo0"
ns := "bar0"
@ -266,9 +270,10 @@ func TestHostNetworkPluginInvocation(t *testing.T) {
// hits a SetUpPod failure.
func TestSetUpPodFailure(t *testing.T) {
ds, _, _ := newTestDockerService()
mockPlugin := newTestNetworkPlugin(t)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockPlugin := nettest.NewMockNetworkPlugin(ctrl)
ds.network = network.NewPluginManager(mockPlugin)
defer mockPlugin.Finish()
name := "foo0"
ns := "bar0"
@ -279,7 +284,7 @@ func TestSetUpPodFailure(t *testing.T) {
)
cID := kubecontainer.ContainerID{Type: runtimeName, ID: libdocker.GetFakeContainerID(fmt.Sprintf("/%v", makeSandboxName(c)))}
mockPlugin.EXPECT().Name().Return("mockNetworkPlugin").AnyTimes()
mockPlugin.EXPECT().SetUpPod(ns, name, cID).Return(errors.New("setup pod error")).AnyTimes()
mockPlugin.EXPECT().SetUpPod(ns, name, cID, map[string]string{"annotation": ns}, map[string]string{}).Return(errors.New("setup pod error")).AnyTimes()
// If SetUpPod() fails, we expect TearDownPod() to immediately follow
mockPlugin.EXPECT().TearDownPod(ns, name, cID)
// Assume network plugin doesn't return error, dockershim should still be able to return not ready correctly.

View File

@ -40,12 +40,6 @@ import (
"k8s.io/kubernetes/pkg/kubelet/util/cache"
)
// newTestNetworkPlugin returns a mock plugin that implements network.NetworkPlugin
func newTestNetworkPlugin(t *testing.T) *nettest.MockNetworkPlugin {
ctrl := gomock.NewController(t)
return nettest.NewMockNetworkPlugin(ctrl)
}
type mockCheckpointManager struct {
checkpoint map[string]*PodSandboxCheckpoint
}
@ -139,9 +133,10 @@ func TestStatus(t *testing.T) {
}, statusResp.Status)
// Should not report ready status is network plugin returns error.
mockPlugin := newTestNetworkPlugin(t)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockPlugin := nettest.NewMockNetworkPlugin(ctrl)
ds.network = network.NewPluginManager(mockPlugin)
defer mockPlugin.Finish()
mockPlugin.EXPECT().Status().Return(errors.New("network error"))
statusResp, err = ds.Status(getTestCTX(), &runtimeapi.StatusRequest{})
assert.NoError(t, err)

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=client.go -destination=testing/mock_client.go -package=testing Interface
package libdocker
import (

View File

@ -2,7 +2,7 @@
// +build !dockerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,9 +17,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Generated code, generated via: `mockgen -source pkg/kubelet/dockershim/libdocker/client.go -destination pkg/kubelet/dockershim/libdocker/testing/mock_client.go -package testing`
// Edited by hand for boilerplate and gofmt.
// TODO, this should be autogenerated/autoupdated by scripts.
// Code generated by MockGen. DO NOT EDIT.
// Source: client.go
// Package testing is a generated GoMock package.
package testing

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=plugins.go -destination=testing/mock_network_plugin.go -package=testing NetworkPlugin
package network
import (

View File

@ -2,7 +2,7 @@
// +build !dockerless
/*
Copyright 2016 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,120 +17,281 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Generated code, generated via: `mockgen k8s.io/kubernetes/pkg/kubelet/network NetworkPlugin > $GOPATH/src/k8s.io/kubernetes/pkg/kubelet/network/testing/mock_network_plugin.go`
// Edited by hand for boilerplate and gofmt.
// TODO, this should be autogenerated/autoupdated by scripts.
// Code generated by MockGen. DO NOT EDIT.
// Source: plugins.go
// Package testing is a generated GoMock package.
package testing
import (
gomock "github.com/golang/mock/gomock"
sets "k8s.io/apimachinery/pkg/util/sets"
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
config "k8s.io/kubernetes/pkg/kubelet/apis/config"
container "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/dockershim/network"
network "k8s.io/kubernetes/pkg/kubelet/dockershim/network"
hostport "k8s.io/kubernetes/pkg/kubelet/dockershim/network/hostport"
reflect "reflect"
)
// Mock of NetworkPlugin interface
// MockNetworkPlugin is a mock of NetworkPlugin interface
type MockNetworkPlugin struct {
ctrl *gomock.Controller
recorder *_MockNetworkPluginRecorder
recorder *MockNetworkPluginMockRecorder
}
// Recorder for MockNetworkPlugin (not exported)
type _MockNetworkPluginRecorder struct {
// MockNetworkPluginMockRecorder is the mock recorder for MockNetworkPlugin
type MockNetworkPluginMockRecorder struct {
mock *MockNetworkPlugin
}
// NewMockNetworkPlugin creates a new mock instance
func NewMockNetworkPlugin(ctrl *gomock.Controller) *MockNetworkPlugin {
mock := &MockNetworkPlugin{ctrl: ctrl}
mock.recorder = &_MockNetworkPluginRecorder{mock}
mock.recorder = &MockNetworkPluginMockRecorder{mock}
return mock
}
func (_m *MockNetworkPlugin) EXPECT() *_MockNetworkPluginRecorder {
return _m.recorder
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockNetworkPlugin) EXPECT() *MockNetworkPluginMockRecorder {
return m.recorder
}
func (_m *MockNetworkPlugin) Capabilities() sets.Int {
ret := _m.ctrl.Call(_m, "Capabilities")
// Init mocks base method
func (m *MockNetworkPlugin) Init(host network.Host, hairpinMode config.HairpinMode, nonMasqueradeCIDR string, mtu int) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Init", host, hairpinMode, nonMasqueradeCIDR, mtu)
ret0, _ := ret[0].(error)
return ret0
}
// Init indicates an expected call of Init
func (mr *MockNetworkPluginMockRecorder) Init(host, hairpinMode, nonMasqueradeCIDR, mtu interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockNetworkPlugin)(nil).Init), host, hairpinMode, nonMasqueradeCIDR, mtu)
}
// Event mocks base method
func (m *MockNetworkPlugin) Event(name string, details map[string]interface{}) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Event", name, details)
}
// Event indicates an expected call of Event
func (mr *MockNetworkPluginMockRecorder) Event(name, details interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Event", reflect.TypeOf((*MockNetworkPlugin)(nil).Event), name, details)
}
// Name mocks base method
func (m *MockNetworkPlugin) Name() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Name")
ret0, _ := ret[0].(string)
return ret0
}
// Name indicates an expected call of Name
func (mr *MockNetworkPluginMockRecorder) Name() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockNetworkPlugin)(nil).Name))
}
// Capabilities mocks base method
func (m *MockNetworkPlugin) Capabilities() sets.Int {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Capabilities")
ret0, _ := ret[0].(sets.Int)
return ret0
}
func (_m *MockNetworkPlugin) Finish() {
_m.ctrl.Finish()
// Capabilities indicates an expected call of Capabilities
func (mr *MockNetworkPluginMockRecorder) Capabilities() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Capabilities", reflect.TypeOf((*MockNetworkPlugin)(nil).Capabilities))
}
func (_mr *_MockNetworkPluginRecorder) Capabilities() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Capabilities")
// SetUpPod mocks base method
func (m *MockNetworkPlugin) SetUpPod(namespace, name string, podSandboxID container.ContainerID, annotations, options map[string]string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetUpPod", namespace, name, podSandboxID, annotations, options)
ret0, _ := ret[0].(error)
return ret0
}
func (_m *MockNetworkPlugin) Event(_param0 string, _param1 map[string]interface{}) {
_m.ctrl.Call(_m, "Event", _param0, _param1)
// SetUpPod indicates an expected call of SetUpPod
func (mr *MockNetworkPluginMockRecorder) SetUpPod(namespace, name, podSandboxID, annotations, options interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpPod", reflect.TypeOf((*MockNetworkPlugin)(nil).SetUpPod), namespace, name, podSandboxID, annotations, options)
}
func (_mr *_MockNetworkPluginRecorder) Event(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Event", arg0, arg1)
// TearDownPod mocks base method
func (m *MockNetworkPlugin) TearDownPod(namespace, name string, podSandboxID container.ContainerID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "TearDownPod", namespace, name, podSandboxID)
ret0, _ := ret[0].(error)
return ret0
}
func (_m *MockNetworkPlugin) GetPodNetworkStatus(_param0 string, _param1 string, _param2 container.ContainerID) (*network.PodNetworkStatus, error) {
ret := _m.ctrl.Call(_m, "GetPodNetworkStatus", _param0, _param1, _param2)
// TearDownPod indicates an expected call of TearDownPod
func (mr *MockNetworkPluginMockRecorder) TearDownPod(namespace, name, podSandboxID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TearDownPod", reflect.TypeOf((*MockNetworkPlugin)(nil).TearDownPod), namespace, name, podSandboxID)
}
// GetPodNetworkStatus mocks base method
func (m *MockNetworkPlugin) GetPodNetworkStatus(namespace, name string, podSandboxID container.ContainerID) (*network.PodNetworkStatus, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPodNetworkStatus", namespace, name, podSandboxID)
ret0, _ := ret[0].(*network.PodNetworkStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
func (_mr *_MockNetworkPluginRecorder) GetPodNetworkStatus(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "GetPodNetworkStatus", arg0, arg1, arg2)
// GetPodNetworkStatus indicates an expected call of GetPodNetworkStatus
func (mr *MockNetworkPluginMockRecorder) GetPodNetworkStatus(namespace, name, podSandboxID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodNetworkStatus", reflect.TypeOf((*MockNetworkPlugin)(nil).GetPodNetworkStatus), namespace, name, podSandboxID)
}
func (_m *MockNetworkPlugin) Init(_param0 network.Host, _param1 kubeletconfig.HairpinMode, nonMasqueradeCIDR string, mtu int) error {
ret := _m.ctrl.Call(_m, "Init", _param0, _param1)
// Status mocks base method
func (m *MockNetworkPlugin) Status() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Status")
ret0, _ := ret[0].(error)
return ret0
}
func (_mr *_MockNetworkPluginRecorder) Init(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Init", arg0, arg1)
// Status indicates an expected call of Status
func (mr *MockNetworkPluginMockRecorder) Status() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockNetworkPlugin)(nil).Status))
}
func (_m *MockNetworkPlugin) Name() string {
ret := _m.ctrl.Call(_m, "Name")
// MockHost is a mock of Host interface
type MockHost struct {
ctrl *gomock.Controller
recorder *MockHostMockRecorder
}
// MockHostMockRecorder is the mock recorder for MockHost
type MockHostMockRecorder struct {
mock *MockHost
}
// NewMockHost creates a new mock instance
func NewMockHost(ctrl *gomock.Controller) *MockHost {
mock := &MockHost{ctrl: ctrl}
mock.recorder = &MockHostMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockHost) EXPECT() *MockHostMockRecorder {
return m.recorder
}
// GetNetNS mocks base method
func (m *MockHost) GetNetNS(containerID string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetNetNS", containerID)
ret0, _ := ret[0].(string)
return ret0
ret1, _ := ret[1].(error)
return ret0, ret1
}
func (_mr *_MockNetworkPluginRecorder) Name() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Name")
// GetNetNS indicates an expected call of GetNetNS
func (mr *MockHostMockRecorder) GetNetNS(containerID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNetNS", reflect.TypeOf((*MockHost)(nil).GetNetNS), containerID)
}
func (_m *MockNetworkPlugin) SetUpPod(_param0 string, _param1 string, _param2 container.ContainerID, annotations, options map[string]string) error {
ret := _m.ctrl.Call(_m, "SetUpPod", _param0, _param1, _param2)
ret0, _ := ret[0].(error)
return ret0
// GetPodPortMappings mocks base method
func (m *MockHost) GetPodPortMappings(containerID string) ([]*hostport.PortMapping, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPodPortMappings", containerID)
ret0, _ := ret[0].([]*hostport.PortMapping)
ret1, _ := ret[1].(error)
return ret0, ret1
}
func (_mr *_MockNetworkPluginRecorder) SetUpPod(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "SetUpPod", arg0, arg1, arg2)
// GetPodPortMappings indicates an expected call of GetPodPortMappings
func (mr *MockHostMockRecorder) GetPodPortMappings(containerID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodPortMappings", reflect.TypeOf((*MockHost)(nil).GetPodPortMappings), containerID)
}
func (_m *MockNetworkPlugin) Status() error {
ret := _m.ctrl.Call(_m, "Status")
ret0, _ := ret[0].(error)
return ret0
// MockNamespaceGetter is a mock of NamespaceGetter interface
type MockNamespaceGetter struct {
ctrl *gomock.Controller
recorder *MockNamespaceGetterMockRecorder
}
func (_mr *_MockNetworkPluginRecorder) Status() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Status")
// MockNamespaceGetterMockRecorder is the mock recorder for MockNamespaceGetter
type MockNamespaceGetterMockRecorder struct {
mock *MockNamespaceGetter
}
func (_m *MockNetworkPlugin) TearDownPod(_param0 string, _param1 string, _param2 container.ContainerID) error {
ret := _m.ctrl.Call(_m, "TearDownPod", _param0, _param1, _param2)
ret0, _ := ret[0].(error)
return ret0
// NewMockNamespaceGetter creates a new mock instance
func NewMockNamespaceGetter(ctrl *gomock.Controller) *MockNamespaceGetter {
mock := &MockNamespaceGetter{ctrl: ctrl}
mock.recorder = &MockNamespaceGetterMockRecorder{mock}
return mock
}
func (_mr *_MockNetworkPluginRecorder) TearDownPod(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "TearDownPod", arg0, arg1, arg2)
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockNamespaceGetter) EXPECT() *MockNamespaceGetterMockRecorder {
return m.recorder
}
// GetNetNS mocks base method
func (m *MockNamespaceGetter) GetNetNS(containerID string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetNetNS", containerID)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetNetNS indicates an expected call of GetNetNS
func (mr *MockNamespaceGetterMockRecorder) GetNetNS(containerID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNetNS", reflect.TypeOf((*MockNamespaceGetter)(nil).GetNetNS), containerID)
}
// MockPortMappingGetter is a mock of PortMappingGetter interface
type MockPortMappingGetter struct {
ctrl *gomock.Controller
recorder *MockPortMappingGetterMockRecorder
}
// MockPortMappingGetterMockRecorder is the mock recorder for MockPortMappingGetter
type MockPortMappingGetterMockRecorder struct {
mock *MockPortMappingGetter
}
// NewMockPortMappingGetter creates a new mock instance
func NewMockPortMappingGetter(ctrl *gomock.Controller) *MockPortMappingGetter {
mock := &MockPortMappingGetter{ctrl: ctrl}
mock.recorder = &MockPortMappingGetterMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockPortMappingGetter) EXPECT() *MockPortMappingGetterMockRecorder {
return m.recorder
}
// GetPodPortMappings mocks base method
func (m *MockPortMappingGetter) GetPodPortMappings(containerID string) ([]*hostport.PortMapping, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPodPortMappings", containerID)
ret0, _ := ret[0].([]*hostport.PortMapping)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetPodPortMappings indicates an expected call of GetPodPortMappings
func (mr *MockPortMappingGetterMockRecorder) GetPodPortMappings(containerID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodPortMappings", reflect.TypeOf((*MockPortMappingGetter)(nil).GetPodPortMappings), containerID)
}

View File

@ -81,7 +81,7 @@ func TestInit(t *testing.T) {
func TestPluginManager(t *testing.T) {
ctrl := gomock.NewController(t)
fnp := NewMockNetworkPlugin(ctrl)
defer fnp.Finish()
defer ctrl.Finish()
pm := network.NewPluginManager(fnp)
fnp.EXPECT().Name().Return("someNetworkPlugin").AnyTimes()
@ -96,7 +96,7 @@ func TestPluginManager(t *testing.T) {
podName := fmt.Sprintf("pod%d", i)
containerID := kubecontainer.ContainerID{ID: podName}
fnp.EXPECT().SetUpPod("", podName, containerID).Return(nil).Times(4)
fnp.EXPECT().SetUpPod("", podName, containerID, nil, nil).Return(nil).Times(4)
fnp.EXPECT().GetPodNetworkStatus("", podName, containerID).Return(&network.PodNetworkStatus{IP: netutils.ParseIPSloppy("1.2.3.4")}, nil).Times(4)
fnp.EXPECT().TearDownPod("", podName, containerID).Return(nil).Times(4)

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=azure_vmsets.go -destination=mockvmsets/azure_mock_vmsets.go -package=mockvmsets VMSet
package azure
import (
@ -31,8 +32,7 @@ import (
// VMSet defines functions all vmsets (including scale set and availability
// set) should be implemented.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmsets.go -package=mockvmsets VMSet > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/mockvmsets/azure_mock_vmsets.go
type VMSet interface {
// GetInstanceIDByNodeName gets the cloud provider ID by node name.
// It must return ("", cloudprovider.InstanceNotFound) if the instance does

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockarmclient/interface.go -package=mockarmclient Interface
package armclient
import (
@ -35,8 +36,6 @@ type PutResourcesResponse struct {
}
// Interface is the client interface for ARM.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/interface.go -package=mockarmclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/mockarmclient/interface.go
type Interface interface {
// Send sends a http request to ARM service with possible retry to regional ARM endpoint.
Send(ctx context.Context, request *http.Request) (*http.Response, *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2019 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,18 +17,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockarmclient is a generated GoMock package.
package mockarmclient
import (
context "context"
http "net/http"
reflect "reflect"
autorest "github.com/Azure/go-autorest/autorest"
azure "github.com/Azure/go-autorest/autorest/azure"
gomock "github.com/golang/mock/gomock"
armclient "k8s.io/legacy-cloud-providers/azure/clients/armclient"
retry "k8s.io/legacy-cloud-providers/azure/retry"
http "net/http"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockcontainerserviceclient/interface.go -package=mockcontainerserviceclient Interface
package containerserviceclient
import (
@ -33,8 +34,6 @@ const (
)
// Interface is the client interface for ContainerService.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/containerserviceclient/interface.go -package=mockcontainerserviceclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/containerserviceclient/mockcontainerserviceclient/interface.go
type Interface interface {
CreateOrUpdate(ctx context.Context, resourceGroupName string, managedClusterName string, parameters containerservice.ManagedCluster, etag string) *retry.Error
Delete(ctx context.Context, resourceGroupName string, managedClusterName string) *retry.Error

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockcontainerserviceclient is a generated GoMock package.
package mockcontainerserviceclient
import (
context "context"
reflect "reflect"
containerservice "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockdeploymentclient/interface.go -package=mockdeploymentclient Interface
package deploymentclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for Deployments.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/deploymentclient/interface.go -package=mockdeploymentclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/deploymentclient/mockdeploymentclient/interface.go
type Interface interface {
Get(ctx context.Context, resourceGroupName string, deploymentName string) (resources.DeploymentExtended, *retry.Error)
List(ctx context.Context, resourceGroupName string) ([]resources.DeploymentExtended, *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockdeploymentclient is a generated GoMock package.
package mockdeploymentclient
import (
context "context"
reflect "reflect"
resources "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockdiskclient/interface.go -package=mockdiskclient Interface
package diskclient
import (
@ -36,8 +37,6 @@ const (
)
// Interface is the client interface for Disks.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/interface.go -package=mockdiskclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/mockdiskclient/interface.go
type Interface interface {
// Get gets a Disk.
Get(ctx context.Context, resourceGroupName string, diskName string) (result compute.Disk, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockdiskclient is a generated GoMock package.
package mockdiskclient
import (
context "context"
reflect "reflect"
compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockinterfaceclient/interface.go -package=mockinterfaceclient Interface
package interfaceclient
import (
@ -35,8 +36,6 @@ const (
)
// Interface is the client interface for NetworkInterface.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/interfaceclient/interface.go -package=mockinterfaceclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/interfaceclient/mockinterfaceclient/interface.go
type Interface interface {
// Get gets a network.Interface.
Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, expand string) (result network.Interface, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockinterfaceclient is a generated GoMock package.
package mockinterfaceclient
import (
context "context"
reflect "reflect"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockloadbalancerclient/interface.go -package=mockloadbalancerclient Interface
package loadbalancerclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for LoadBalancer.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/loadbalancerclient/interface.go -package=mockloadbalancerclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/loadbalancerclient/mockloadbalancerclient/interface.go
type Interface interface {
// Get gets a LoadBalancer.
Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result network.LoadBalancer, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockloadbalancerclient is a generated GoMock package.
package mockloadbalancerclient
import (
context "context"
reflect "reflect"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockpublicipclient/interface.go -package=mockpublicipclient Interface
package publicipclient
import (
@ -35,8 +36,6 @@ const (
)
// Interface is the client interface for PublicIPAddress.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/publicipclient/interface.go -package=mockpublicipclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/publicipclient/mockpublicipclient/interface.go
type Interface interface {
// Get gets a PublicIPAddress.
Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, expand string) (result network.PublicIPAddress, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockpublicipclient is a generated GoMock package.
package mockpublicipclient
import (
context "context"
reflect "reflect"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockrouteclient/interface.go -package=mockrouteclient Interface
package routeclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for Route.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/routeclient/interface.go -package=mockrouteclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/routeclient/mockrouteclient/interface.go
type Interface interface {
// CreateOrUpdate creates or updates a Route.
CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters network.Route, etag string) *retry.Error

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockrouteclient is a generated GoMock package.
package mockrouteclient
import (
context "context"
reflect "reflect"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockroutetableclient/interface.go -package=mockroutetableclient Interface
package routetableclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for RouteTable.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/routetableclient/interface.go -package=mockroutetableclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/routetableclient/mockroutetableclient/interface.go
type Interface interface {
// Get gets a RouteTable.
Get(ctx context.Context, resourceGroupName string, routeTableName string, expand string) (result network.RouteTable, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockroutetableclient is a generated GoMock package.
package mockroutetableclient
import (
context "context"
reflect "reflect"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mocksecuritygroupclient/interface.go -package=mocksecuritygroupclient Interface
package securitygroupclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for SecurityGroups.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/securitygroupclient/interface.go -package=mocksecuritygroupclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/securitygroupclient/mocksecuritygroupclient/interface.go
type Interface interface {
// Get gets a SecurityGroup.
Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (result network.SecurityGroup, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mocksecuritygroupclient is a generated GoMock package.
package mocksecuritygroupclient
import (
context "context"
reflect "reflect"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mocksnapshotclient/interface.go -package=mocksnapshotclient Interface
package snapshotclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for Snapshots.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/snapshotclient/interface.go -package=mocksnapshotclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/snapshotclient/mocksnapshotclient/interface.go
type Interface interface {
// Get gets a Snapshot.
Get(ctx context.Context, resourceGroupName string, snapshotName string) (compute.Snapshot, *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,6 +17,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mocksnapshotclient is a generated GoMock package.
package mocksnapshotclient
import (

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockstorageaccountclient/interface.go -package=mockstorageaccountclient Interface
package storageaccountclient
import (
@ -36,8 +37,6 @@ const (
)
// Interface is the client interface for StorageAccounts.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/storageaccountclient/interface.go -package=mockstorageaccountclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/storageaccountclient/mockstorageaccountclient/interface.go
type Interface interface {
// Create creates a StorageAccount.
Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) *retry.Error

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,6 +17,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockstorageaccountclient is a generated GoMock package.
package mockstorageaccountclient
import (

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mocksubnetclient/interface.go -package=mocksubnetclient Interface
package subnetclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for Subnet.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/subnetclient/interface.go -package=mocksubnetclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/subnetclient/mocksubnetclient/interface.go
type Interface interface {
// Get gets a Subnet.
Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result network.Subnet, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mocksubnetclient is a generated GoMock package.
package mocksubnetclient
import (
context "context"
reflect "reflect"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockvmclient/interface.go -package=mockvmclient Interface
package vmclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for VirtualMachines.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/interface.go -package=mockvmclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmclient/mockvmclient/interface.go
type Interface interface {
// Get gets a VirtualMachine.
Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (compute.VirtualMachine, *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockvmclient is a generated GoMock package.
package mockvmclient
import (
context "context"
reflect "reflect"
compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockvmsizeclient/interface.go -package=mockvmsizeclient Interface
package vmsizeclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for VirtualMachineSizes.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmsizeclient/interface.go -package=mockvmsizeclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmsizeclient/mockvmsizeclient/interface.go
type Interface interface {
// List gets compute.VirtualMachineSizeListResult.
List(ctx context.Context, location string) (result compute.VirtualMachineSizeListResult, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,6 +17,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockvmsizeclient is a generated GoMock package.
package mockvmsizeclient
import (

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockvmssclient/interface.go -package=mockvmssclient Interface
package vmssclient
import (
@ -35,8 +36,6 @@ const (
)
// Interface is the client interface for VirtualMachineScaleSet.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/interface.go -package=mockvmssclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssclient/mockvmssclient/interface.go
type Interface interface {
// Get gets a VirtualMachineScaleSet.
Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSet, rerr *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2019 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,17 +17,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockvmssclient is a generated GoMock package.
package mockvmssclient
import (
context "context"
http "net/http"
reflect "reflect"
compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
azure "github.com/Azure/go-autorest/autorest/azure"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
http "net/http"
reflect "reflect"
)
// MockInterface is a mock of Interface interface
@ -127,66 +130,6 @@ func (mr *MockInterfaceMockRecorder) WaitForAsyncOperationResult(ctx, future int
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForAsyncOperationResult", reflect.TypeOf((*MockInterface)(nil).WaitForAsyncOperationResult), ctx, future)
}
// WaitForCreateOrUpdateResult mocks base method
func (m *MockInterface) WaitForCreateOrUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForCreateOrUpdateResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForCreateOrUpdateResult indicates an expected call of WaitForCreateOrUpdateResult
func (mr *MockInterfaceMockRecorder) WaitForCreateOrUpdateResult(ctx, future interface{}, resourceGroupName string) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForCreateOrUpdateResult", reflect.TypeOf((*MockInterface)(nil).WaitForCreateOrUpdateResult), ctx, future, resourceGroupName)
}
// WaitForDeleteInstancesResult mocks base method
func (m *MockInterface) WaitForDeleteInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForDeleteInstancesResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForDeleteInstancesResult indicates an expected call of WaitForDeleteInstancesResult
func (mr *MockInterfaceMockRecorder) WaitForDeleteInstancesResult(ctx, future interface{}, resourceGroupName string) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForDeleteInstancesResult", reflect.TypeOf((*MockInterface)(nil).WaitForDeleteInstancesResult), ctx, future, resourceGroupName)
}
// WaitForDeallocateInstancesResult mocks base method
func (m *MockInterface) WaitForDeallocateInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForDeallocateInstancesResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForDeallocateInstancesResult indicates an expected call of WaitForDeallocateInstancesResult
func (mr *MockInterfaceMockRecorder) WaitForDeallocateInstancesResult(ctx, future interface{}, resourceGroupName string) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForDeallocateInstancesResult", reflect.TypeOf((*MockInterface)(nil).WaitForDeallocateInstancesResult), ctx, future, resourceGroupName)
}
// WaitForStartInstancesResult mocks base method
func (m *MockInterface) WaitForStartInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForStartInstancesResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForStartInstancesResult indicates an expected call of WaitForStartInstancesResult
func (mr *MockInterfaceMockRecorder) WaitForStartInstancesResult(ctx, future interface{}, resourceGroupName string) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForStartInstancesResult", reflect.TypeOf((*MockInterface)(nil).WaitForStartInstancesResult), ctx, future, resourceGroupName)
}
// DeleteInstances mocks base method
func (m *MockInterface) DeleteInstances(ctx context.Context, resourceGroupName, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) *retry.Error {
m.ctrl.T.Helper()
@ -202,46 +145,106 @@ func (mr *MockInterfaceMockRecorder) DeleteInstances(ctx, resourceGroupName, vmS
}
// DeleteInstancesAsync mocks base method
func (m *MockInterface) DeleteInstancesAsync(ctx context.Context, resourceGroupName, VMScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error) {
func (m *MockInterface) DeleteInstancesAsync(ctx context.Context, resourceGroupName, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteInstancesAsync", ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs)
ret := m.ctrl.Call(m, "DeleteInstancesAsync", ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs)
ret0, _ := ret[0].(*azure.Future)
ret1, _ := ret[1].(*retry.Error)
return ret0, ret1
}
// DeleteInstancesAsync indicates an expected call of DeleteInstancesAsync
func (mr *MockInterfaceMockRecorder) DeleteInstancesAsync(ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs interface{}) *gomock.Call {
func (mr *MockInterfaceMockRecorder) DeleteInstancesAsync(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteInstancesAsync", reflect.TypeOf((*MockInterface)(nil).DeleteInstancesAsync), ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteInstancesAsync", reflect.TypeOf((*MockInterface)(nil).DeleteInstancesAsync), ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs)
}
// WaitForCreateOrUpdateResult mocks base method
func (m *MockInterface) WaitForCreateOrUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForCreateOrUpdateResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForCreateOrUpdateResult indicates an expected call of WaitForCreateOrUpdateResult
func (mr *MockInterfaceMockRecorder) WaitForCreateOrUpdateResult(ctx, future, resourceGroupName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForCreateOrUpdateResult", reflect.TypeOf((*MockInterface)(nil).WaitForCreateOrUpdateResult), ctx, future, resourceGroupName)
}
// WaitForDeleteInstancesResult mocks base method
func (m *MockInterface) WaitForDeleteInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForDeleteInstancesResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForDeleteInstancesResult indicates an expected call of WaitForDeleteInstancesResult
func (mr *MockInterfaceMockRecorder) WaitForDeleteInstancesResult(ctx, future, resourceGroupName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForDeleteInstancesResult", reflect.TypeOf((*MockInterface)(nil).WaitForDeleteInstancesResult), ctx, future, resourceGroupName)
}
// DeallocateInstancesAsync mocks base method
func (m *MockInterface) DeallocateInstancesAsync(ctx context.Context, resourceGroupName, VMScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error) {
func (m *MockInterface) DeallocateInstancesAsync(ctx context.Context, resourceGroupName, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeallocateInstancesAsync", ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs)
ret := m.ctrl.Call(m, "DeallocateInstancesAsync", ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs)
ret0, _ := ret[0].(*azure.Future)
ret1, _ := ret[1].(*retry.Error)
return ret0, ret1
}
// DeallocateInstancesAsync indicates an expected call of DeleteInstancesAsync
func (mr *MockInterfaceMockRecorder) DeallocateInstancesAsync(ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs interface{}) *gomock.Call {
// DeallocateInstancesAsync indicates an expected call of DeallocateInstancesAsync
func (mr *MockInterfaceMockRecorder) DeallocateInstancesAsync(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeallocateInstancesAsync", reflect.TypeOf((*MockInterface)(nil).DeallocateInstancesAsync), ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeallocateInstancesAsync", reflect.TypeOf((*MockInterface)(nil).DeallocateInstancesAsync), ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs)
}
// WaitForDeallocateInstancesResult mocks base method
func (m *MockInterface) WaitForDeallocateInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForDeallocateInstancesResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForDeallocateInstancesResult indicates an expected call of WaitForDeallocateInstancesResult
func (mr *MockInterfaceMockRecorder) WaitForDeallocateInstancesResult(ctx, future, resourceGroupName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForDeallocateInstancesResult", reflect.TypeOf((*MockInterface)(nil).WaitForDeallocateInstancesResult), ctx, future, resourceGroupName)
}
// StartInstancesAsync mocks base method
func (m *MockInterface) StartInstancesAsync(ctx context.Context, resourceGroupName, VMScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error) {
func (m *MockInterface) StartInstancesAsync(ctx context.Context, resourceGroupName, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StartInstancesAsync", ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs)
ret := m.ctrl.Call(m, "StartInstancesAsync", ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs)
ret0, _ := ret[0].(*azure.Future)
ret1, _ := ret[1].(*retry.Error)
return ret0, ret1
}
// StartInstancesAsync indicates an expected call of DeleteInstancesAsync
func (mr *MockInterfaceMockRecorder) StartInstancesAsync(ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs interface{}) *gomock.Call {
// StartInstancesAsync indicates an expected call of StartInstancesAsync
func (mr *MockInterfaceMockRecorder) StartInstancesAsync(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartInstancesAsync", reflect.TypeOf((*MockInterface)(nil).StartInstancesAsync), ctx, resourceGroupName, VMScaleSetName, vmInstanceIDs)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartInstancesAsync", reflect.TypeOf((*MockInterface)(nil).StartInstancesAsync), ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs)
}
// WaitForStartInstancesResult mocks base method
func (m *MockInterface) WaitForStartInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForStartInstancesResult", ctx, future, resourceGroupName)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// WaitForStartInstancesResult indicates an expected call of WaitForStartInstancesResult
func (mr *MockInterfaceMockRecorder) WaitForStartInstancesResult(ctx, future, resourceGroupName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForStartInstancesResult", reflect.TypeOf((*MockInterface)(nil).WaitForStartInstancesResult), ctx, future, resourceGroupName)
}

View File

@ -17,6 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -copyright_file=$BUILD_TAG_FILE -source=interface.go -destination=mockvmssvmclient/interface.go -package=mockvmssvmclient Interface
package vmssvmclient
import (
@ -32,8 +33,6 @@ const (
)
// Interface is the client interface for VirtualMachineScaleSetVM.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/interface.go -package=mockvmssvmclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/vmssvmclient/mockvmssvmclient/interface.go
type Interface interface {
// Get gets a VirtualMachineScaleSetVM.
Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand compute.InstanceViewTypes) (compute.VirtualMachineScaleSetVM, *retry.Error)

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2019 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,15 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mockvmssvmclient is a generated GoMock package.
package mockvmssvmclient
import (
context "context"
reflect "reflect"
compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
gomock "github.com/golang/mock/gomock"
retry "k8s.io/legacy-cloud-providers/azure/retry"
reflect "reflect"
)
// MockInterface is a mock of Interface interface

View File

@ -2,7 +2,7 @@
// +build !providerless
/*
Copyright 2020 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -17,11 +17,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: azure_vmsets.go
// Package mockvmsets is a generated GoMock package.
package mockvmsets
import (
reflect "reflect"
compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
gomock "github.com/golang/mock/gomock"
@ -29,32 +31,33 @@ import (
types "k8s.io/apimachinery/pkg/types"
cloudprovider "k8s.io/cloud-provider"
cache "k8s.io/legacy-cloud-providers/azure/cache"
reflect "reflect"
)
// MockVMSet is a mock of VMSet interface.
// MockVMSet is a mock of VMSet interface
type MockVMSet struct {
ctrl *gomock.Controller
recorder *MockVMSetMockRecorder
}
// MockVMSetMockRecorder is the mock recorder for MockVMSet.
// MockVMSetMockRecorder is the mock recorder for MockVMSet
type MockVMSetMockRecorder struct {
mock *MockVMSet
}
// NewMockVMSet creates a new mock instance.
// NewMockVMSet creates a new mock instance
func NewMockVMSet(ctrl *gomock.Controller) *MockVMSet {
mock := &MockVMSet{ctrl: ctrl}
mock.recorder = &MockVMSetMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockVMSet) EXPECT() *MockVMSetMockRecorder {
return m.recorder
}
// GetInstanceIDByNodeName mocks base method.
// GetInstanceIDByNodeName mocks base method
func (m *MockVMSet) GetInstanceIDByNodeName(name string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetInstanceIDByNodeName", name)
@ -63,13 +66,13 @@ func (m *MockVMSet) GetInstanceIDByNodeName(name string) (string, error) {
return ret0, ret1
}
// GetInstanceIDByNodeName indicates an expected call of GetInstanceIDByNodeName.
// GetInstanceIDByNodeName indicates an expected call of GetInstanceIDByNodeName
func (mr *MockVMSetMockRecorder) GetInstanceIDByNodeName(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInstanceIDByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetInstanceIDByNodeName), name)
}
// GetInstanceTypeByNodeName mocks base method.
// GetInstanceTypeByNodeName mocks base method
func (m *MockVMSet) GetInstanceTypeByNodeName(name string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetInstanceTypeByNodeName", name)
@ -78,13 +81,13 @@ func (m *MockVMSet) GetInstanceTypeByNodeName(name string) (string, error) {
return ret0, ret1
}
// GetInstanceTypeByNodeName indicates an expected call of GetInstanceTypeByNodeName.
// GetInstanceTypeByNodeName indicates an expected call of GetInstanceTypeByNodeName
func (mr *MockVMSetMockRecorder) GetInstanceTypeByNodeName(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInstanceTypeByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetInstanceTypeByNodeName), name)
}
// GetIPByNodeName mocks base method.
// GetIPByNodeName mocks base method
func (m *MockVMSet) GetIPByNodeName(name string) (string, string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetIPByNodeName", name)
@ -94,13 +97,13 @@ func (m *MockVMSet) GetIPByNodeName(name string) (string, string, error) {
return ret0, ret1, ret2
}
// GetIPByNodeName indicates an expected call of GetIPByNodeName.
// GetIPByNodeName indicates an expected call of GetIPByNodeName
func (mr *MockVMSetMockRecorder) GetIPByNodeName(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIPByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetIPByNodeName), name)
}
// GetPrimaryInterface mocks base method.
// GetPrimaryInterface mocks base method
func (m *MockVMSet) GetPrimaryInterface(nodeName string) (network.Interface, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPrimaryInterface", nodeName)
@ -109,13 +112,13 @@ func (m *MockVMSet) GetPrimaryInterface(nodeName string) (network.Interface, err
return ret0, ret1
}
// GetPrimaryInterface indicates an expected call of GetPrimaryInterface.
// GetPrimaryInterface indicates an expected call of GetPrimaryInterface
func (mr *MockVMSetMockRecorder) GetPrimaryInterface(nodeName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrimaryInterface", reflect.TypeOf((*MockVMSet)(nil).GetPrimaryInterface), nodeName)
}
// GetNodeNameByProviderID mocks base method.
// GetNodeNameByProviderID mocks base method
func (m *MockVMSet) GetNodeNameByProviderID(providerID string) (types.NodeName, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetNodeNameByProviderID", providerID)
@ -124,13 +127,13 @@ func (m *MockVMSet) GetNodeNameByProviderID(providerID string) (types.NodeName,
return ret0, ret1
}
// GetNodeNameByProviderID indicates an expected call of GetNodeNameByProviderID.
// GetNodeNameByProviderID indicates an expected call of GetNodeNameByProviderID
func (mr *MockVMSetMockRecorder) GetNodeNameByProviderID(providerID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNodeNameByProviderID", reflect.TypeOf((*MockVMSet)(nil).GetNodeNameByProviderID), providerID)
}
// GetZoneByNodeName mocks base method.
// GetZoneByNodeName mocks base method
func (m *MockVMSet) GetZoneByNodeName(name string) (cloudprovider.Zone, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetZoneByNodeName", name)
@ -139,13 +142,13 @@ func (m *MockVMSet) GetZoneByNodeName(name string) (cloudprovider.Zone, error) {
return ret0, ret1
}
// GetZoneByNodeName indicates an expected call of GetZoneByNodeName.
// GetZoneByNodeName indicates an expected call of GetZoneByNodeName
func (mr *MockVMSetMockRecorder) GetZoneByNodeName(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetZoneByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetZoneByNodeName), name)
}
// GetPrimaryVMSetName mocks base method.
// GetPrimaryVMSetName mocks base method
func (m *MockVMSet) GetPrimaryVMSetName() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPrimaryVMSetName")
@ -153,13 +156,13 @@ func (m *MockVMSet) GetPrimaryVMSetName() string {
return ret0
}
// GetPrimaryVMSetName indicates an expected call of GetPrimaryVMSetName.
// GetPrimaryVMSetName indicates an expected call of GetPrimaryVMSetName
func (mr *MockVMSetMockRecorder) GetPrimaryVMSetName() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrimaryVMSetName", reflect.TypeOf((*MockVMSet)(nil).GetPrimaryVMSetName))
}
// GetVMSetNames mocks base method.
// GetVMSetNames mocks base method
func (m *MockVMSet) GetVMSetNames(service *v1.Service, nodes []*v1.Node) (*[]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetVMSetNames", service, nodes)
@ -168,13 +171,13 @@ func (m *MockVMSet) GetVMSetNames(service *v1.Service, nodes []*v1.Node) (*[]str
return ret0, ret1
}
// GetVMSetNames indicates an expected call of GetVMSetNames.
// GetVMSetNames indicates an expected call of GetVMSetNames
func (mr *MockVMSetMockRecorder) GetVMSetNames(service, nodes interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVMSetNames", reflect.TypeOf((*MockVMSet)(nil).GetVMSetNames), service, nodes)
}
// EnsureHostsInPool mocks base method.
// EnsureHostsInPool mocks base method
func (m *MockVMSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName string, isInternal bool) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "EnsureHostsInPool", service, nodes, backendPoolID, vmSetName, isInternal)
@ -182,13 +185,13 @@ func (m *MockVMSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac
return ret0
}
// EnsureHostsInPool indicates an expected call of EnsureHostsInPool.
// EnsureHostsInPool indicates an expected call of EnsureHostsInPool
func (mr *MockVMSetMockRecorder) EnsureHostsInPool(service, nodes, backendPoolID, vmSetName, isInternal interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureHostsInPool", reflect.TypeOf((*MockVMSet)(nil).EnsureHostsInPool), service, nodes, backendPoolID, vmSetName, isInternal)
}
// EnsureHostInPool mocks base method.
// EnsureHostInPool mocks base method
func (m *MockVMSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID, vmSetName string, isInternal bool) (string, string, string, *compute.VirtualMachineScaleSetVM, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "EnsureHostInPool", service, nodeName, backendPoolID, vmSetName, isInternal)
@ -200,13 +203,13 @@ func (m *MockVMSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam
return ret0, ret1, ret2, ret3, ret4
}
// EnsureHostInPool indicates an expected call of EnsureHostInPool.
// EnsureHostInPool indicates an expected call of EnsureHostInPool
func (mr *MockVMSetMockRecorder) EnsureHostInPool(service, nodeName, backendPoolID, vmSetName, isInternal interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureHostInPool", reflect.TypeOf((*MockVMSet)(nil).EnsureHostInPool), service, nodeName, backendPoolID, vmSetName, isInternal)
}
// EnsureBackendPoolDeleted mocks base method.
// EnsureBackendPoolDeleted mocks base method
func (m *MockVMSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "EnsureBackendPoolDeleted", service, backendPoolID, vmSetName, backendAddressPools)
@ -214,13 +217,13 @@ func (m *MockVMSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
return ret0
}
// EnsureBackendPoolDeleted indicates an expected call of EnsureBackendPoolDeleted.
// EnsureBackendPoolDeleted indicates an expected call of EnsureBackendPoolDeleted
func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeleted(service, backendPoolID, vmSetName, backendAddressPools interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureBackendPoolDeleted", reflect.TypeOf((*MockVMSet)(nil).EnsureBackendPoolDeleted), service, backendPoolID, vmSetName, backendAddressPools)
}
// AttachDisk mocks base method.
// AttachDisk mocks base method
func (m *MockVMSet) AttachDisk(isManagedDisk bool, diskName, diskURI string, nodeName types.NodeName, lun int32, cachingMode compute.CachingTypes, diskEncryptionSetID string, writeAcceleratorEnabled bool) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AttachDisk", isManagedDisk, diskName, diskURI, nodeName, lun, cachingMode, diskEncryptionSetID, writeAcceleratorEnabled)
@ -228,13 +231,13 @@ func (m *MockVMSet) AttachDisk(isManagedDisk bool, diskName, diskURI string, nod
return ret0
}
// AttachDisk indicates an expected call of AttachDisk.
// AttachDisk indicates an expected call of AttachDisk
func (mr *MockVMSetMockRecorder) AttachDisk(isManagedDisk, diskName, diskURI, nodeName, lun, cachingMode, diskEncryptionSetID, writeAcceleratorEnabled interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttachDisk", reflect.TypeOf((*MockVMSet)(nil).AttachDisk), isManagedDisk, diskName, diskURI, nodeName, lun, cachingMode, diskEncryptionSetID, writeAcceleratorEnabled)
}
// DetachDisk mocks base method.
// DetachDisk mocks base method
func (m *MockVMSet) DetachDisk(diskName, diskURI string, nodeName types.NodeName) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DetachDisk", diskName, diskURI, nodeName)
@ -242,13 +245,13 @@ func (m *MockVMSet) DetachDisk(diskName, diskURI string, nodeName types.NodeName
return ret0
}
// DetachDisk indicates an expected call of DetachDisk.
// DetachDisk indicates an expected call of DetachDisk
func (mr *MockVMSetMockRecorder) DetachDisk(diskName, diskURI, nodeName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DetachDisk", reflect.TypeOf((*MockVMSet)(nil).DetachDisk), diskName, diskURI, nodeName)
}
// GetDataDisks mocks base method.
// GetDataDisks mocks base method
func (m *MockVMSet) GetDataDisks(nodeName types.NodeName, crt cache.AzureCacheReadType) ([]compute.DataDisk, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetDataDisks", nodeName, crt)
@ -257,13 +260,13 @@ func (m *MockVMSet) GetDataDisks(nodeName types.NodeName, crt cache.AzureCacheRe
return ret0, ret1
}
// GetDataDisks indicates an expected call of GetDataDisks.
// GetDataDisks indicates an expected call of GetDataDisks
func (mr *MockVMSetMockRecorder) GetDataDisks(nodeName, crt interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDataDisks", reflect.TypeOf((*MockVMSet)(nil).GetDataDisks), nodeName, crt)
}
// GetPowerStatusByNodeName mocks base method.
// GetPowerStatusByNodeName mocks base method
func (m *MockVMSet) GetPowerStatusByNodeName(name string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPowerStatusByNodeName", name)
@ -272,13 +275,13 @@ func (m *MockVMSet) GetPowerStatusByNodeName(name string) (string, error) {
return ret0, ret1
}
// GetPowerStatusByNodeName indicates an expected call of GetPowerStatusByNodeName.
// GetPowerStatusByNodeName indicates an expected call of GetPowerStatusByNodeName
func (mr *MockVMSetMockRecorder) GetPowerStatusByNodeName(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPowerStatusByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetPowerStatusByNodeName), name)
}
// GetProvisioningStateByNodeName mocks base method.
// GetProvisioningStateByNodeName mocks base method
func (m *MockVMSet) GetProvisioningStateByNodeName(name string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetProvisioningStateByNodeName", name)
@ -287,13 +290,13 @@ func (m *MockVMSet) GetProvisioningStateByNodeName(name string) (string, error)
return ret0, ret1
}
// GetProvisioningStateByNodeName indicates an expected call of GetProvisioningStateByNodeName.
// GetProvisioningStateByNodeName indicates an expected call of GetProvisioningStateByNodeName
func (mr *MockVMSetMockRecorder) GetProvisioningStateByNodeName(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProvisioningStateByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetProvisioningStateByNodeName), name)
}
// GetPrivateIPsByNodeName mocks base method.
// GetPrivateIPsByNodeName mocks base method
func (m *MockVMSet) GetPrivateIPsByNodeName(name string) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPrivateIPsByNodeName", name)
@ -302,13 +305,13 @@ func (m *MockVMSet) GetPrivateIPsByNodeName(name string) ([]string, error) {
return ret0, ret1
}
// GetPrivateIPsByNodeName indicates an expected call of GetPrivateIPsByNodeName.
// GetPrivateIPsByNodeName indicates an expected call of GetPrivateIPsByNodeName
func (mr *MockVMSetMockRecorder) GetPrivateIPsByNodeName(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrivateIPsByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetPrivateIPsByNodeName), name)
}
// GetNodeNameByIPConfigurationID mocks base method.
// GetNodeNameByIPConfigurationID mocks base method
func (m *MockVMSet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetNodeNameByIPConfigurationID", ipConfigurationID)
@ -318,7 +321,7 @@ func (m *MockVMSet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (st
return ret0, ret1, ret2
}
// GetNodeNameByIPConfigurationID indicates an expected call of GetNodeNameByIPConfigurationID.
// GetNodeNameByIPConfigurationID indicates an expected call of GetNodeNameByIPConfigurationID
func (mr *MockVMSetMockRecorder) GetNodeNameByIPConfigurationID(ipConfigurationID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNodeNameByIPConfigurationID", reflect.TypeOf((*MockVMSet)(nil).GetNodeNameByIPConfigurationID), ipConfigurationID)

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
//go:generate mockgen -package=driver -destination=driver.mock.go github.com/container-storage-interface/spec/lib/go/csi IdentityServer,ControllerServer,NodeServer
//go:generate mockgen -package=driver -destination=driver.mock.go -build_flags=-mod=mod github.com/container-storage-interface/spec/lib/go/csi IdentityServer,ControllerServer,NodeServer
package driver

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes Authors.
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -14,16 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package driver is a generated GoMock package, with required copyright
// header added manually.
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/container-storage-interface/spec/lib/go/csi (interfaces: IdentityServer,ControllerServer,NodeServer)
// Package driver is a generated GoMock package.
package driver
import (
context "context"
reflect "reflect"
csi "github.com/container-storage-interface/spec/lib/go/csi"
gomock "github.com/golang/mock/gomock"
reflect "reflect"
)
// MockIdentityServer is a mock of IdentityServer interface
@ -51,6 +52,7 @@ func (m *MockIdentityServer) EXPECT() *MockIdentityServerMockRecorder {
// GetPluginCapabilities mocks base method
func (m *MockIdentityServer) GetPluginCapabilities(arg0 context.Context, arg1 *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPluginCapabilities", arg0, arg1)
ret0, _ := ret[0].(*csi.GetPluginCapabilitiesResponse)
ret1, _ := ret[1].(error)
@ -59,11 +61,13 @@ func (m *MockIdentityServer) GetPluginCapabilities(arg0 context.Context, arg1 *c
// GetPluginCapabilities indicates an expected call of GetPluginCapabilities
func (mr *MockIdentityServerMockRecorder) GetPluginCapabilities(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPluginCapabilities", reflect.TypeOf((*MockIdentityServer)(nil).GetPluginCapabilities), arg0, arg1)
}
// GetPluginInfo mocks base method
func (m *MockIdentityServer) GetPluginInfo(arg0 context.Context, arg1 *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPluginInfo", arg0, arg1)
ret0, _ := ret[0].(*csi.GetPluginInfoResponse)
ret1, _ := ret[1].(error)
@ -72,11 +76,13 @@ func (m *MockIdentityServer) GetPluginInfo(arg0 context.Context, arg1 *csi.GetPl
// GetPluginInfo indicates an expected call of GetPluginInfo
func (mr *MockIdentityServerMockRecorder) GetPluginInfo(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPluginInfo", reflect.TypeOf((*MockIdentityServer)(nil).GetPluginInfo), arg0, arg1)
}
// Probe mocks base method
func (m *MockIdentityServer) Probe(arg0 context.Context, arg1 *csi.ProbeRequest) (*csi.ProbeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Probe", arg0, arg1)
ret0, _ := ret[0].(*csi.ProbeResponse)
ret1, _ := ret[1].(error)
@ -85,6 +91,7 @@ func (m *MockIdentityServer) Probe(arg0 context.Context, arg1 *csi.ProbeRequest)
// Probe indicates an expected call of Probe
func (mr *MockIdentityServerMockRecorder) Probe(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Probe", reflect.TypeOf((*MockIdentityServer)(nil).Probe), arg0, arg1)
}
@ -113,6 +120,7 @@ func (m *MockControllerServer) EXPECT() *MockControllerServerMockRecorder {
// ControllerExpandVolume mocks base method
func (m *MockControllerServer) ControllerExpandVolume(arg0 context.Context, arg1 *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ControllerExpandVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerExpandVolumeResponse)
ret1, _ := ret[1].(error)
@ -121,11 +129,13 @@ func (m *MockControllerServer) ControllerExpandVolume(arg0 context.Context, arg1
// ControllerExpandVolume indicates an expected call of ControllerExpandVolume
func (mr *MockControllerServerMockRecorder) ControllerExpandVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerExpandVolume", reflect.TypeOf((*MockControllerServer)(nil).ControllerExpandVolume), arg0, arg1)
}
// ControllerGetCapabilities mocks base method
func (m *MockControllerServer) ControllerGetCapabilities(arg0 context.Context, arg1 *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ControllerGetCapabilities", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerGetCapabilitiesResponse)
ret1, _ := ret[1].(error)
@ -134,122 +144,13 @@ func (m *MockControllerServer) ControllerGetCapabilities(arg0 context.Context, a
// ControllerGetCapabilities indicates an expected call of ControllerGetCapabilities
func (mr *MockControllerServerMockRecorder) ControllerGetCapabilities(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerGetCapabilities", reflect.TypeOf((*MockControllerServer)(nil).ControllerGetCapabilities), arg0, arg1)
}
// ControllerPublishVolume mocks base method
func (m *MockControllerServer) ControllerPublishVolume(arg0 context.Context, arg1 *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) {
ret := m.ctrl.Call(m, "ControllerPublishVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerPublishVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ControllerPublishVolume indicates an expected call of ControllerPublishVolume
func (mr *MockControllerServerMockRecorder) ControllerPublishVolume(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerPublishVolume", reflect.TypeOf((*MockControllerServer)(nil).ControllerPublishVolume), arg0, arg1)
}
// ControllerUnpublishVolume mocks base method
func (m *MockControllerServer) ControllerUnpublishVolume(arg0 context.Context, arg1 *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) {
ret := m.ctrl.Call(m, "ControllerUnpublishVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerUnpublishVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ControllerUnpublishVolume indicates an expected call of ControllerUnpublishVolume
func (mr *MockControllerServerMockRecorder) ControllerUnpublishVolume(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerUnpublishVolume", reflect.TypeOf((*MockControllerServer)(nil).ControllerUnpublishVolume), arg0, arg1)
}
// CreateSnapshot mocks base method
func (m *MockControllerServer) CreateSnapshot(arg0 context.Context, arg1 *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
ret := m.ctrl.Call(m, "CreateSnapshot", arg0, arg1)
ret0, _ := ret[0].(*csi.CreateSnapshotResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateSnapshot indicates an expected call of CreateSnapshot
func (mr *MockControllerServerMockRecorder) CreateSnapshot(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSnapshot", reflect.TypeOf((*MockControllerServer)(nil).CreateSnapshot), arg0, arg1)
}
// CreateVolume mocks base method
func (m *MockControllerServer) CreateVolume(arg0 context.Context, arg1 *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
ret := m.ctrl.Call(m, "CreateVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.CreateVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateVolume indicates an expected call of CreateVolume
func (mr *MockControllerServerMockRecorder) CreateVolume(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVolume", reflect.TypeOf((*MockControllerServer)(nil).CreateVolume), arg0, arg1)
}
// DeleteSnapshot mocks base method
func (m *MockControllerServer) DeleteSnapshot(arg0 context.Context, arg1 *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
ret := m.ctrl.Call(m, "DeleteSnapshot", arg0, arg1)
ret0, _ := ret[0].(*csi.DeleteSnapshotResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteSnapshot indicates an expected call of DeleteSnapshot
func (mr *MockControllerServerMockRecorder) DeleteSnapshot(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSnapshot", reflect.TypeOf((*MockControllerServer)(nil).DeleteSnapshot), arg0, arg1)
}
// DeleteVolume mocks base method
func (m *MockControllerServer) DeleteVolume(arg0 context.Context, arg1 *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) {
ret := m.ctrl.Call(m, "DeleteVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.DeleteVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteVolume indicates an expected call of DeleteVolume
func (mr *MockControllerServerMockRecorder) DeleteVolume(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVolume", reflect.TypeOf((*MockControllerServer)(nil).DeleteVolume), arg0, arg1)
}
// GetCapacity mocks base method
func (m *MockControllerServer) GetCapacity(arg0 context.Context, arg1 *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) {
ret := m.ctrl.Call(m, "GetCapacity", arg0, arg1)
ret0, _ := ret[0].(*csi.GetCapacityResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetCapacity indicates an expected call of GetCapacity
func (mr *MockControllerServerMockRecorder) GetCapacity(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCapacity", reflect.TypeOf((*MockControllerServer)(nil).GetCapacity), arg0, arg1)
}
// ListSnapshots mocks base method
func (m *MockControllerServer) ListSnapshots(arg0 context.Context, arg1 *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
ret := m.ctrl.Call(m, "ListSnapshots", arg0, arg1)
ret0, _ := ret[0].(*csi.ListSnapshotsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListSnapshots indicates an expected call of ListSnapshots
func (mr *MockControllerServerMockRecorder) ListSnapshots(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSnapshots", reflect.TypeOf((*MockControllerServer)(nil).ListSnapshots), arg0, arg1)
}
// ListVolumes mocks base method
func (m *MockControllerServer) ListVolumes(arg0 context.Context, arg1 *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
ret := m.ctrl.Call(m, "ListVolumes", arg0, arg1)
ret0, _ := ret[0].(*csi.ListVolumesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ControllerGetVolume mocks base method
func (m *MockControllerServer) ControllerGetVolume(arg0 context.Context, arg1 *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ControllerGetVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerGetVolumeResponse)
ret1, _ := ret[1].(error)
@ -258,16 +159,148 @@ func (m *MockControllerServer) ControllerGetVolume(arg0 context.Context, arg1 *c
// ControllerGetVolume indicates an expected call of ControllerGetVolume
func (mr *MockControllerServerMockRecorder) ControllerGetVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerGetVolume", reflect.TypeOf((*MockControllerServer)(nil).ControllerGetVolume), arg0, arg1)
}
// ControllerPublishVolume mocks base method
func (m *MockControllerServer) ControllerPublishVolume(arg0 context.Context, arg1 *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ControllerPublishVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerPublishVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ControllerPublishVolume indicates an expected call of ControllerPublishVolume
func (mr *MockControllerServerMockRecorder) ControllerPublishVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerPublishVolume", reflect.TypeOf((*MockControllerServer)(nil).ControllerPublishVolume), arg0, arg1)
}
// ControllerUnpublishVolume mocks base method
func (m *MockControllerServer) ControllerUnpublishVolume(arg0 context.Context, arg1 *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ControllerUnpublishVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerUnpublishVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ControllerUnpublishVolume indicates an expected call of ControllerUnpublishVolume
func (mr *MockControllerServerMockRecorder) ControllerUnpublishVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerUnpublishVolume", reflect.TypeOf((*MockControllerServer)(nil).ControllerUnpublishVolume), arg0, arg1)
}
// CreateSnapshot mocks base method
func (m *MockControllerServer) CreateSnapshot(arg0 context.Context, arg1 *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateSnapshot", arg0, arg1)
ret0, _ := ret[0].(*csi.CreateSnapshotResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateSnapshot indicates an expected call of CreateSnapshot
func (mr *MockControllerServerMockRecorder) CreateSnapshot(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSnapshot", reflect.TypeOf((*MockControllerServer)(nil).CreateSnapshot), arg0, arg1)
}
// CreateVolume mocks base method
func (m *MockControllerServer) CreateVolume(arg0 context.Context, arg1 *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.CreateVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateVolume indicates an expected call of CreateVolume
func (mr *MockControllerServerMockRecorder) CreateVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVolume", reflect.TypeOf((*MockControllerServer)(nil).CreateVolume), arg0, arg1)
}
// DeleteSnapshot mocks base method
func (m *MockControllerServer) DeleteSnapshot(arg0 context.Context, arg1 *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteSnapshot", arg0, arg1)
ret0, _ := ret[0].(*csi.DeleteSnapshotResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteSnapshot indicates an expected call of DeleteSnapshot
func (mr *MockControllerServerMockRecorder) DeleteSnapshot(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSnapshot", reflect.TypeOf((*MockControllerServer)(nil).DeleteSnapshot), arg0, arg1)
}
// DeleteVolume mocks base method
func (m *MockControllerServer) DeleteVolume(arg0 context.Context, arg1 *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.DeleteVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteVolume indicates an expected call of DeleteVolume
func (mr *MockControllerServerMockRecorder) DeleteVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVolume", reflect.TypeOf((*MockControllerServer)(nil).DeleteVolume), arg0, arg1)
}
// GetCapacity mocks base method
func (m *MockControllerServer) GetCapacity(arg0 context.Context, arg1 *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetCapacity", arg0, arg1)
ret0, _ := ret[0].(*csi.GetCapacityResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetCapacity indicates an expected call of GetCapacity
func (mr *MockControllerServerMockRecorder) GetCapacity(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCapacity", reflect.TypeOf((*MockControllerServer)(nil).GetCapacity), arg0, arg1)
}
// ListSnapshots mocks base method
func (m *MockControllerServer) ListSnapshots(arg0 context.Context, arg1 *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListSnapshots", arg0, arg1)
ret0, _ := ret[0].(*csi.ListSnapshotsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListSnapshots indicates an expected call of ListSnapshots
func (mr *MockControllerServerMockRecorder) ListSnapshots(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSnapshots", reflect.TypeOf((*MockControllerServer)(nil).ListSnapshots), arg0, arg1)
}
// ListVolumes mocks base method
func (m *MockControllerServer) ListVolumes(arg0 context.Context, arg1 *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListVolumes", arg0, arg1)
ret0, _ := ret[0].(*csi.ListVolumesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListVolumes indicates an expected call of ListVolumes
func (mr *MockControllerServerMockRecorder) ListVolumes(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListVolumes", reflect.TypeOf((*MockControllerServer)(nil).ListVolumes), arg0, arg1)
}
// ValidateVolumeCapabilities mocks base method
func (m *MockControllerServer) ValidateVolumeCapabilities(arg0 context.Context, arg1 *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ValidateVolumeCapabilities", arg0, arg1)
ret0, _ := ret[0].(*csi.ValidateVolumeCapabilitiesResponse)
ret1, _ := ret[1].(error)
@ -276,6 +309,7 @@ func (m *MockControllerServer) ValidateVolumeCapabilities(arg0 context.Context,
// ValidateVolumeCapabilities indicates an expected call of ValidateVolumeCapabilities
func (mr *MockControllerServerMockRecorder) ValidateVolumeCapabilities(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateVolumeCapabilities", reflect.TypeOf((*MockControllerServer)(nil).ValidateVolumeCapabilities), arg0, arg1)
}
@ -304,6 +338,7 @@ func (m *MockNodeServer) EXPECT() *MockNodeServerMockRecorder {
// NodeExpandVolume mocks base method
func (m *MockNodeServer) NodeExpandVolume(arg0 context.Context, arg1 *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodeExpandVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.NodeExpandVolumeResponse)
ret1, _ := ret[1].(error)
@ -312,11 +347,13 @@ func (m *MockNodeServer) NodeExpandVolume(arg0 context.Context, arg1 *csi.NodeEx
// NodeExpandVolume indicates an expected call of NodeExpandVolume
func (mr *MockNodeServerMockRecorder) NodeExpandVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeExpandVolume", reflect.TypeOf((*MockNodeServer)(nil).NodeExpandVolume), arg0, arg1)
}
// NodeGetCapabilities mocks base method
func (m *MockNodeServer) NodeGetCapabilities(arg0 context.Context, arg1 *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodeGetCapabilities", arg0, arg1)
ret0, _ := ret[0].(*csi.NodeGetCapabilitiesResponse)
ret1, _ := ret[1].(error)
@ -325,11 +362,13 @@ func (m *MockNodeServer) NodeGetCapabilities(arg0 context.Context, arg1 *csi.Nod
// NodeGetCapabilities indicates an expected call of NodeGetCapabilities
func (mr *MockNodeServerMockRecorder) NodeGetCapabilities(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeGetCapabilities", reflect.TypeOf((*MockNodeServer)(nil).NodeGetCapabilities), arg0, arg1)
}
// NodeGetInfo mocks base method
func (m *MockNodeServer) NodeGetInfo(arg0 context.Context, arg1 *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodeGetInfo", arg0, arg1)
ret0, _ := ret[0].(*csi.NodeGetInfoResponse)
ret1, _ := ret[1].(error)
@ -338,11 +377,13 @@ func (m *MockNodeServer) NodeGetInfo(arg0 context.Context, arg1 *csi.NodeGetInfo
// NodeGetInfo indicates an expected call of NodeGetInfo
func (mr *MockNodeServerMockRecorder) NodeGetInfo(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeGetInfo", reflect.TypeOf((*MockNodeServer)(nil).NodeGetInfo), arg0, arg1)
}
// NodeGetVolumeStats mocks base method
func (m *MockNodeServer) NodeGetVolumeStats(arg0 context.Context, arg1 *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodeGetVolumeStats", arg0, arg1)
ret0, _ := ret[0].(*csi.NodeGetVolumeStatsResponse)
ret1, _ := ret[1].(error)
@ -351,11 +392,13 @@ func (m *MockNodeServer) NodeGetVolumeStats(arg0 context.Context, arg1 *csi.Node
// NodeGetVolumeStats indicates an expected call of NodeGetVolumeStats
func (mr *MockNodeServerMockRecorder) NodeGetVolumeStats(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeGetVolumeStats", reflect.TypeOf((*MockNodeServer)(nil).NodeGetVolumeStats), arg0, arg1)
}
// NodePublishVolume mocks base method
func (m *MockNodeServer) NodePublishVolume(arg0 context.Context, arg1 *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodePublishVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.NodePublishVolumeResponse)
ret1, _ := ret[1].(error)
@ -364,11 +407,13 @@ func (m *MockNodeServer) NodePublishVolume(arg0 context.Context, arg1 *csi.NodeP
// NodePublishVolume indicates an expected call of NodePublishVolume
func (mr *MockNodeServerMockRecorder) NodePublishVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodePublishVolume", reflect.TypeOf((*MockNodeServer)(nil).NodePublishVolume), arg0, arg1)
}
// NodeStageVolume mocks base method
func (m *MockNodeServer) NodeStageVolume(arg0 context.Context, arg1 *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodeStageVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.NodeStageVolumeResponse)
ret1, _ := ret[1].(error)
@ -377,11 +422,13 @@ func (m *MockNodeServer) NodeStageVolume(arg0 context.Context, arg1 *csi.NodeSta
// NodeStageVolume indicates an expected call of NodeStageVolume
func (mr *MockNodeServerMockRecorder) NodeStageVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeStageVolume", reflect.TypeOf((*MockNodeServer)(nil).NodeStageVolume), arg0, arg1)
}
// NodeUnpublishVolume mocks base method
func (m *MockNodeServer) NodeUnpublishVolume(arg0 context.Context, arg1 *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodeUnpublishVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.NodeUnpublishVolumeResponse)
ret1, _ := ret[1].(error)
@ -390,11 +437,13 @@ func (m *MockNodeServer) NodeUnpublishVolume(arg0 context.Context, arg1 *csi.Nod
// NodeUnpublishVolume indicates an expected call of NodeUnpublishVolume
func (mr *MockNodeServerMockRecorder) NodeUnpublishVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeUnpublishVolume", reflect.TypeOf((*MockNodeServer)(nil).NodeUnpublishVolume), arg0, arg1)
}
// NodeUnstageVolume mocks base method
func (m *MockNodeServer) NodeUnstageVolume(arg0 context.Context, arg1 *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NodeUnstageVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.NodeUnstageVolumeResponse)
ret1, _ := ret[1].(error)
@ -403,5 +452,6 @@ func (m *MockNodeServer) NodeUnstageVolume(arg0 context.Context, arg1 *csi.NodeU
// NodeUnstageVolume indicates an expected call of NodeUnstageVolume
func (mr *MockNodeServerMockRecorder) NodeUnstageVolume(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeUnstageVolume", reflect.TypeOf((*MockNodeServer)(nil).NodeUnstageVolume), arg0, arg1)
}