Bump to mockery v3

mockery has introduced breaking changes and switched to a v3 branch,
this migrates to that, mostly using the built-in migration tool. Mocks
are now generated in single files per package, except in packages
containing mocks for multiple interface packages (in
pkg/kubelet/container/testing).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:
Stephen Kitt 2025-06-19 17:53:15 +02:00
parent 8c1094d54a
commit 81cec6df1d
No known key found for this signature in database
GPG key ID: 1CC5FA453662A71D
44 changed files with 8599 additions and 7964 deletions

View file

@ -6,7 +6,7 @@ godebug default=go1.24
require (
go.uber.org/automaxprocs v1.6.0
golang.org/x/mod v0.24.0
golang.org/x/mod v0.27.0
k8s.io/publishing-bot v0.5.0
)
@ -14,48 +14,53 @@ require (
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/aojea/sloppy-netparser v0.0.0-20210819225411-1b3bd8b3b975 // indirect
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/brunoga/deep v1.2.4 // indirect
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c // indirect
github.com/chigopher/pathlib v0.19.1 // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golangci/misspell v0.6.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jcchavezs/porto v0.6.0 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jedib0t/go-pretty/v6 v6.6.7 // indirect
github.com/knadh/koanf/maps v0.1.2 // indirect
github.com/knadh/koanf/parsers/yaml v0.1.0 // indirect
github.com/knadh/koanf/providers/env v1.0.0 // indirect
github.com/knadh/koanf/providers/file v1.1.2 // indirect
github.com/knadh/koanf/providers/posflag v0.1.0 // indirect
github.com/knadh/koanf/providers/structs v0.1.0 // indirect
github.com/knadh/koanf/v2 v2.2.1 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.14.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/cobra v1.9.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/spf13/viper v1.20.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/vektra/mockery/v2 v2.53.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
github.com/vektra/mockery/v3 v3.5.4 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.yaml.in/yaml/v3 v3.0.3 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/tools v0.32.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/tools v0.36.0 // indirect
golang.org/x/tools/go/expect v0.1.1-deprecated // indirect
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 // indirect
google.golang.org/protobuf v1.36.4 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/gotestsum v1.12.0 // indirect
@ -68,7 +73,7 @@ tool (
github.com/cespare/prettybench
github.com/golangci/misspell
github.com/jcchavezs/porto/cmd/porto
github.com/vektra/mockery/v2
github.com/vektra/mockery/v3
go.uber.org/automaxprocs
golang.org/x/mod/modfile
golang.org/x/tools/cmd/goimports

View file

@ -4,10 +4,10 @@ github.com/aojea/sloppy-netparser v0.0.0-20210819225411-1b3bd8b3b975 h1:3bpBhtHN
github.com/aojea/sloppy-netparser v0.0.0-20210819225411-1b3bd8b3b975/go.mod h1:VP81Qd6FKAazakPswOou8ULXGU/j5QH0VcGPzehHx3s=
github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE=
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
github.com/brunoga/deep v1.2.4 h1:Aj9E9oUbE+ccbyh35VC/NHlzzjfIVU69BXu2mt2LmL8=
github.com/brunoga/deep v1.2.4/go.mod h1:GDV6dnXqn80ezsLSZ5Wlv1PdKAWAO4L5PnKYtv2dgaI=
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c h1:p8i+qCbr/dNhS2FoQhRpSS7X5+IlxTa94nRNYXu4fyo=
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A=
github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -20,14 +20,14 @@ github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBD
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk=
github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY=
github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
@ -39,21 +39,30 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jcchavezs/porto v0.6.0 h1:AgQLGwsXaxDkPj4Y+paFkVGLAR4n/1RRF0xV5UKinwg=
github.com/jcchavezs/porto v0.6.0/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/jedib0t/go-pretty/v6 v6.6.7 h1:m+LbHpm0aIAPLzLbMfn8dc3Ht8MW7lsSO4MPItz/Uuo=
github.com/jedib0t/go-pretty/v6 v6.6.7/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
github.com/knadh/koanf/maps v0.1.2 h1:RBfmAW5CnZT+PJ1CVc1QSJKf4Xu9kxfQgYVQSu8hpbo=
github.com/knadh/koanf/maps v0.1.2/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
github.com/knadh/koanf/parsers/yaml v0.1.0 h1:ZZ8/iGfRLvKSaMEECEBPM1HQslrZADk8fP1XFUxVI5w=
github.com/knadh/koanf/parsers/yaml v0.1.0/go.mod h1:cvbUDC7AL23pImuQP0oRw/hPuccrNBS2bps8asS0CwY=
github.com/knadh/koanf/providers/env v1.0.0 h1:ufePaI9BnWH+ajuxGGiJ8pdTG0uLEUWC7/HDDPGLah0=
github.com/knadh/koanf/providers/env v1.0.0/go.mod h1:mzFyRZueYhb37oPmC1HAv/oGEEuyvJDA98r3XAa8Gak=
github.com/knadh/koanf/providers/file v1.1.2 h1:aCC36YGOgV5lTtAFz2qkgtWdeQsgfxUkxDOe+2nQY3w=
github.com/knadh/koanf/providers/file v1.1.2/go.mod h1:/faSBcv2mxPVjFrXck95qeoyoZ5myJ6uxN8OOVNJJCI=
github.com/knadh/koanf/providers/posflag v0.1.0 h1:mKJlLrKPcAP7Ootf4pBZWJ6J+4wHYujwipe7Ie3qW6U=
github.com/knadh/koanf/providers/posflag v0.1.0/go.mod h1:SYg03v/t8ISBNrMBRMlojH8OsKowbkXV7giIbBVgbz0=
github.com/knadh/koanf/providers/structs v0.1.0 h1:wJRteCNn1qvLtE5h8KQBvLJovidSdntfdyIbbCzEyE0=
github.com/knadh/koanf/providers/structs v0.1.0/go.mod h1:sw2YZ3txUcqA3Z27gPlmmBzWn1h8Nt9O6EP/91MkcWE=
github.com/knadh/koanf/v2 v2.2.1 h1:jaleChtw85y3UdBnI0wCqcg1sj1gPoz6D3caGNHtrNE=
github.com/knadh/koanf/v2 v2.2.1/go.mod h1:PSFru3ufQgTsI7IF+95rf9s8XA1+aHxKuO/W+dPoHEY=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
@ -64,18 +73,21 @@ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
@ -83,21 +95,11 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo=
github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY=
github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
@ -105,16 +107,18 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/vektra/mockery/v2 v2.53.3 h1:yBU8XrzntcZdcNRRv+At0anXgSaFtgkyVUNm3f4an3U=
github.com/vektra/mockery/v2 v2.53.3/go.mod h1:hIFFb3CvzPdDJJiU7J4zLRblUMv7OuezWsHPmswriwo=
github.com/vektra/mockery/v3 v3.5.4 h1:AqbLKhw+H3U5OBqEAcUilxRIcLwHfFKzTbLlyfEqx9o=
github.com/vektra/mockery/v3 v3.5.4/go.mod h1:6rmlzyACJQig1UFoUYyLMS/O+2aGz6BgKAO9C8t9/v0=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE=
@ -127,6 +131,8 @@ golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIi
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac h1:TSSpLIG4v+p0rPv1pNOQtl1I8knsO4S9trOxNMOLVP4=
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
@ -138,8 +144,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@ -152,16 +158,16 @@ golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -181,8 +187,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@ -193,8 +199,8 @@ golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
@ -204,8 +210,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
@ -215,8 +221,10 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=
golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM=
golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View file

@ -27,7 +27,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
echo 'installing mockery'
GOTOOLCHAIN="$(kube::golang::hack_tools_gotoolchain)" go -C "${KUBE_ROOT}/hack/tools" install github.com/vektra/mockery/v2
GOTOOLCHAIN="$(kube::golang::hack_tools_gotoolchain)" go -C "${KUBE_ROOT}/hack/tools" install github.com/vektra/mockery/v3
function git_grep() {
git grep --untracked --exclude-standard \
@ -42,7 +42,7 @@ function git_grep() {
cd "${KUBE_ROOT}"
GENERATED_MOCK_FILE_REGEX="^// Code generated by mockery v[0-9.]\+. DO NOT EDIT.$"
GENERATED_MOCK_FILE_REGEX="^// Code generated by mockery.* DO NOT EDIT.$"
git_grep -l -z "${GENERATED_MOCK_FILE_REGEX}" | xargs -0 rm -f

View file

@ -1,16 +1,16 @@
---
dir: testing
filename: "{{.InterfaceName | snakecase}}.go"
boilerplate-file: ../../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: testing
with-expecter: true
filename: mocks.go
pkgname: testing
template: testify
template-data:
boilerplate-file: ../../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/pkg/kubelet/apis/podresources:
interfaces:
CPUsProvider:
config:
filename: cpus_provider.go
DevicesProvider:
DynamicResourcesProvider:
MemoryProvider:
PodsProvider:
CPUsProvider: {}
DevicesProvider: {}
DynamicResourcesProvider: {}
MemoryProvider: {}
PodsProvider: {}

View file

@ -1,144 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import mock "github.com/stretchr/testify/mock"
// MockCPUsProvider is an autogenerated mock type for the CPUsProvider type
type MockCPUsProvider struct {
mock.Mock
}
type MockCPUsProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockCPUsProvider) EXPECT() *MockCPUsProvider_Expecter {
return &MockCPUsProvider_Expecter{mock: &_m.Mock}
}
// GetAllocatableCPUs provides a mock function with no fields
func (_m *MockCPUsProvider) GetAllocatableCPUs() []int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetAllocatableCPUs")
}
var r0 []int64
if rf, ok := ret.Get(0).(func() []int64); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]int64)
}
}
return r0
}
// MockCPUsProvider_GetAllocatableCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableCPUs'
type MockCPUsProvider_GetAllocatableCPUs_Call struct {
*mock.Call
}
// GetAllocatableCPUs is a helper method to define mock.On call
func (_e *MockCPUsProvider_Expecter) GetAllocatableCPUs() *MockCPUsProvider_GetAllocatableCPUs_Call {
return &MockCPUsProvider_GetAllocatableCPUs_Call{Call: _e.mock.On("GetAllocatableCPUs")}
}
func (_c *MockCPUsProvider_GetAllocatableCPUs_Call) Run(run func()) *MockCPUsProvider_GetAllocatableCPUs_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockCPUsProvider_GetAllocatableCPUs_Call) Return(_a0 []int64) *MockCPUsProvider_GetAllocatableCPUs_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCPUsProvider_GetAllocatableCPUs_Call) RunAndReturn(run func() []int64) *MockCPUsProvider_GetAllocatableCPUs_Call {
_c.Call.Return(run)
return _c
}
// GetCPUs provides a mock function with given fields: podUID, containerName
func (_m *MockCPUsProvider) GetCPUs(podUID string, containerName string) []int64 {
ret := _m.Called(podUID, containerName)
if len(ret) == 0 {
panic("no return value specified for GetCPUs")
}
var r0 []int64
if rf, ok := ret.Get(0).(func(string, string) []int64); ok {
r0 = rf(podUID, containerName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]int64)
}
}
return r0
}
// MockCPUsProvider_GetCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCPUs'
type MockCPUsProvider_GetCPUs_Call struct {
*mock.Call
}
// GetCPUs is a helper method to define mock.On call
// - podUID string
// - containerName string
func (_e *MockCPUsProvider_Expecter) GetCPUs(podUID interface{}, containerName interface{}) *MockCPUsProvider_GetCPUs_Call {
return &MockCPUsProvider_GetCPUs_Call{Call: _e.mock.On("GetCPUs", podUID, containerName)}
}
func (_c *MockCPUsProvider_GetCPUs_Call) Run(run func(podUID string, containerName string)) *MockCPUsProvider_GetCPUs_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string))
})
return _c
}
func (_c *MockCPUsProvider_GetCPUs_Call) Return(_a0 []int64) *MockCPUsProvider_GetCPUs_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCPUsProvider_GetCPUs_Call) RunAndReturn(run func(string, string) []int64) *MockCPUsProvider_GetCPUs_Call {
_c.Call.Return(run)
return _c
}
// NewMockCPUsProvider creates a new instance of MockCPUsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockCPUsProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockCPUsProvider {
mock := &MockCPUsProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,180 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import (
mock "github.com/stretchr/testify/mock"
v1 "k8s.io/kubelet/pkg/apis/podresources/v1"
)
// MockDevicesProvider is an autogenerated mock type for the DevicesProvider type
type MockDevicesProvider struct {
mock.Mock
}
type MockDevicesProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockDevicesProvider) EXPECT() *MockDevicesProvider_Expecter {
return &MockDevicesProvider_Expecter{mock: &_m.Mock}
}
// GetAllocatableDevices provides a mock function with no fields
func (_m *MockDevicesProvider) GetAllocatableDevices() []*v1.ContainerDevices {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetAllocatableDevices")
}
var r0 []*v1.ContainerDevices
if rf, ok := ret.Get(0).(func() []*v1.ContainerDevices); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerDevices)
}
}
return r0
}
// MockDevicesProvider_GetAllocatableDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableDevices'
type MockDevicesProvider_GetAllocatableDevices_Call struct {
*mock.Call
}
// GetAllocatableDevices is a helper method to define mock.On call
func (_e *MockDevicesProvider_Expecter) GetAllocatableDevices() *MockDevicesProvider_GetAllocatableDevices_Call {
return &MockDevicesProvider_GetAllocatableDevices_Call{Call: _e.mock.On("GetAllocatableDevices")}
}
func (_c *MockDevicesProvider_GetAllocatableDevices_Call) Run(run func()) *MockDevicesProvider_GetAllocatableDevices_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockDevicesProvider_GetAllocatableDevices_Call) Return(_a0 []*v1.ContainerDevices) *MockDevicesProvider_GetAllocatableDevices_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockDevicesProvider_GetAllocatableDevices_Call) RunAndReturn(run func() []*v1.ContainerDevices) *MockDevicesProvider_GetAllocatableDevices_Call {
_c.Call.Return(run)
return _c
}
// GetDevices provides a mock function with given fields: podUID, containerName
func (_m *MockDevicesProvider) GetDevices(podUID string, containerName string) []*v1.ContainerDevices {
ret := _m.Called(podUID, containerName)
if len(ret) == 0 {
panic("no return value specified for GetDevices")
}
var r0 []*v1.ContainerDevices
if rf, ok := ret.Get(0).(func(string, string) []*v1.ContainerDevices); ok {
r0 = rf(podUID, containerName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerDevices)
}
}
return r0
}
// MockDevicesProvider_GetDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDevices'
type MockDevicesProvider_GetDevices_Call struct {
*mock.Call
}
// GetDevices is a helper method to define mock.On call
// - podUID string
// - containerName string
func (_e *MockDevicesProvider_Expecter) GetDevices(podUID interface{}, containerName interface{}) *MockDevicesProvider_GetDevices_Call {
return &MockDevicesProvider_GetDevices_Call{Call: _e.mock.On("GetDevices", podUID, containerName)}
}
func (_c *MockDevicesProvider_GetDevices_Call) Run(run func(podUID string, containerName string)) *MockDevicesProvider_GetDevices_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string))
})
return _c
}
func (_c *MockDevicesProvider_GetDevices_Call) Return(_a0 []*v1.ContainerDevices) *MockDevicesProvider_GetDevices_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockDevicesProvider_GetDevices_Call) RunAndReturn(run func(string, string) []*v1.ContainerDevices) *MockDevicesProvider_GetDevices_Call {
_c.Call.Return(run)
return _c
}
// UpdateAllocatedDevices provides a mock function with no fields
func (_m *MockDevicesProvider) UpdateAllocatedDevices() {
_m.Called()
}
// MockDevicesProvider_UpdateAllocatedDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllocatedDevices'
type MockDevicesProvider_UpdateAllocatedDevices_Call struct {
*mock.Call
}
// UpdateAllocatedDevices is a helper method to define mock.On call
func (_e *MockDevicesProvider_Expecter) UpdateAllocatedDevices() *MockDevicesProvider_UpdateAllocatedDevices_Call {
return &MockDevicesProvider_UpdateAllocatedDevices_Call{Call: _e.mock.On("UpdateAllocatedDevices")}
}
func (_c *MockDevicesProvider_UpdateAllocatedDevices_Call) Run(run func()) *MockDevicesProvider_UpdateAllocatedDevices_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockDevicesProvider_UpdateAllocatedDevices_Call) Return() *MockDevicesProvider_UpdateAllocatedDevices_Call {
_c.Call.Return()
return _c
}
func (_c *MockDevicesProvider_UpdateAllocatedDevices_Call) RunAndReturn(run func()) *MockDevicesProvider_UpdateAllocatedDevices_Call {
_c.Run(run)
return _c
}
// NewMockDevicesProvider creates a new instance of MockDevicesProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockDevicesProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockDevicesProvider {
mock := &MockDevicesProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,103 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import (
mock "github.com/stretchr/testify/mock"
podresourcesv1 "k8s.io/kubelet/pkg/apis/podresources/v1"
v1 "k8s.io/api/core/v1"
)
// MockDynamicResourcesProvider is an autogenerated mock type for the DynamicResourcesProvider type
type MockDynamicResourcesProvider struct {
mock.Mock
}
type MockDynamicResourcesProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockDynamicResourcesProvider) EXPECT() *MockDynamicResourcesProvider_Expecter {
return &MockDynamicResourcesProvider_Expecter{mock: &_m.Mock}
}
// GetDynamicResources provides a mock function with given fields: pod, container
func (_m *MockDynamicResourcesProvider) GetDynamicResources(pod *v1.Pod, container *v1.Container) []*podresourcesv1.DynamicResource {
ret := _m.Called(pod, container)
if len(ret) == 0 {
panic("no return value specified for GetDynamicResources")
}
var r0 []*podresourcesv1.DynamicResource
if rf, ok := ret.Get(0).(func(*v1.Pod, *v1.Container) []*podresourcesv1.DynamicResource); ok {
r0 = rf(pod, container)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*podresourcesv1.DynamicResource)
}
}
return r0
}
// MockDynamicResourcesProvider_GetDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicResources'
type MockDynamicResourcesProvider_GetDynamicResources_Call struct {
*mock.Call
}
// GetDynamicResources is a helper method to define mock.On call
// - pod *v1.Pod
// - container *v1.Container
func (_e *MockDynamicResourcesProvider_Expecter) GetDynamicResources(pod interface{}, container interface{}) *MockDynamicResourcesProvider_GetDynamicResources_Call {
return &MockDynamicResourcesProvider_GetDynamicResources_Call{Call: _e.mock.On("GetDynamicResources", pod, container)}
}
func (_c *MockDynamicResourcesProvider_GetDynamicResources_Call) Run(run func(pod *v1.Pod, container *v1.Container)) *MockDynamicResourcesProvider_GetDynamicResources_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod), args[1].(*v1.Container))
})
return _c
}
func (_c *MockDynamicResourcesProvider_GetDynamicResources_Call) Return(_a0 []*podresourcesv1.DynamicResource) *MockDynamicResourcesProvider_GetDynamicResources_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockDynamicResourcesProvider_GetDynamicResources_Call) RunAndReturn(run func(*v1.Pod, *v1.Container) []*podresourcesv1.DynamicResource) *MockDynamicResourcesProvider_GetDynamicResources_Call {
_c.Call.Return(run)
return _c
}
// NewMockDynamicResourcesProvider creates a new instance of MockDynamicResourcesProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockDynamicResourcesProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockDynamicResourcesProvider {
mock := &MockDynamicResourcesProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,148 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import (
mock "github.com/stretchr/testify/mock"
v1 "k8s.io/kubelet/pkg/apis/podresources/v1"
)
// MockMemoryProvider is an autogenerated mock type for the MemoryProvider type
type MockMemoryProvider struct {
mock.Mock
}
type MockMemoryProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockMemoryProvider) EXPECT() *MockMemoryProvider_Expecter {
return &MockMemoryProvider_Expecter{mock: &_m.Mock}
}
// GetAllocatableMemory provides a mock function with no fields
func (_m *MockMemoryProvider) GetAllocatableMemory() []*v1.ContainerMemory {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetAllocatableMemory")
}
var r0 []*v1.ContainerMemory
if rf, ok := ret.Get(0).(func() []*v1.ContainerMemory); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerMemory)
}
}
return r0
}
// MockMemoryProvider_GetAllocatableMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableMemory'
type MockMemoryProvider_GetAllocatableMemory_Call struct {
*mock.Call
}
// GetAllocatableMemory is a helper method to define mock.On call
func (_e *MockMemoryProvider_Expecter) GetAllocatableMemory() *MockMemoryProvider_GetAllocatableMemory_Call {
return &MockMemoryProvider_GetAllocatableMemory_Call{Call: _e.mock.On("GetAllocatableMemory")}
}
func (_c *MockMemoryProvider_GetAllocatableMemory_Call) Run(run func()) *MockMemoryProvider_GetAllocatableMemory_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockMemoryProvider_GetAllocatableMemory_Call) Return(_a0 []*v1.ContainerMemory) *MockMemoryProvider_GetAllocatableMemory_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockMemoryProvider_GetAllocatableMemory_Call) RunAndReturn(run func() []*v1.ContainerMemory) *MockMemoryProvider_GetAllocatableMemory_Call {
_c.Call.Return(run)
return _c
}
// GetMemory provides a mock function with given fields: podUID, containerName
func (_m *MockMemoryProvider) GetMemory(podUID string, containerName string) []*v1.ContainerMemory {
ret := _m.Called(podUID, containerName)
if len(ret) == 0 {
panic("no return value specified for GetMemory")
}
var r0 []*v1.ContainerMemory
if rf, ok := ret.Get(0).(func(string, string) []*v1.ContainerMemory); ok {
r0 = rf(podUID, containerName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerMemory)
}
}
return r0
}
// MockMemoryProvider_GetMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMemory'
type MockMemoryProvider_GetMemory_Call struct {
*mock.Call
}
// GetMemory is a helper method to define mock.On call
// - podUID string
// - containerName string
func (_e *MockMemoryProvider_Expecter) GetMemory(podUID interface{}, containerName interface{}) *MockMemoryProvider_GetMemory_Call {
return &MockMemoryProvider_GetMemory_Call{Call: _e.mock.On("GetMemory", podUID, containerName)}
}
func (_c *MockMemoryProvider_GetMemory_Call) Run(run func(podUID string, containerName string)) *MockMemoryProvider_GetMemory_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string))
})
return _c
}
func (_c *MockMemoryProvider_GetMemory_Call) Return(_a0 []*v1.ContainerMemory) *MockMemoryProvider_GetMemory_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockMemoryProvider_GetMemory_Call) RunAndReturn(run func(string, string) []*v1.ContainerMemory) *MockMemoryProvider_GetMemory_Call {
_c.Call.Return(run)
return _c
}
// NewMockMemoryProvider creates a new instance of MockMemoryProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockMemoryProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockMemoryProvider {
mock := &MockMemoryProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -0,0 +1,729 @@
/*
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.
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.
*/
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package testing
import (
mock "github.com/stretchr/testify/mock"
v10 "k8s.io/api/core/v1"
"k8s.io/kubelet/pkg/apis/podresources/v1"
)
// NewMockDevicesProvider creates a new instance of MockDevicesProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockDevicesProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockDevicesProvider {
mock := &MockDevicesProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockDevicesProvider is an autogenerated mock type for the DevicesProvider type
type MockDevicesProvider struct {
mock.Mock
}
type MockDevicesProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockDevicesProvider) EXPECT() *MockDevicesProvider_Expecter {
return &MockDevicesProvider_Expecter{mock: &_m.Mock}
}
// GetAllocatableDevices provides a mock function for the type MockDevicesProvider
func (_mock *MockDevicesProvider) GetAllocatableDevices() []*v1.ContainerDevices {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetAllocatableDevices")
}
var r0 []*v1.ContainerDevices
if returnFunc, ok := ret.Get(0).(func() []*v1.ContainerDevices); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerDevices)
}
}
return r0
}
// MockDevicesProvider_GetAllocatableDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableDevices'
type MockDevicesProvider_GetAllocatableDevices_Call struct {
*mock.Call
}
// GetAllocatableDevices is a helper method to define mock.On call
func (_e *MockDevicesProvider_Expecter) GetAllocatableDevices() *MockDevicesProvider_GetAllocatableDevices_Call {
return &MockDevicesProvider_GetAllocatableDevices_Call{Call: _e.mock.On("GetAllocatableDevices")}
}
func (_c *MockDevicesProvider_GetAllocatableDevices_Call) Run(run func()) *MockDevicesProvider_GetAllocatableDevices_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockDevicesProvider_GetAllocatableDevices_Call) Return(containerDevicess []*v1.ContainerDevices) *MockDevicesProvider_GetAllocatableDevices_Call {
_c.Call.Return(containerDevicess)
return _c
}
func (_c *MockDevicesProvider_GetAllocatableDevices_Call) RunAndReturn(run func() []*v1.ContainerDevices) *MockDevicesProvider_GetAllocatableDevices_Call {
_c.Call.Return(run)
return _c
}
// GetDevices provides a mock function for the type MockDevicesProvider
func (_mock *MockDevicesProvider) GetDevices(podUID string, containerName string) []*v1.ContainerDevices {
ret := _mock.Called(podUID, containerName)
if len(ret) == 0 {
panic("no return value specified for GetDevices")
}
var r0 []*v1.ContainerDevices
if returnFunc, ok := ret.Get(0).(func(string, string) []*v1.ContainerDevices); ok {
r0 = returnFunc(podUID, containerName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerDevices)
}
}
return r0
}
// MockDevicesProvider_GetDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDevices'
type MockDevicesProvider_GetDevices_Call struct {
*mock.Call
}
// GetDevices is a helper method to define mock.On call
// - podUID string
// - containerName string
func (_e *MockDevicesProvider_Expecter) GetDevices(podUID interface{}, containerName interface{}) *MockDevicesProvider_GetDevices_Call {
return &MockDevicesProvider_GetDevices_Call{Call: _e.mock.On("GetDevices", podUID, containerName)}
}
func (_c *MockDevicesProvider_GetDevices_Call) Run(run func(podUID string, containerName string)) *MockDevicesProvider_GetDevices_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockDevicesProvider_GetDevices_Call) Return(containerDevicess []*v1.ContainerDevices) *MockDevicesProvider_GetDevices_Call {
_c.Call.Return(containerDevicess)
return _c
}
func (_c *MockDevicesProvider_GetDevices_Call) RunAndReturn(run func(podUID string, containerName string) []*v1.ContainerDevices) *MockDevicesProvider_GetDevices_Call {
_c.Call.Return(run)
return _c
}
// UpdateAllocatedDevices provides a mock function for the type MockDevicesProvider
func (_mock *MockDevicesProvider) UpdateAllocatedDevices() {
_mock.Called()
return
}
// MockDevicesProvider_UpdateAllocatedDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllocatedDevices'
type MockDevicesProvider_UpdateAllocatedDevices_Call struct {
*mock.Call
}
// UpdateAllocatedDevices is a helper method to define mock.On call
func (_e *MockDevicesProvider_Expecter) UpdateAllocatedDevices() *MockDevicesProvider_UpdateAllocatedDevices_Call {
return &MockDevicesProvider_UpdateAllocatedDevices_Call{Call: _e.mock.On("UpdateAllocatedDevices")}
}
func (_c *MockDevicesProvider_UpdateAllocatedDevices_Call) Run(run func()) *MockDevicesProvider_UpdateAllocatedDevices_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockDevicesProvider_UpdateAllocatedDevices_Call) Return() *MockDevicesProvider_UpdateAllocatedDevices_Call {
_c.Call.Return()
return _c
}
func (_c *MockDevicesProvider_UpdateAllocatedDevices_Call) RunAndReturn(run func()) *MockDevicesProvider_UpdateAllocatedDevices_Call {
_c.Run(run)
return _c
}
// NewMockPodsProvider creates a new instance of MockPodsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockPodsProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockPodsProvider {
mock := &MockPodsProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockPodsProvider is an autogenerated mock type for the PodsProvider type
type MockPodsProvider struct {
mock.Mock
}
type MockPodsProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockPodsProvider) EXPECT() *MockPodsProvider_Expecter {
return &MockPodsProvider_Expecter{mock: &_m.Mock}
}
// GetActivePods provides a mock function for the type MockPodsProvider
func (_mock *MockPodsProvider) GetActivePods() []*v10.Pod {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetActivePods")
}
var r0 []*v10.Pod
if returnFunc, ok := ret.Get(0).(func() []*v10.Pod); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v10.Pod)
}
}
return r0
}
// MockPodsProvider_GetActivePods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActivePods'
type MockPodsProvider_GetActivePods_Call struct {
*mock.Call
}
// GetActivePods is a helper method to define mock.On call
func (_e *MockPodsProvider_Expecter) GetActivePods() *MockPodsProvider_GetActivePods_Call {
return &MockPodsProvider_GetActivePods_Call{Call: _e.mock.On("GetActivePods")}
}
func (_c *MockPodsProvider_GetActivePods_Call) Run(run func()) *MockPodsProvider_GetActivePods_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockPodsProvider_GetActivePods_Call) Return(pods []*v10.Pod) *MockPodsProvider_GetActivePods_Call {
_c.Call.Return(pods)
return _c
}
func (_c *MockPodsProvider_GetActivePods_Call) RunAndReturn(run func() []*v10.Pod) *MockPodsProvider_GetActivePods_Call {
_c.Call.Return(run)
return _c
}
// GetPodByName provides a mock function for the type MockPodsProvider
func (_mock *MockPodsProvider) GetPodByName(namespace string, name string) (*v10.Pod, bool) {
ret := _mock.Called(namespace, name)
if len(ret) == 0 {
panic("no return value specified for GetPodByName")
}
var r0 *v10.Pod
var r1 bool
if returnFunc, ok := ret.Get(0).(func(string, string) (*v10.Pod, bool)); ok {
return returnFunc(namespace, name)
}
if returnFunc, ok := ret.Get(0).(func(string, string) *v10.Pod); ok {
r0 = returnFunc(namespace, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v10.Pod)
}
}
if returnFunc, ok := ret.Get(1).(func(string, string) bool); ok {
r1 = returnFunc(namespace, name)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
// MockPodsProvider_GetPodByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodByName'
type MockPodsProvider_GetPodByName_Call struct {
*mock.Call
}
// GetPodByName is a helper method to define mock.On call
// - namespace string
// - name string
func (_e *MockPodsProvider_Expecter) GetPodByName(namespace interface{}, name interface{}) *MockPodsProvider_GetPodByName_Call {
return &MockPodsProvider_GetPodByName_Call{Call: _e.mock.On("GetPodByName", namespace, name)}
}
func (_c *MockPodsProvider_GetPodByName_Call) Run(run func(namespace string, name string)) *MockPodsProvider_GetPodByName_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockPodsProvider_GetPodByName_Call) Return(pod *v10.Pod, b bool) *MockPodsProvider_GetPodByName_Call {
_c.Call.Return(pod, b)
return _c
}
func (_c *MockPodsProvider_GetPodByName_Call) RunAndReturn(run func(namespace string, name string) (*v10.Pod, bool)) *MockPodsProvider_GetPodByName_Call {
_c.Call.Return(run)
return _c
}
// GetPods provides a mock function for the type MockPodsProvider
func (_mock *MockPodsProvider) GetPods() []*v10.Pod {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetPods")
}
var r0 []*v10.Pod
if returnFunc, ok := ret.Get(0).(func() []*v10.Pod); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v10.Pod)
}
}
return r0
}
// MockPodsProvider_GetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPods'
type MockPodsProvider_GetPods_Call struct {
*mock.Call
}
// GetPods is a helper method to define mock.On call
func (_e *MockPodsProvider_Expecter) GetPods() *MockPodsProvider_GetPods_Call {
return &MockPodsProvider_GetPods_Call{Call: _e.mock.On("GetPods")}
}
func (_c *MockPodsProvider_GetPods_Call) Run(run func()) *MockPodsProvider_GetPods_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockPodsProvider_GetPods_Call) Return(pods []*v10.Pod) *MockPodsProvider_GetPods_Call {
_c.Call.Return(pods)
return _c
}
func (_c *MockPodsProvider_GetPods_Call) RunAndReturn(run func() []*v10.Pod) *MockPodsProvider_GetPods_Call {
_c.Call.Return(run)
return _c
}
// NewMockCPUsProvider creates a new instance of MockCPUsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockCPUsProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockCPUsProvider {
mock := &MockCPUsProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockCPUsProvider is an autogenerated mock type for the CPUsProvider type
type MockCPUsProvider struct {
mock.Mock
}
type MockCPUsProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockCPUsProvider) EXPECT() *MockCPUsProvider_Expecter {
return &MockCPUsProvider_Expecter{mock: &_m.Mock}
}
// GetAllocatableCPUs provides a mock function for the type MockCPUsProvider
func (_mock *MockCPUsProvider) GetAllocatableCPUs() []int64 {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetAllocatableCPUs")
}
var r0 []int64
if returnFunc, ok := ret.Get(0).(func() []int64); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]int64)
}
}
return r0
}
// MockCPUsProvider_GetAllocatableCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableCPUs'
type MockCPUsProvider_GetAllocatableCPUs_Call struct {
*mock.Call
}
// GetAllocatableCPUs is a helper method to define mock.On call
func (_e *MockCPUsProvider_Expecter) GetAllocatableCPUs() *MockCPUsProvider_GetAllocatableCPUs_Call {
return &MockCPUsProvider_GetAllocatableCPUs_Call{Call: _e.mock.On("GetAllocatableCPUs")}
}
func (_c *MockCPUsProvider_GetAllocatableCPUs_Call) Run(run func()) *MockCPUsProvider_GetAllocatableCPUs_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockCPUsProvider_GetAllocatableCPUs_Call) Return(int64s []int64) *MockCPUsProvider_GetAllocatableCPUs_Call {
_c.Call.Return(int64s)
return _c
}
func (_c *MockCPUsProvider_GetAllocatableCPUs_Call) RunAndReturn(run func() []int64) *MockCPUsProvider_GetAllocatableCPUs_Call {
_c.Call.Return(run)
return _c
}
// GetCPUs provides a mock function for the type MockCPUsProvider
func (_mock *MockCPUsProvider) GetCPUs(podUID string, containerName string) []int64 {
ret := _mock.Called(podUID, containerName)
if len(ret) == 0 {
panic("no return value specified for GetCPUs")
}
var r0 []int64
if returnFunc, ok := ret.Get(0).(func(string, string) []int64); ok {
r0 = returnFunc(podUID, containerName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]int64)
}
}
return r0
}
// MockCPUsProvider_GetCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCPUs'
type MockCPUsProvider_GetCPUs_Call struct {
*mock.Call
}
// GetCPUs is a helper method to define mock.On call
// - podUID string
// - containerName string
func (_e *MockCPUsProvider_Expecter) GetCPUs(podUID interface{}, containerName interface{}) *MockCPUsProvider_GetCPUs_Call {
return &MockCPUsProvider_GetCPUs_Call{Call: _e.mock.On("GetCPUs", podUID, containerName)}
}
func (_c *MockCPUsProvider_GetCPUs_Call) Run(run func(podUID string, containerName string)) *MockCPUsProvider_GetCPUs_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockCPUsProvider_GetCPUs_Call) Return(int64s []int64) *MockCPUsProvider_GetCPUs_Call {
_c.Call.Return(int64s)
return _c
}
func (_c *MockCPUsProvider_GetCPUs_Call) RunAndReturn(run func(podUID string, containerName string) []int64) *MockCPUsProvider_GetCPUs_Call {
_c.Call.Return(run)
return _c
}
// NewMockMemoryProvider creates a new instance of MockMemoryProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockMemoryProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockMemoryProvider {
mock := &MockMemoryProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockMemoryProvider is an autogenerated mock type for the MemoryProvider type
type MockMemoryProvider struct {
mock.Mock
}
type MockMemoryProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockMemoryProvider) EXPECT() *MockMemoryProvider_Expecter {
return &MockMemoryProvider_Expecter{mock: &_m.Mock}
}
// GetAllocatableMemory provides a mock function for the type MockMemoryProvider
func (_mock *MockMemoryProvider) GetAllocatableMemory() []*v1.ContainerMemory {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetAllocatableMemory")
}
var r0 []*v1.ContainerMemory
if returnFunc, ok := ret.Get(0).(func() []*v1.ContainerMemory); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerMemory)
}
}
return r0
}
// MockMemoryProvider_GetAllocatableMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableMemory'
type MockMemoryProvider_GetAllocatableMemory_Call struct {
*mock.Call
}
// GetAllocatableMemory is a helper method to define mock.On call
func (_e *MockMemoryProvider_Expecter) GetAllocatableMemory() *MockMemoryProvider_GetAllocatableMemory_Call {
return &MockMemoryProvider_GetAllocatableMemory_Call{Call: _e.mock.On("GetAllocatableMemory")}
}
func (_c *MockMemoryProvider_GetAllocatableMemory_Call) Run(run func()) *MockMemoryProvider_GetAllocatableMemory_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockMemoryProvider_GetAllocatableMemory_Call) Return(containerMemorys []*v1.ContainerMemory) *MockMemoryProvider_GetAllocatableMemory_Call {
_c.Call.Return(containerMemorys)
return _c
}
func (_c *MockMemoryProvider_GetAllocatableMemory_Call) RunAndReturn(run func() []*v1.ContainerMemory) *MockMemoryProvider_GetAllocatableMemory_Call {
_c.Call.Return(run)
return _c
}
// GetMemory provides a mock function for the type MockMemoryProvider
func (_mock *MockMemoryProvider) GetMemory(podUID string, containerName string) []*v1.ContainerMemory {
ret := _mock.Called(podUID, containerName)
if len(ret) == 0 {
panic("no return value specified for GetMemory")
}
var r0 []*v1.ContainerMemory
if returnFunc, ok := ret.Get(0).(func(string, string) []*v1.ContainerMemory); ok {
r0 = returnFunc(podUID, containerName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.ContainerMemory)
}
}
return r0
}
// MockMemoryProvider_GetMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMemory'
type MockMemoryProvider_GetMemory_Call struct {
*mock.Call
}
// GetMemory is a helper method to define mock.On call
// - podUID string
// - containerName string
func (_e *MockMemoryProvider_Expecter) GetMemory(podUID interface{}, containerName interface{}) *MockMemoryProvider_GetMemory_Call {
return &MockMemoryProvider_GetMemory_Call{Call: _e.mock.On("GetMemory", podUID, containerName)}
}
func (_c *MockMemoryProvider_GetMemory_Call) Run(run func(podUID string, containerName string)) *MockMemoryProvider_GetMemory_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockMemoryProvider_GetMemory_Call) Return(containerMemorys []*v1.ContainerMemory) *MockMemoryProvider_GetMemory_Call {
_c.Call.Return(containerMemorys)
return _c
}
func (_c *MockMemoryProvider_GetMemory_Call) RunAndReturn(run func(podUID string, containerName string) []*v1.ContainerMemory) *MockMemoryProvider_GetMemory_Call {
_c.Call.Return(run)
return _c
}
// NewMockDynamicResourcesProvider creates a new instance of MockDynamicResourcesProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockDynamicResourcesProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockDynamicResourcesProvider {
mock := &MockDynamicResourcesProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockDynamicResourcesProvider is an autogenerated mock type for the DynamicResourcesProvider type
type MockDynamicResourcesProvider struct {
mock.Mock
}
type MockDynamicResourcesProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockDynamicResourcesProvider) EXPECT() *MockDynamicResourcesProvider_Expecter {
return &MockDynamicResourcesProvider_Expecter{mock: &_m.Mock}
}
// GetDynamicResources provides a mock function for the type MockDynamicResourcesProvider
func (_mock *MockDynamicResourcesProvider) GetDynamicResources(pod *v10.Pod, container *v10.Container) []*v1.DynamicResource {
ret := _mock.Called(pod, container)
if len(ret) == 0 {
panic("no return value specified for GetDynamicResources")
}
var r0 []*v1.DynamicResource
if returnFunc, ok := ret.Get(0).(func(*v10.Pod, *v10.Container) []*v1.DynamicResource); ok {
r0 = returnFunc(pod, container)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.DynamicResource)
}
}
return r0
}
// MockDynamicResourcesProvider_GetDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicResources'
type MockDynamicResourcesProvider_GetDynamicResources_Call struct {
*mock.Call
}
// GetDynamicResources is a helper method to define mock.On call
// - pod *v10.Pod
// - container *v10.Container
func (_e *MockDynamicResourcesProvider_Expecter) GetDynamicResources(pod interface{}, container interface{}) *MockDynamicResourcesProvider_GetDynamicResources_Call {
return &MockDynamicResourcesProvider_GetDynamicResources_Call{Call: _e.mock.On("GetDynamicResources", pod, container)}
}
func (_c *MockDynamicResourcesProvider_GetDynamicResources_Call) Run(run func(pod *v10.Pod, container *v10.Container)) *MockDynamicResourcesProvider_GetDynamicResources_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 *v10.Pod
if args[0] != nil {
arg0 = args[0].(*v10.Pod)
}
var arg1 *v10.Container
if args[1] != nil {
arg1 = args[1].(*v10.Container)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockDynamicResourcesProvider_GetDynamicResources_Call) Return(dynamicResources []*v1.DynamicResource) *MockDynamicResourcesProvider_GetDynamicResources_Call {
_c.Call.Return(dynamicResources)
return _c
}
func (_c *MockDynamicResourcesProvider_GetDynamicResources_Call) RunAndReturn(run func(pod *v10.Pod, container *v10.Container) []*v1.DynamicResource) *MockDynamicResourcesProvider_GetDynamicResources_Call {
_c.Call.Return(run)
return _c
}

View file

@ -1,205 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import (
mock "github.com/stretchr/testify/mock"
v1 "k8s.io/api/core/v1"
)
// MockPodsProvider is an autogenerated mock type for the PodsProvider type
type MockPodsProvider struct {
mock.Mock
}
type MockPodsProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockPodsProvider) EXPECT() *MockPodsProvider_Expecter {
return &MockPodsProvider_Expecter{mock: &_m.Mock}
}
// GetActivePods provides a mock function with no fields
func (_m *MockPodsProvider) GetActivePods() []*v1.Pod {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetActivePods")
}
var r0 []*v1.Pod
if rf, ok := ret.Get(0).(func() []*v1.Pod); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.Pod)
}
}
return r0
}
// MockPodsProvider_GetActivePods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActivePods'
type MockPodsProvider_GetActivePods_Call struct {
*mock.Call
}
// GetActivePods is a helper method to define mock.On call
func (_e *MockPodsProvider_Expecter) GetActivePods() *MockPodsProvider_GetActivePods_Call {
return &MockPodsProvider_GetActivePods_Call{Call: _e.mock.On("GetActivePods")}
}
func (_c *MockPodsProvider_GetActivePods_Call) Run(run func()) *MockPodsProvider_GetActivePods_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockPodsProvider_GetActivePods_Call) Return(_a0 []*v1.Pod) *MockPodsProvider_GetActivePods_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockPodsProvider_GetActivePods_Call) RunAndReturn(run func() []*v1.Pod) *MockPodsProvider_GetActivePods_Call {
_c.Call.Return(run)
return _c
}
// GetPodByName provides a mock function with given fields: namespace, name
func (_m *MockPodsProvider) GetPodByName(namespace string, name string) (*v1.Pod, bool) {
ret := _m.Called(namespace, name)
if len(ret) == 0 {
panic("no return value specified for GetPodByName")
}
var r0 *v1.Pod
var r1 bool
if rf, ok := ret.Get(0).(func(string, string) (*v1.Pod, bool)); ok {
return rf(namespace, name)
}
if rf, ok := ret.Get(0).(func(string, string) *v1.Pod); ok {
r0 = rf(namespace, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func(string, string) bool); ok {
r1 = rf(namespace, name)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
// MockPodsProvider_GetPodByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodByName'
type MockPodsProvider_GetPodByName_Call struct {
*mock.Call
}
// GetPodByName is a helper method to define mock.On call
// - namespace string
// - name string
func (_e *MockPodsProvider_Expecter) GetPodByName(namespace interface{}, name interface{}) *MockPodsProvider_GetPodByName_Call {
return &MockPodsProvider_GetPodByName_Call{Call: _e.mock.On("GetPodByName", namespace, name)}
}
func (_c *MockPodsProvider_GetPodByName_Call) Run(run func(namespace string, name string)) *MockPodsProvider_GetPodByName_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string))
})
return _c
}
func (_c *MockPodsProvider_GetPodByName_Call) Return(_a0 *v1.Pod, _a1 bool) *MockPodsProvider_GetPodByName_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockPodsProvider_GetPodByName_Call) RunAndReturn(run func(string, string) (*v1.Pod, bool)) *MockPodsProvider_GetPodByName_Call {
_c.Call.Return(run)
return _c
}
// GetPods provides a mock function with no fields
func (_m *MockPodsProvider) GetPods() []*v1.Pod {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetPods")
}
var r0 []*v1.Pod
if rf, ok := ret.Get(0).(func() []*v1.Pod); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.Pod)
}
}
return r0
}
// MockPodsProvider_GetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPods'
type MockPodsProvider_GetPods_Call struct {
*mock.Call
}
// GetPods is a helper method to define mock.On call
func (_e *MockPodsProvider_Expecter) GetPods() *MockPodsProvider_GetPods_Call {
return &MockPodsProvider_GetPods_Call{Call: _e.mock.On("GetPods")}
}
func (_c *MockPodsProvider_GetPods_Call) Run(run func()) *MockPodsProvider_GetPods_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockPodsProvider_GetPods_Call) Return(_a0 []*v1.Pod) *MockPodsProvider_GetPods_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockPodsProvider_GetPods_Call) RunAndReturn(run func() []*v1.Pod) *MockPodsProvider_GetPods_Call {
_c.Call.Return(run)
return _c
}
// NewMockPodsProvider creates a new instance of MockPodsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockPodsProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockPodsProvider {
mock := &MockPodsProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,10 +1,12 @@
---
dir: testing
filename: cadvisor_mock.go
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: testing
with-expecter: true
filename: mocks.go
pkgname: testing
template: testify
template-data:
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/pkg/kubelet/cadvisor:
interfaces:
Interface:
Interface: {}

View file

@ -14,19 +14,34 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package testing
import (
context "context"
"context"
v1 "github.com/google/cadvisor/info/v1"
"github.com/google/cadvisor/info/v1"
"github.com/google/cadvisor/info/v2"
mock "github.com/stretchr/testify/mock"
v2 "github.com/google/cadvisor/info/v2"
)
// NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockInterface(t interface {
mock.TestingT
Cleanup(func())
}) *MockInterface {
mock := &MockInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockInterface is an autogenerated mock type for the Interface type
type MockInterface struct {
mock.Mock
@ -40,9 +55,9 @@ func (_m *MockInterface) EXPECT() *MockInterface_Expecter {
return &MockInterface_Expecter{mock: &_m.Mock}
}
// ContainerFsInfo provides a mock function with given fields: _a0
func (_m *MockInterface) ContainerFsInfo(_a0 context.Context) (v2.FsInfo, error) {
ret := _m.Called(_a0)
// ContainerFsInfo provides a mock function for the type MockInterface
func (_mock *MockInterface) ContainerFsInfo(context1 context.Context) (v2.FsInfo, error) {
ret := _mock.Called(context1)
if len(ret) == 0 {
panic("no return value specified for ContainerFsInfo")
@ -50,21 +65,19 @@ func (_m *MockInterface) ContainerFsInfo(_a0 context.Context) (v2.FsInfo, error)
var r0 v2.FsInfo
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (v2.FsInfo, error)); ok {
return rf(_a0)
if returnFunc, ok := ret.Get(0).(func(context.Context) (v2.FsInfo, error)); ok {
return returnFunc(context1)
}
if rf, ok := ret.Get(0).(func(context.Context) v2.FsInfo); ok {
r0 = rf(_a0)
if returnFunc, ok := ret.Get(0).(func(context.Context) v2.FsInfo); ok {
r0 = returnFunc(context1)
} else {
r0 = ret.Get(0).(v2.FsInfo)
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(_a0)
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(context1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -74,31 +87,37 @@ type MockInterface_ContainerFsInfo_Call struct {
}
// ContainerFsInfo is a helper method to define mock.On call
// - _a0 context.Context
func (_e *MockInterface_Expecter) ContainerFsInfo(_a0 interface{}) *MockInterface_ContainerFsInfo_Call {
return &MockInterface_ContainerFsInfo_Call{Call: _e.mock.On("ContainerFsInfo", _a0)}
// - context1 context.Context
func (_e *MockInterface_Expecter) ContainerFsInfo(context1 interface{}) *MockInterface_ContainerFsInfo_Call {
return &MockInterface_ContainerFsInfo_Call{Call: _e.mock.On("ContainerFsInfo", context1)}
}
func (_c *MockInterface_ContainerFsInfo_Call) Run(run func(_a0 context.Context)) *MockInterface_ContainerFsInfo_Call {
func (_c *MockInterface_ContainerFsInfo_Call) Run(run func(context1 context.Context)) *MockInterface_ContainerFsInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockInterface_ContainerFsInfo_Call) Return(_a0 v2.FsInfo, _a1 error) *MockInterface_ContainerFsInfo_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_ContainerFsInfo_Call) Return(fsInfo v2.FsInfo, err error) *MockInterface_ContainerFsInfo_Call {
_c.Call.Return(fsInfo, err)
return _c
}
func (_c *MockInterface_ContainerFsInfo_Call) RunAndReturn(run func(context.Context) (v2.FsInfo, error)) *MockInterface_ContainerFsInfo_Call {
func (_c *MockInterface_ContainerFsInfo_Call) RunAndReturn(run func(context1 context.Context) (v2.FsInfo, error)) *MockInterface_ContainerFsInfo_Call {
_c.Call.Return(run)
return _c
}
// ContainerInfoV2 provides a mock function with given fields: name, options
func (_m *MockInterface) ContainerInfoV2(name string, options v2.RequestOptions) (map[string]v2.ContainerInfo, error) {
ret := _m.Called(name, options)
// ContainerInfoV2 provides a mock function for the type MockInterface
func (_mock *MockInterface) ContainerInfoV2(name string, options v2.RequestOptions) (map[string]v2.ContainerInfo, error) {
ret := _mock.Called(name, options)
if len(ret) == 0 {
panic("no return value specified for ContainerInfoV2")
@ -106,23 +125,21 @@ func (_m *MockInterface) ContainerInfoV2(name string, options v2.RequestOptions)
var r0 map[string]v2.ContainerInfo
var r1 error
if rf, ok := ret.Get(0).(func(string, v2.RequestOptions) (map[string]v2.ContainerInfo, error)); ok {
return rf(name, options)
if returnFunc, ok := ret.Get(0).(func(string, v2.RequestOptions) (map[string]v2.ContainerInfo, error)); ok {
return returnFunc(name, options)
}
if rf, ok := ret.Get(0).(func(string, v2.RequestOptions) map[string]v2.ContainerInfo); ok {
r0 = rf(name, options)
if returnFunc, ok := ret.Get(0).(func(string, v2.RequestOptions) map[string]v2.ContainerInfo); ok {
r0 = returnFunc(name, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]v2.ContainerInfo)
}
}
if rf, ok := ret.Get(1).(func(string, v2.RequestOptions) error); ok {
r1 = rf(name, options)
if returnFunc, ok := ret.Get(1).(func(string, v2.RequestOptions) error); ok {
r1 = returnFunc(name, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -140,24 +157,35 @@ func (_e *MockInterface_Expecter) ContainerInfoV2(name interface{}, options inte
func (_c *MockInterface_ContainerInfoV2_Call) Run(run func(name string, options v2.RequestOptions)) *MockInterface_ContainerInfoV2_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(v2.RequestOptions))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 v2.RequestOptions
if args[1] != nil {
arg1 = args[1].(v2.RequestOptions)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockInterface_ContainerInfoV2_Call) Return(_a0 map[string]v2.ContainerInfo, _a1 error) *MockInterface_ContainerInfoV2_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_ContainerInfoV2_Call) Return(stringToContainerInfo map[string]v2.ContainerInfo, err error) *MockInterface_ContainerInfoV2_Call {
_c.Call.Return(stringToContainerInfo, err)
return _c
}
func (_c *MockInterface_ContainerInfoV2_Call) RunAndReturn(run func(string, v2.RequestOptions) (map[string]v2.ContainerInfo, error)) *MockInterface_ContainerInfoV2_Call {
func (_c *MockInterface_ContainerInfoV2_Call) RunAndReturn(run func(name string, options v2.RequestOptions) (map[string]v2.ContainerInfo, error)) *MockInterface_ContainerInfoV2_Call {
_c.Call.Return(run)
return _c
}
// GetDirFsInfo provides a mock function with given fields: path
func (_m *MockInterface) GetDirFsInfo(path string) (v2.FsInfo, error) {
ret := _m.Called(path)
// GetDirFsInfo provides a mock function for the type MockInterface
func (_mock *MockInterface) GetDirFsInfo(path string) (v2.FsInfo, error) {
ret := _mock.Called(path)
if len(ret) == 0 {
panic("no return value specified for GetDirFsInfo")
@ -165,21 +193,19 @@ func (_m *MockInterface) GetDirFsInfo(path string) (v2.FsInfo, error) {
var r0 v2.FsInfo
var r1 error
if rf, ok := ret.Get(0).(func(string) (v2.FsInfo, error)); ok {
return rf(path)
if returnFunc, ok := ret.Get(0).(func(string) (v2.FsInfo, error)); ok {
return returnFunc(path)
}
if rf, ok := ret.Get(0).(func(string) v2.FsInfo); ok {
r0 = rf(path)
if returnFunc, ok := ret.Get(0).(func(string) v2.FsInfo); ok {
r0 = returnFunc(path)
} else {
r0 = ret.Get(0).(v2.FsInfo)
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(path)
if returnFunc, ok := ret.Get(1).(func(string) error); ok {
r1 = returnFunc(path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -196,24 +222,30 @@ func (_e *MockInterface_Expecter) GetDirFsInfo(path interface{}) *MockInterface_
func (_c *MockInterface_GetDirFsInfo_Call) Run(run func(path string)) *MockInterface_GetDirFsInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
run(
arg0,
)
})
return _c
}
func (_c *MockInterface_GetDirFsInfo_Call) Return(_a0 v2.FsInfo, _a1 error) *MockInterface_GetDirFsInfo_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_GetDirFsInfo_Call) Return(fsInfo v2.FsInfo, err error) *MockInterface_GetDirFsInfo_Call {
_c.Call.Return(fsInfo, err)
return _c
}
func (_c *MockInterface_GetDirFsInfo_Call) RunAndReturn(run func(string) (v2.FsInfo, error)) *MockInterface_GetDirFsInfo_Call {
func (_c *MockInterface_GetDirFsInfo_Call) RunAndReturn(run func(path string) (v2.FsInfo, error)) *MockInterface_GetDirFsInfo_Call {
_c.Call.Return(run)
return _c
}
// GetRequestedContainersInfo provides a mock function with given fields: containerName, options
func (_m *MockInterface) GetRequestedContainersInfo(containerName string, options v2.RequestOptions) (map[string]*v1.ContainerInfo, error) {
ret := _m.Called(containerName, options)
// GetRequestedContainersInfo provides a mock function for the type MockInterface
func (_mock *MockInterface) GetRequestedContainersInfo(containerName string, options v2.RequestOptions) (map[string]*v1.ContainerInfo, error) {
ret := _mock.Called(containerName, options)
if len(ret) == 0 {
panic("no return value specified for GetRequestedContainersInfo")
@ -221,23 +253,21 @@ func (_m *MockInterface) GetRequestedContainersInfo(containerName string, option
var r0 map[string]*v1.ContainerInfo
var r1 error
if rf, ok := ret.Get(0).(func(string, v2.RequestOptions) (map[string]*v1.ContainerInfo, error)); ok {
return rf(containerName, options)
if returnFunc, ok := ret.Get(0).(func(string, v2.RequestOptions) (map[string]*v1.ContainerInfo, error)); ok {
return returnFunc(containerName, options)
}
if rf, ok := ret.Get(0).(func(string, v2.RequestOptions) map[string]*v1.ContainerInfo); ok {
r0 = rf(containerName, options)
if returnFunc, ok := ret.Get(0).(func(string, v2.RequestOptions) map[string]*v1.ContainerInfo); ok {
r0 = returnFunc(containerName, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]*v1.ContainerInfo)
}
}
if rf, ok := ret.Get(1).(func(string, v2.RequestOptions) error); ok {
r1 = rf(containerName, options)
if returnFunc, ok := ret.Get(1).(func(string, v2.RequestOptions) error); ok {
r1 = returnFunc(containerName, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -255,24 +285,35 @@ func (_e *MockInterface_Expecter) GetRequestedContainersInfo(containerName inter
func (_c *MockInterface_GetRequestedContainersInfo_Call) Run(run func(containerName string, options v2.RequestOptions)) *MockInterface_GetRequestedContainersInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(v2.RequestOptions))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 v2.RequestOptions
if args[1] != nil {
arg1 = args[1].(v2.RequestOptions)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockInterface_GetRequestedContainersInfo_Call) Return(_a0 map[string]*v1.ContainerInfo, _a1 error) *MockInterface_GetRequestedContainersInfo_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_GetRequestedContainersInfo_Call) Return(stringToContainerInfo map[string]*v1.ContainerInfo, err error) *MockInterface_GetRequestedContainersInfo_Call {
_c.Call.Return(stringToContainerInfo, err)
return _c
}
func (_c *MockInterface_GetRequestedContainersInfo_Call) RunAndReturn(run func(string, v2.RequestOptions) (map[string]*v1.ContainerInfo, error)) *MockInterface_GetRequestedContainersInfo_Call {
func (_c *MockInterface_GetRequestedContainersInfo_Call) RunAndReturn(run func(containerName string, options v2.RequestOptions) (map[string]*v1.ContainerInfo, error)) *MockInterface_GetRequestedContainersInfo_Call {
_c.Call.Return(run)
return _c
}
// ImagesFsInfo provides a mock function with given fields: _a0
func (_m *MockInterface) ImagesFsInfo(_a0 context.Context) (v2.FsInfo, error) {
ret := _m.Called(_a0)
// ImagesFsInfo provides a mock function for the type MockInterface
func (_mock *MockInterface) ImagesFsInfo(context1 context.Context) (v2.FsInfo, error) {
ret := _mock.Called(context1)
if len(ret) == 0 {
panic("no return value specified for ImagesFsInfo")
@ -280,21 +321,19 @@ func (_m *MockInterface) ImagesFsInfo(_a0 context.Context) (v2.FsInfo, error) {
var r0 v2.FsInfo
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (v2.FsInfo, error)); ok {
return rf(_a0)
if returnFunc, ok := ret.Get(0).(func(context.Context) (v2.FsInfo, error)); ok {
return returnFunc(context1)
}
if rf, ok := ret.Get(0).(func(context.Context) v2.FsInfo); ok {
r0 = rf(_a0)
if returnFunc, ok := ret.Get(0).(func(context.Context) v2.FsInfo); ok {
r0 = returnFunc(context1)
} else {
r0 = ret.Get(0).(v2.FsInfo)
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(_a0)
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(context1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -304,31 +343,37 @@ type MockInterface_ImagesFsInfo_Call struct {
}
// ImagesFsInfo is a helper method to define mock.On call
// - _a0 context.Context
func (_e *MockInterface_Expecter) ImagesFsInfo(_a0 interface{}) *MockInterface_ImagesFsInfo_Call {
return &MockInterface_ImagesFsInfo_Call{Call: _e.mock.On("ImagesFsInfo", _a0)}
// - context1 context.Context
func (_e *MockInterface_Expecter) ImagesFsInfo(context1 interface{}) *MockInterface_ImagesFsInfo_Call {
return &MockInterface_ImagesFsInfo_Call{Call: _e.mock.On("ImagesFsInfo", context1)}
}
func (_c *MockInterface_ImagesFsInfo_Call) Run(run func(_a0 context.Context)) *MockInterface_ImagesFsInfo_Call {
func (_c *MockInterface_ImagesFsInfo_Call) Run(run func(context1 context.Context)) *MockInterface_ImagesFsInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockInterface_ImagesFsInfo_Call) Return(_a0 v2.FsInfo, _a1 error) *MockInterface_ImagesFsInfo_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_ImagesFsInfo_Call) Return(fsInfo v2.FsInfo, err error) *MockInterface_ImagesFsInfo_Call {
_c.Call.Return(fsInfo, err)
return _c
}
func (_c *MockInterface_ImagesFsInfo_Call) RunAndReturn(run func(context.Context) (v2.FsInfo, error)) *MockInterface_ImagesFsInfo_Call {
func (_c *MockInterface_ImagesFsInfo_Call) RunAndReturn(run func(context1 context.Context) (v2.FsInfo, error)) *MockInterface_ImagesFsInfo_Call {
_c.Call.Return(run)
return _c
}
// MachineInfo provides a mock function with no fields
func (_m *MockInterface) MachineInfo() (*v1.MachineInfo, error) {
ret := _m.Called()
// MachineInfo provides a mock function for the type MockInterface
func (_mock *MockInterface) MachineInfo() (*v1.MachineInfo, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for MachineInfo")
@ -336,23 +381,21 @@ func (_m *MockInterface) MachineInfo() (*v1.MachineInfo, error) {
var r0 *v1.MachineInfo
var r1 error
if rf, ok := ret.Get(0).(func() (*v1.MachineInfo, error)); ok {
return rf()
if returnFunc, ok := ret.Get(0).(func() (*v1.MachineInfo, error)); ok {
return returnFunc()
}
if rf, ok := ret.Get(0).(func() *v1.MachineInfo); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() *v1.MachineInfo); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.MachineInfo)
}
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -373,8 +416,8 @@ func (_c *MockInterface_MachineInfo_Call) Run(run func()) *MockInterface_Machine
return _c
}
func (_c *MockInterface_MachineInfo_Call) Return(_a0 *v1.MachineInfo, _a1 error) *MockInterface_MachineInfo_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_MachineInfo_Call) Return(machineInfo *v1.MachineInfo, err error) *MockInterface_MachineInfo_Call {
_c.Call.Return(machineInfo, err)
return _c
}
@ -383,9 +426,9 @@ func (_c *MockInterface_MachineInfo_Call) RunAndReturn(run func() (*v1.MachineIn
return _c
}
// RootFsInfo provides a mock function with no fields
func (_m *MockInterface) RootFsInfo() (v2.FsInfo, error) {
ret := _m.Called()
// RootFsInfo provides a mock function for the type MockInterface
func (_mock *MockInterface) RootFsInfo() (v2.FsInfo, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for RootFsInfo")
@ -393,21 +436,19 @@ func (_m *MockInterface) RootFsInfo() (v2.FsInfo, error) {
var r0 v2.FsInfo
var r1 error
if rf, ok := ret.Get(0).(func() (v2.FsInfo, error)); ok {
return rf()
if returnFunc, ok := ret.Get(0).(func() (v2.FsInfo, error)); ok {
return returnFunc()
}
if rf, ok := ret.Get(0).(func() v2.FsInfo); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() v2.FsInfo); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(v2.FsInfo)
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -428,8 +469,8 @@ func (_c *MockInterface_RootFsInfo_Call) Run(run func()) *MockInterface_RootFsIn
return _c
}
func (_c *MockInterface_RootFsInfo_Call) Return(_a0 v2.FsInfo, _a1 error) *MockInterface_RootFsInfo_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_RootFsInfo_Call) Return(fsInfo v2.FsInfo, err error) *MockInterface_RootFsInfo_Call {
_c.Call.Return(fsInfo, err)
return _c
}
@ -438,21 +479,20 @@ func (_c *MockInterface_RootFsInfo_Call) RunAndReturn(run func() (v2.FsInfo, err
return _c
}
// Start provides a mock function with no fields
func (_m *MockInterface) Start() error {
ret := _m.Called()
// Start provides a mock function for the type MockInterface
func (_mock *MockInterface) Start() error {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Start")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() error); ok {
r0 = returnFunc()
} else {
r0 = ret.Error(0)
}
return r0
}
@ -473,8 +513,8 @@ func (_c *MockInterface_Start_Call) Run(run func()) *MockInterface_Start_Call {
return _c
}
func (_c *MockInterface_Start_Call) Return(_a0 error) *MockInterface_Start_Call {
_c.Call.Return(_a0)
func (_c *MockInterface_Start_Call) Return(err error) *MockInterface_Start_Call {
_c.Call.Return(err)
return _c
}
@ -483,9 +523,9 @@ func (_c *MockInterface_Start_Call) RunAndReturn(run func() error) *MockInterfac
return _c
}
// VersionInfo provides a mock function with no fields
func (_m *MockInterface) VersionInfo() (*v1.VersionInfo, error) {
ret := _m.Called()
// VersionInfo provides a mock function for the type MockInterface
func (_mock *MockInterface) VersionInfo() (*v1.VersionInfo, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for VersionInfo")
@ -493,23 +533,21 @@ func (_m *MockInterface) VersionInfo() (*v1.VersionInfo, error) {
var r0 *v1.VersionInfo
var r1 error
if rf, ok := ret.Get(0).(func() (*v1.VersionInfo, error)); ok {
return rf()
if returnFunc, ok := ret.Get(0).(func() (*v1.VersionInfo, error)); ok {
return returnFunc()
}
if rf, ok := ret.Get(0).(func() *v1.VersionInfo); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() *v1.VersionInfo); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.VersionInfo)
}
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -530,8 +568,8 @@ func (_c *MockInterface_VersionInfo_Call) Run(run func()) *MockInterface_Version
return _c
}
func (_c *MockInterface_VersionInfo_Call) Return(_a0 *v1.VersionInfo, _a1 error) *MockInterface_VersionInfo_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockInterface_VersionInfo_Call) Return(versionInfo *v1.VersionInfo, err error) *MockInterface_VersionInfo_Call {
_c.Call.Return(versionInfo, err)
return _c
}
@ -539,17 +577,3 @@ func (_c *MockInterface_VersionInfo_Call) RunAndReturn(run func() (*v1.VersionIn
_c.Call.Return(run)
return _c
}
// NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockInterface(t interface {
mock.TestingT
Cleanup(func())
}) *MockInterface {
mock := &MockInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,11 +1,13 @@
---
dir: testing
filename: "mock_{{.InterfaceName | snakecase}}.go"
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: testing
with-expecter: true
filename: mocks.go
pkgname: testing
template: testify
template-data:
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/pkg/kubelet/cm:
interfaces:
ContainerManager:
PodContainerManager:
ContainerManager: {}
PodContainerManager: {}

File diff suppressed because it is too large Load diff

View file

@ -1,572 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import (
mock "github.com/stretchr/testify/mock"
cm "k8s.io/kubernetes/pkg/kubelet/cm"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/api/core/v1"
)
// MockPodContainerManager is an autogenerated mock type for the PodContainerManager type
type MockPodContainerManager struct {
mock.Mock
}
type MockPodContainerManager_Expecter struct {
mock *mock.Mock
}
func (_m *MockPodContainerManager) EXPECT() *MockPodContainerManager_Expecter {
return &MockPodContainerManager_Expecter{mock: &_m.Mock}
}
// Destroy provides a mock function with given fields: name
func (_m *MockPodContainerManager) Destroy(name cm.CgroupName) error {
ret := _m.Called(name)
if len(ret) == 0 {
panic("no return value specified for Destroy")
}
var r0 error
if rf, ok := ret.Get(0).(func(cm.CgroupName) error); ok {
r0 = rf(name)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockPodContainerManager_Destroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Destroy'
type MockPodContainerManager_Destroy_Call struct {
*mock.Call
}
// Destroy is a helper method to define mock.On call
// - name cm.CgroupName
func (_e *MockPodContainerManager_Expecter) Destroy(name interface{}) *MockPodContainerManager_Destroy_Call {
return &MockPodContainerManager_Destroy_Call{Call: _e.mock.On("Destroy", name)}
}
func (_c *MockPodContainerManager_Destroy_Call) Run(run func(name cm.CgroupName)) *MockPodContainerManager_Destroy_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(cm.CgroupName))
})
return _c
}
func (_c *MockPodContainerManager_Destroy_Call) Return(_a0 error) *MockPodContainerManager_Destroy_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockPodContainerManager_Destroy_Call) RunAndReturn(run func(cm.CgroupName) error) *MockPodContainerManager_Destroy_Call {
_c.Call.Return(run)
return _c
}
// EnsureExists provides a mock function with given fields: _a0
func (_m *MockPodContainerManager) EnsureExists(_a0 *v1.Pod) error {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for EnsureExists")
}
var r0 error
if rf, ok := ret.Get(0).(func(*v1.Pod) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockPodContainerManager_EnsureExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureExists'
type MockPodContainerManager_EnsureExists_Call struct {
*mock.Call
}
// EnsureExists is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockPodContainerManager_Expecter) EnsureExists(_a0 interface{}) *MockPodContainerManager_EnsureExists_Call {
return &MockPodContainerManager_EnsureExists_Call{Call: _e.mock.On("EnsureExists", _a0)}
}
func (_c *MockPodContainerManager_EnsureExists_Call) Run(run func(_a0 *v1.Pod)) *MockPodContainerManager_EnsureExists_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
})
return _c
}
func (_c *MockPodContainerManager_EnsureExists_Call) Return(_a0 error) *MockPodContainerManager_EnsureExists_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockPodContainerManager_EnsureExists_Call) RunAndReturn(run func(*v1.Pod) error) *MockPodContainerManager_EnsureExists_Call {
_c.Call.Return(run)
return _c
}
// Exists provides a mock function with given fields: _a0
func (_m *MockPodContainerManager) Exists(_a0 *v1.Pod) bool {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for Exists")
}
var r0 bool
if rf, ok := ret.Get(0).(func(*v1.Pod) bool); ok {
r0 = rf(_a0)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockPodContainerManager_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists'
type MockPodContainerManager_Exists_Call struct {
*mock.Call
}
// Exists is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockPodContainerManager_Expecter) Exists(_a0 interface{}) *MockPodContainerManager_Exists_Call {
return &MockPodContainerManager_Exists_Call{Call: _e.mock.On("Exists", _a0)}
}
func (_c *MockPodContainerManager_Exists_Call) Run(run func(_a0 *v1.Pod)) *MockPodContainerManager_Exists_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
})
return _c
}
func (_c *MockPodContainerManager_Exists_Call) Return(_a0 bool) *MockPodContainerManager_Exists_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockPodContainerManager_Exists_Call) RunAndReturn(run func(*v1.Pod) bool) *MockPodContainerManager_Exists_Call {
_c.Call.Return(run)
return _c
}
// GetAllPodsFromCgroups provides a mock function with no fields
func (_m *MockPodContainerManager) GetAllPodsFromCgroups() (map[types.UID]cm.CgroupName, error) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetAllPodsFromCgroups")
}
var r0 map[types.UID]cm.CgroupName
var r1 error
if rf, ok := ret.Get(0).(func() (map[types.UID]cm.CgroupName, error)); ok {
return rf()
}
if rf, ok := ret.Get(0).(func() map[types.UID]cm.CgroupName); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[types.UID]cm.CgroupName)
}
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockPodContainerManager_GetAllPodsFromCgroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllPodsFromCgroups'
type MockPodContainerManager_GetAllPodsFromCgroups_Call struct {
*mock.Call
}
// GetAllPodsFromCgroups is a helper method to define mock.On call
func (_e *MockPodContainerManager_Expecter) GetAllPodsFromCgroups() *MockPodContainerManager_GetAllPodsFromCgroups_Call {
return &MockPodContainerManager_GetAllPodsFromCgroups_Call{Call: _e.mock.On("GetAllPodsFromCgroups")}
}
func (_c *MockPodContainerManager_GetAllPodsFromCgroups_Call) Run(run func()) *MockPodContainerManager_GetAllPodsFromCgroups_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockPodContainerManager_GetAllPodsFromCgroups_Call) Return(_a0 map[types.UID]cm.CgroupName, _a1 error) *MockPodContainerManager_GetAllPodsFromCgroups_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockPodContainerManager_GetAllPodsFromCgroups_Call) RunAndReturn(run func() (map[types.UID]cm.CgroupName, error)) *MockPodContainerManager_GetAllPodsFromCgroups_Call {
_c.Call.Return(run)
return _c
}
// GetPodCgroupConfig provides a mock function with given fields: pod, resource
func (_m *MockPodContainerManager) GetPodCgroupConfig(pod *v1.Pod, resource v1.ResourceName) (*cm.ResourceConfig, error) {
ret := _m.Called(pod, resource)
if len(ret) == 0 {
panic("no return value specified for GetPodCgroupConfig")
}
var r0 *cm.ResourceConfig
var r1 error
if rf, ok := ret.Get(0).(func(*v1.Pod, v1.ResourceName) (*cm.ResourceConfig, error)); ok {
return rf(pod, resource)
}
if rf, ok := ret.Get(0).(func(*v1.Pod, v1.ResourceName) *cm.ResourceConfig); ok {
r0 = rf(pod, resource)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*cm.ResourceConfig)
}
}
if rf, ok := ret.Get(1).(func(*v1.Pod, v1.ResourceName) error); ok {
r1 = rf(pod, resource)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockPodContainerManager_GetPodCgroupConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodCgroupConfig'
type MockPodContainerManager_GetPodCgroupConfig_Call struct {
*mock.Call
}
// GetPodCgroupConfig is a helper method to define mock.On call
// - pod *v1.Pod
// - resource v1.ResourceName
func (_e *MockPodContainerManager_Expecter) GetPodCgroupConfig(pod interface{}, resource interface{}) *MockPodContainerManager_GetPodCgroupConfig_Call {
return &MockPodContainerManager_GetPodCgroupConfig_Call{Call: _e.mock.On("GetPodCgroupConfig", pod, resource)}
}
func (_c *MockPodContainerManager_GetPodCgroupConfig_Call) Run(run func(pod *v1.Pod, resource v1.ResourceName)) *MockPodContainerManager_GetPodCgroupConfig_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod), args[1].(v1.ResourceName))
})
return _c
}
func (_c *MockPodContainerManager_GetPodCgroupConfig_Call) Return(_a0 *cm.ResourceConfig, _a1 error) *MockPodContainerManager_GetPodCgroupConfig_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockPodContainerManager_GetPodCgroupConfig_Call) RunAndReturn(run func(*v1.Pod, v1.ResourceName) (*cm.ResourceConfig, error)) *MockPodContainerManager_GetPodCgroupConfig_Call {
_c.Call.Return(run)
return _c
}
// GetPodCgroupMemoryUsage provides a mock function with given fields: pod
func (_m *MockPodContainerManager) GetPodCgroupMemoryUsage(pod *v1.Pod) (uint64, error) {
ret := _m.Called(pod)
if len(ret) == 0 {
panic("no return value specified for GetPodCgroupMemoryUsage")
}
var r0 uint64
var r1 error
if rf, ok := ret.Get(0).(func(*v1.Pod) (uint64, error)); ok {
return rf(pod)
}
if rf, ok := ret.Get(0).(func(*v1.Pod) uint64); ok {
r0 = rf(pod)
} else {
r0 = ret.Get(0).(uint64)
}
if rf, ok := ret.Get(1).(func(*v1.Pod) error); ok {
r1 = rf(pod)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockPodContainerManager_GetPodCgroupMemoryUsage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodCgroupMemoryUsage'
type MockPodContainerManager_GetPodCgroupMemoryUsage_Call struct {
*mock.Call
}
// GetPodCgroupMemoryUsage is a helper method to define mock.On call
// - pod *v1.Pod
func (_e *MockPodContainerManager_Expecter) GetPodCgroupMemoryUsage(pod interface{}) *MockPodContainerManager_GetPodCgroupMemoryUsage_Call {
return &MockPodContainerManager_GetPodCgroupMemoryUsage_Call{Call: _e.mock.On("GetPodCgroupMemoryUsage", pod)}
}
func (_c *MockPodContainerManager_GetPodCgroupMemoryUsage_Call) Run(run func(pod *v1.Pod)) *MockPodContainerManager_GetPodCgroupMemoryUsage_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
})
return _c
}
func (_c *MockPodContainerManager_GetPodCgroupMemoryUsage_Call) Return(_a0 uint64, _a1 error) *MockPodContainerManager_GetPodCgroupMemoryUsage_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockPodContainerManager_GetPodCgroupMemoryUsage_Call) RunAndReturn(run func(*v1.Pod) (uint64, error)) *MockPodContainerManager_GetPodCgroupMemoryUsage_Call {
_c.Call.Return(run)
return _c
}
// GetPodContainerName provides a mock function with given fields: _a0
func (_m *MockPodContainerManager) GetPodContainerName(_a0 *v1.Pod) (cm.CgroupName, string) {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for GetPodContainerName")
}
var r0 cm.CgroupName
var r1 string
if rf, ok := ret.Get(0).(func(*v1.Pod) (cm.CgroupName, string)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(*v1.Pod) cm.CgroupName); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(cm.CgroupName)
}
}
if rf, ok := ret.Get(1).(func(*v1.Pod) string); ok {
r1 = rf(_a0)
} else {
r1 = ret.Get(1).(string)
}
return r0, r1
}
// MockPodContainerManager_GetPodContainerName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodContainerName'
type MockPodContainerManager_GetPodContainerName_Call struct {
*mock.Call
}
// GetPodContainerName is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockPodContainerManager_Expecter) GetPodContainerName(_a0 interface{}) *MockPodContainerManager_GetPodContainerName_Call {
return &MockPodContainerManager_GetPodContainerName_Call{Call: _e.mock.On("GetPodContainerName", _a0)}
}
func (_c *MockPodContainerManager_GetPodContainerName_Call) Run(run func(_a0 *v1.Pod)) *MockPodContainerManager_GetPodContainerName_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
})
return _c
}
func (_c *MockPodContainerManager_GetPodContainerName_Call) Return(_a0 cm.CgroupName, _a1 string) *MockPodContainerManager_GetPodContainerName_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockPodContainerManager_GetPodContainerName_Call) RunAndReturn(run func(*v1.Pod) (cm.CgroupName, string)) *MockPodContainerManager_GetPodContainerName_Call {
_c.Call.Return(run)
return _c
}
// IsPodCgroup provides a mock function with given fields: cgroupfs
func (_m *MockPodContainerManager) IsPodCgroup(cgroupfs string) (bool, types.UID) {
ret := _m.Called(cgroupfs)
if len(ret) == 0 {
panic("no return value specified for IsPodCgroup")
}
var r0 bool
var r1 types.UID
if rf, ok := ret.Get(0).(func(string) (bool, types.UID)); ok {
return rf(cgroupfs)
}
if rf, ok := ret.Get(0).(func(string) bool); ok {
r0 = rf(cgroupfs)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(string) types.UID); ok {
r1 = rf(cgroupfs)
} else {
r1 = ret.Get(1).(types.UID)
}
return r0, r1
}
// MockPodContainerManager_IsPodCgroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPodCgroup'
type MockPodContainerManager_IsPodCgroup_Call struct {
*mock.Call
}
// IsPodCgroup is a helper method to define mock.On call
// - cgroupfs string
func (_e *MockPodContainerManager_Expecter) IsPodCgroup(cgroupfs interface{}) *MockPodContainerManager_IsPodCgroup_Call {
return &MockPodContainerManager_IsPodCgroup_Call{Call: _e.mock.On("IsPodCgroup", cgroupfs)}
}
func (_c *MockPodContainerManager_IsPodCgroup_Call) Run(run func(cgroupfs string)) *MockPodContainerManager_IsPodCgroup_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
})
return _c
}
func (_c *MockPodContainerManager_IsPodCgroup_Call) Return(_a0 bool, _a1 types.UID) *MockPodContainerManager_IsPodCgroup_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockPodContainerManager_IsPodCgroup_Call) RunAndReturn(run func(string) (bool, types.UID)) *MockPodContainerManager_IsPodCgroup_Call {
_c.Call.Return(run)
return _c
}
// ReduceCPULimits provides a mock function with given fields: name
func (_m *MockPodContainerManager) ReduceCPULimits(name cm.CgroupName) error {
ret := _m.Called(name)
if len(ret) == 0 {
panic("no return value specified for ReduceCPULimits")
}
var r0 error
if rf, ok := ret.Get(0).(func(cm.CgroupName) error); ok {
r0 = rf(name)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockPodContainerManager_ReduceCPULimits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReduceCPULimits'
type MockPodContainerManager_ReduceCPULimits_Call struct {
*mock.Call
}
// ReduceCPULimits is a helper method to define mock.On call
// - name cm.CgroupName
func (_e *MockPodContainerManager_Expecter) ReduceCPULimits(name interface{}) *MockPodContainerManager_ReduceCPULimits_Call {
return &MockPodContainerManager_ReduceCPULimits_Call{Call: _e.mock.On("ReduceCPULimits", name)}
}
func (_c *MockPodContainerManager_ReduceCPULimits_Call) Run(run func(name cm.CgroupName)) *MockPodContainerManager_ReduceCPULimits_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(cm.CgroupName))
})
return _c
}
func (_c *MockPodContainerManager_ReduceCPULimits_Call) Return(_a0 error) *MockPodContainerManager_ReduceCPULimits_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockPodContainerManager_ReduceCPULimits_Call) RunAndReturn(run func(cm.CgroupName) error) *MockPodContainerManager_ReduceCPULimits_Call {
_c.Call.Return(run)
return _c
}
// SetPodCgroupConfig provides a mock function with given fields: pod, resourceConfig
func (_m *MockPodContainerManager) SetPodCgroupConfig(pod *v1.Pod, resourceConfig *cm.ResourceConfig) error {
ret := _m.Called(pod, resourceConfig)
if len(ret) == 0 {
panic("no return value specified for SetPodCgroupConfig")
}
var r0 error
if rf, ok := ret.Get(0).(func(*v1.Pod, *cm.ResourceConfig) error); ok {
r0 = rf(pod, resourceConfig)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockPodContainerManager_SetPodCgroupConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPodCgroupConfig'
type MockPodContainerManager_SetPodCgroupConfig_Call struct {
*mock.Call
}
// SetPodCgroupConfig is a helper method to define mock.On call
// - pod *v1.Pod
// - resourceConfig *cm.ResourceConfig
func (_e *MockPodContainerManager_Expecter) SetPodCgroupConfig(pod interface{}, resourceConfig interface{}) *MockPodContainerManager_SetPodCgroupConfig_Call {
return &MockPodContainerManager_SetPodCgroupConfig_Call{Call: _e.mock.On("SetPodCgroupConfig", pod, resourceConfig)}
}
func (_c *MockPodContainerManager_SetPodCgroupConfig_Call) Run(run func(pod *v1.Pod, resourceConfig *cm.ResourceConfig)) *MockPodContainerManager_SetPodCgroupConfig_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod), args[1].(*cm.ResourceConfig))
})
return _c
}
func (_c *MockPodContainerManager_SetPodCgroupConfig_Call) Return(_a0 error) *MockPodContainerManager_SetPodCgroupConfig_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockPodContainerManager_SetPodCgroupConfig_Call) RunAndReturn(run func(*v1.Pod, *cm.ResourceConfig) error) *MockPodContainerManager_SetPodCgroupConfig_Call {
_c.Call.Return(run)
return _c
}
// NewMockPodContainerManager creates a new instance of MockPodContainerManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockPodContainerManager(t interface {
mock.TestingT
Cleanup(func())
}) *MockPodContainerManager {
mock := &MockPodContainerManager{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1,19 @@
---
dir: testing
filename: "mock_{{.InterfaceName | snakecase}}.go"
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: testing
with-expecter: true
pkgname: testing
template: testify
template-data:
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
io/fs:
config:
filename: mockdirentry.go
interfaces:
DirEntry:
config:
filename: mockdirentry.go
DirEntry: {}
k8s.io/kubernetes/pkg/kubelet/container:
config:
filename: mocks.go
interfaces:
Runtime:
config:
filename: runtime_mock.go
RuntimeCache:
Runtime: {}
RuntimeCache: {}

View file

@ -1,161 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import (
context "context"
container "k8s.io/kubernetes/pkg/kubelet/container"
mock "github.com/stretchr/testify/mock"
time "time"
)
// MockRuntimeCache is an autogenerated mock type for the RuntimeCache type
type MockRuntimeCache struct {
mock.Mock
}
type MockRuntimeCache_Expecter struct {
mock *mock.Mock
}
func (_m *MockRuntimeCache) EXPECT() *MockRuntimeCache_Expecter {
return &MockRuntimeCache_Expecter{mock: &_m.Mock}
}
// ForceUpdateIfOlder provides a mock function with given fields: _a0, _a1
func (_m *MockRuntimeCache) ForceUpdateIfOlder(_a0 context.Context, _a1 time.Time) error {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ForceUpdateIfOlder")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, time.Time) error); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockRuntimeCache_ForceUpdateIfOlder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForceUpdateIfOlder'
type MockRuntimeCache_ForceUpdateIfOlder_Call struct {
*mock.Call
}
// ForceUpdateIfOlder is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 time.Time
func (_e *MockRuntimeCache_Expecter) ForceUpdateIfOlder(_a0 interface{}, _a1 interface{}) *MockRuntimeCache_ForceUpdateIfOlder_Call {
return &MockRuntimeCache_ForceUpdateIfOlder_Call{Call: _e.mock.On("ForceUpdateIfOlder", _a0, _a1)}
}
func (_c *MockRuntimeCache_ForceUpdateIfOlder_Call) Run(run func(_a0 context.Context, _a1 time.Time)) *MockRuntimeCache_ForceUpdateIfOlder_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(time.Time))
})
return _c
}
func (_c *MockRuntimeCache_ForceUpdateIfOlder_Call) Return(_a0 error) *MockRuntimeCache_ForceUpdateIfOlder_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockRuntimeCache_ForceUpdateIfOlder_Call) RunAndReturn(run func(context.Context, time.Time) error) *MockRuntimeCache_ForceUpdateIfOlder_Call {
_c.Call.Return(run)
return _c
}
// GetPods provides a mock function with given fields: _a0
func (_m *MockRuntimeCache) GetPods(_a0 context.Context) ([]*container.Pod, error) {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for GetPods")
}
var r0 []*container.Pod
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) ([]*container.Pod, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(context.Context) []*container.Pod); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*container.Pod)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockRuntimeCache_GetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPods'
type MockRuntimeCache_GetPods_Call struct {
*mock.Call
}
// GetPods is a helper method to define mock.On call
// - _a0 context.Context
func (_e *MockRuntimeCache_Expecter) GetPods(_a0 interface{}) *MockRuntimeCache_GetPods_Call {
return &MockRuntimeCache_GetPods_Call{Call: _e.mock.On("GetPods", _a0)}
}
func (_c *MockRuntimeCache_GetPods_Call) Run(run func(_a0 context.Context)) *MockRuntimeCache_GetPods_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *MockRuntimeCache_GetPods_Call) Return(_a0 []*container.Pod, _a1 error) *MockRuntimeCache_GetPods_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockRuntimeCache_GetPods_Call) RunAndReturn(run func(context.Context) ([]*container.Pod, error)) *MockRuntimeCache_GetPods_Call {
_c.Call.Return(run)
return _c
}
// NewMockRuntimeCache creates a new instance of MockRuntimeCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockRuntimeCache(t interface {
mock.TestingT
Cleanup(func())
}) *MockRuntimeCache {
mock := &MockRuntimeCache{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -14,16 +14,32 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package testing
import (
fs "io/fs"
"io/fs"
mock "github.com/stretchr/testify/mock"
)
// NewMockDirEntry creates a new instance of MockDirEntry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockDirEntry(t interface {
mock.TestingT
Cleanup(func())
}) *MockDirEntry {
mock := &MockDirEntry{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockDirEntry is an autogenerated mock type for the DirEntry type
type MockDirEntry struct {
mock.Mock
@ -37,9 +53,9 @@ func (_m *MockDirEntry) EXPECT() *MockDirEntry_Expecter {
return &MockDirEntry_Expecter{mock: &_m.Mock}
}
// Info provides a mock function with no fields
func (_m *MockDirEntry) Info() (fs.FileInfo, error) {
ret := _m.Called()
// Info provides a mock function for the type MockDirEntry
func (_mock *MockDirEntry) Info() (fs.FileInfo, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Info")
@ -47,23 +63,21 @@ func (_m *MockDirEntry) Info() (fs.FileInfo, error) {
var r0 fs.FileInfo
var r1 error
if rf, ok := ret.Get(0).(func() (fs.FileInfo, error)); ok {
return rf()
if returnFunc, ok := ret.Get(0).(func() (fs.FileInfo, error)); ok {
return returnFunc()
}
if rf, ok := ret.Get(0).(func() fs.FileInfo); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() fs.FileInfo); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(fs.FileInfo)
}
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@ -84,8 +98,8 @@ func (_c *MockDirEntry_Info_Call) Run(run func()) *MockDirEntry_Info_Call {
return _c
}
func (_c *MockDirEntry_Info_Call) Return(_a0 fs.FileInfo, _a1 error) *MockDirEntry_Info_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockDirEntry_Info_Call) Return(fileInfo fs.FileInfo, err error) *MockDirEntry_Info_Call {
_c.Call.Return(fileInfo, err)
return _c
}
@ -94,21 +108,20 @@ func (_c *MockDirEntry_Info_Call) RunAndReturn(run func() (fs.FileInfo, error))
return _c
}
// IsDir provides a mock function with no fields
func (_m *MockDirEntry) IsDir() bool {
ret := _m.Called()
// IsDir provides a mock function for the type MockDirEntry
func (_mock *MockDirEntry) IsDir() bool {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for IsDir")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() bool); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
@ -129,8 +142,8 @@ func (_c *MockDirEntry_IsDir_Call) Run(run func()) *MockDirEntry_IsDir_Call {
return _c
}
func (_c *MockDirEntry_IsDir_Call) Return(_a0 bool) *MockDirEntry_IsDir_Call {
_c.Call.Return(_a0)
func (_c *MockDirEntry_IsDir_Call) Return(b bool) *MockDirEntry_IsDir_Call {
_c.Call.Return(b)
return _c
}
@ -139,21 +152,20 @@ func (_c *MockDirEntry_IsDir_Call) RunAndReturn(run func() bool) *MockDirEntry_I
return _c
}
// Name provides a mock function with no fields
func (_m *MockDirEntry) Name() string {
ret := _m.Called()
// Name provides a mock function for the type MockDirEntry
func (_mock *MockDirEntry) Name() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Name")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
@ -174,8 +186,8 @@ func (_c *MockDirEntry_Name_Call) Run(run func()) *MockDirEntry_Name_Call {
return _c
}
func (_c *MockDirEntry_Name_Call) Return(_a0 string) *MockDirEntry_Name_Call {
_c.Call.Return(_a0)
func (_c *MockDirEntry_Name_Call) Return(s string) *MockDirEntry_Name_Call {
_c.Call.Return(s)
return _c
}
@ -184,21 +196,20 @@ func (_c *MockDirEntry_Name_Call) RunAndReturn(run func() string) *MockDirEntry_
return _c
}
// Type provides a mock function with no fields
func (_m *MockDirEntry) Type() fs.FileMode {
ret := _m.Called()
// Type provides a mock function for the type MockDirEntry
func (_mock *MockDirEntry) Type() fs.FileMode {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Type")
}
var r0 fs.FileMode
if rf, ok := ret.Get(0).(func() fs.FileMode); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() fs.FileMode); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(fs.FileMode)
}
return r0
}
@ -219,8 +230,8 @@ func (_c *MockDirEntry_Type_Call) Run(run func()) *MockDirEntry_Type_Call {
return _c
}
func (_c *MockDirEntry_Type_Call) Return(_a0 fs.FileMode) *MockDirEntry_Type_Call {
_c.Call.Return(_a0)
func (_c *MockDirEntry_Type_Call) Return(fileMode fs.FileMode) *MockDirEntry_Type_Call {
_c.Call.Return(fileMode)
return _c
}
@ -228,17 +239,3 @@ func (_c *MockDirEntry_Type_Call) RunAndReturn(run func() fs.FileMode) *MockDirE
_c.Call.Return(run)
return _c
}
// NewMockDirEntry creates a new instance of MockDirEntry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockDirEntry(t interface {
mock.TestingT
Cleanup(func())
}) *MockDirEntry {
mock := &MockDirEntry{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,12 @@
---
dir: .
filename: "mock_{{.InterfaceName | snakecase}}_test.go"
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
inpackage: true
with-expecter: true
template: testify
template-data:
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/pkg/kubelet/eviction:
interfaces:
CgroupNotifier:
NotifierFactory:
ThresholdNotifier:
CgroupNotifier: {}
NotifierFactory: {}
ThresholdNotifier: {}

View file

@ -1,113 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package eviction
import mock "github.com/stretchr/testify/mock"
// MockCgroupNotifier is an autogenerated mock type for the CgroupNotifier type
type MockCgroupNotifier struct {
mock.Mock
}
type MockCgroupNotifier_Expecter struct {
mock *mock.Mock
}
func (_m *MockCgroupNotifier) EXPECT() *MockCgroupNotifier_Expecter {
return &MockCgroupNotifier_Expecter{mock: &_m.Mock}
}
// Start provides a mock function with given fields: eventCh
func (_m *MockCgroupNotifier) Start(eventCh chan<- struct{}) {
_m.Called(eventCh)
}
// MockCgroupNotifier_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
type MockCgroupNotifier_Start_Call struct {
*mock.Call
}
// Start is a helper method to define mock.On call
// - eventCh chan<- struct{}
func (_e *MockCgroupNotifier_Expecter) Start(eventCh interface{}) *MockCgroupNotifier_Start_Call {
return &MockCgroupNotifier_Start_Call{Call: _e.mock.On("Start", eventCh)}
}
func (_c *MockCgroupNotifier_Start_Call) Run(run func(eventCh chan<- struct{})) *MockCgroupNotifier_Start_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(chan<- struct{}))
})
return _c
}
func (_c *MockCgroupNotifier_Start_Call) Return() *MockCgroupNotifier_Start_Call {
_c.Call.Return()
return _c
}
func (_c *MockCgroupNotifier_Start_Call) RunAndReturn(run func(chan<- struct{})) *MockCgroupNotifier_Start_Call {
_c.Run(run)
return _c
}
// Stop provides a mock function with no fields
func (_m *MockCgroupNotifier) Stop() {
_m.Called()
}
// MockCgroupNotifier_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
type MockCgroupNotifier_Stop_Call struct {
*mock.Call
}
// Stop is a helper method to define mock.On call
func (_e *MockCgroupNotifier_Expecter) Stop() *MockCgroupNotifier_Stop_Call {
return &MockCgroupNotifier_Stop_Call{Call: _e.mock.On("Stop")}
}
func (_c *MockCgroupNotifier_Stop_Call) Run(run func()) *MockCgroupNotifier_Stop_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockCgroupNotifier_Stop_Call) Return() *MockCgroupNotifier_Stop_Call {
_c.Call.Return()
return _c
}
func (_c *MockCgroupNotifier_Stop_Call) RunAndReturn(run func()) *MockCgroupNotifier_Stop_Call {
_c.Run(run)
return _c
}
// NewMockCgroupNotifier creates a new instance of MockCgroupNotifier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockCgroupNotifier(t interface {
mock.TestingT
Cleanup(func())
}) *MockCgroupNotifier {
mock := &MockCgroupNotifier{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,108 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package eviction
import mock "github.com/stretchr/testify/mock"
// MockNotifierFactory is an autogenerated mock type for the NotifierFactory type
type MockNotifierFactory struct {
mock.Mock
}
type MockNotifierFactory_Expecter struct {
mock *mock.Mock
}
func (_m *MockNotifierFactory) EXPECT() *MockNotifierFactory_Expecter {
return &MockNotifierFactory_Expecter{mock: &_m.Mock}
}
// NewCgroupNotifier provides a mock function with given fields: path, attribute, threshold
func (_m *MockNotifierFactory) NewCgroupNotifier(path string, attribute string, threshold int64) (CgroupNotifier, error) {
ret := _m.Called(path, attribute, threshold)
if len(ret) == 0 {
panic("no return value specified for NewCgroupNotifier")
}
var r0 CgroupNotifier
var r1 error
if rf, ok := ret.Get(0).(func(string, string, int64) (CgroupNotifier, error)); ok {
return rf(path, attribute, threshold)
}
if rf, ok := ret.Get(0).(func(string, string, int64) CgroupNotifier); ok {
r0 = rf(path, attribute, threshold)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(CgroupNotifier)
}
}
if rf, ok := ret.Get(1).(func(string, string, int64) error); ok {
r1 = rf(path, attribute, threshold)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNotifierFactory_NewCgroupNotifier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewCgroupNotifier'
type MockNotifierFactory_NewCgroupNotifier_Call struct {
*mock.Call
}
// NewCgroupNotifier is a helper method to define mock.On call
// - path string
// - attribute string
// - threshold int64
func (_e *MockNotifierFactory_Expecter) NewCgroupNotifier(path interface{}, attribute interface{}, threshold interface{}) *MockNotifierFactory_NewCgroupNotifier_Call {
return &MockNotifierFactory_NewCgroupNotifier_Call{Call: _e.mock.On("NewCgroupNotifier", path, attribute, threshold)}
}
func (_c *MockNotifierFactory_NewCgroupNotifier_Call) Run(run func(path string, attribute string, threshold int64)) *MockNotifierFactory_NewCgroupNotifier_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string), args[2].(int64))
})
return _c
}
func (_c *MockNotifierFactory_NewCgroupNotifier_Call) Return(_a0 CgroupNotifier, _a1 error) *MockNotifierFactory_NewCgroupNotifier_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNotifierFactory_NewCgroupNotifier_Call) RunAndReturn(run func(string, string, int64) (CgroupNotifier, error)) *MockNotifierFactory_NewCgroupNotifier_Call {
_c.Call.Return(run)
return _c
}
// NewMockNotifierFactory creates a new instance of MockNotifierFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockNotifierFactory(t interface {
mock.TestingT
Cleanup(func())
}) *MockNotifierFactory {
mock := &MockNotifierFactory{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,174 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package eviction
import (
mock "github.com/stretchr/testify/mock"
v1alpha1 "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
)
// MockThresholdNotifier is an autogenerated mock type for the ThresholdNotifier type
type MockThresholdNotifier struct {
mock.Mock
}
type MockThresholdNotifier_Expecter struct {
mock *mock.Mock
}
func (_m *MockThresholdNotifier) EXPECT() *MockThresholdNotifier_Expecter {
return &MockThresholdNotifier_Expecter{mock: &_m.Mock}
}
// Description provides a mock function with no fields
func (_m *MockThresholdNotifier) Description() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Description")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockThresholdNotifier_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description'
type MockThresholdNotifier_Description_Call struct {
*mock.Call
}
// Description is a helper method to define mock.On call
func (_e *MockThresholdNotifier_Expecter) Description() *MockThresholdNotifier_Description_Call {
return &MockThresholdNotifier_Description_Call{Call: _e.mock.On("Description")}
}
func (_c *MockThresholdNotifier_Description_Call) Run(run func()) *MockThresholdNotifier_Description_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockThresholdNotifier_Description_Call) Return(_a0 string) *MockThresholdNotifier_Description_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockThresholdNotifier_Description_Call) RunAndReturn(run func() string) *MockThresholdNotifier_Description_Call {
_c.Call.Return(run)
return _c
}
// Start provides a mock function with no fields
func (_m *MockThresholdNotifier) Start() {
_m.Called()
}
// MockThresholdNotifier_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
type MockThresholdNotifier_Start_Call struct {
*mock.Call
}
// Start is a helper method to define mock.On call
func (_e *MockThresholdNotifier_Expecter) Start() *MockThresholdNotifier_Start_Call {
return &MockThresholdNotifier_Start_Call{Call: _e.mock.On("Start")}
}
func (_c *MockThresholdNotifier_Start_Call) Run(run func()) *MockThresholdNotifier_Start_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockThresholdNotifier_Start_Call) Return() *MockThresholdNotifier_Start_Call {
_c.Call.Return()
return _c
}
func (_c *MockThresholdNotifier_Start_Call) RunAndReturn(run func()) *MockThresholdNotifier_Start_Call {
_c.Run(run)
return _c
}
// UpdateThreshold provides a mock function with given fields: summary
func (_m *MockThresholdNotifier) UpdateThreshold(summary *v1alpha1.Summary) error {
ret := _m.Called(summary)
if len(ret) == 0 {
panic("no return value specified for UpdateThreshold")
}
var r0 error
if rf, ok := ret.Get(0).(func(*v1alpha1.Summary) error); ok {
r0 = rf(summary)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockThresholdNotifier_UpdateThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateThreshold'
type MockThresholdNotifier_UpdateThreshold_Call struct {
*mock.Call
}
// UpdateThreshold is a helper method to define mock.On call
// - summary *v1alpha1.Summary
func (_e *MockThresholdNotifier_Expecter) UpdateThreshold(summary interface{}) *MockThresholdNotifier_UpdateThreshold_Call {
return &MockThresholdNotifier_UpdateThreshold_Call{Call: _e.mock.On("UpdateThreshold", summary)}
}
func (_c *MockThresholdNotifier_UpdateThreshold_Call) Run(run func(summary *v1alpha1.Summary)) *MockThresholdNotifier_UpdateThreshold_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1alpha1.Summary))
})
return _c
}
func (_c *MockThresholdNotifier_UpdateThreshold_Call) Return(_a0 error) *MockThresholdNotifier_UpdateThreshold_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockThresholdNotifier_UpdateThreshold_Call) RunAndReturn(run func(*v1alpha1.Summary) error) *MockThresholdNotifier_UpdateThreshold_Call {
_c.Call.Return(run)
return _c
}
// NewMockThresholdNotifier creates a new instance of MockThresholdNotifier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockThresholdNotifier(t interface {
mock.TestingT
Cleanup(func())
}) *MockThresholdNotifier {
mock := &MockThresholdNotifier{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -0,0 +1,382 @@
/*
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.
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.
*/
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package eviction
import (
mock "github.com/stretchr/testify/mock"
"k8s.io/kubelet/pkg/apis/stats/v1alpha1"
)
// NewMockCgroupNotifier creates a new instance of MockCgroupNotifier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockCgroupNotifier(t interface {
mock.TestingT
Cleanup(func())
}) *MockCgroupNotifier {
mock := &MockCgroupNotifier{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockCgroupNotifier is an autogenerated mock type for the CgroupNotifier type
type MockCgroupNotifier struct {
mock.Mock
}
type MockCgroupNotifier_Expecter struct {
mock *mock.Mock
}
func (_m *MockCgroupNotifier) EXPECT() *MockCgroupNotifier_Expecter {
return &MockCgroupNotifier_Expecter{mock: &_m.Mock}
}
// Start provides a mock function for the type MockCgroupNotifier
func (_mock *MockCgroupNotifier) Start(eventCh chan<- struct{}) {
_mock.Called(eventCh)
return
}
// MockCgroupNotifier_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
type MockCgroupNotifier_Start_Call struct {
*mock.Call
}
// Start is a helper method to define mock.On call
// - eventCh chan<- struct{}
func (_e *MockCgroupNotifier_Expecter) Start(eventCh interface{}) *MockCgroupNotifier_Start_Call {
return &MockCgroupNotifier_Start_Call{Call: _e.mock.On("Start", eventCh)}
}
func (_c *MockCgroupNotifier_Start_Call) Run(run func(eventCh chan<- struct{})) *MockCgroupNotifier_Start_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 chan<- struct{}
if args[0] != nil {
arg0 = args[0].(chan<- struct{})
}
run(
arg0,
)
})
return _c
}
func (_c *MockCgroupNotifier_Start_Call) Return() *MockCgroupNotifier_Start_Call {
_c.Call.Return()
return _c
}
func (_c *MockCgroupNotifier_Start_Call) RunAndReturn(run func(eventCh chan<- struct{})) *MockCgroupNotifier_Start_Call {
_c.Run(run)
return _c
}
// Stop provides a mock function for the type MockCgroupNotifier
func (_mock *MockCgroupNotifier) Stop() {
_mock.Called()
return
}
// MockCgroupNotifier_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
type MockCgroupNotifier_Stop_Call struct {
*mock.Call
}
// Stop is a helper method to define mock.On call
func (_e *MockCgroupNotifier_Expecter) Stop() *MockCgroupNotifier_Stop_Call {
return &MockCgroupNotifier_Stop_Call{Call: _e.mock.On("Stop")}
}
func (_c *MockCgroupNotifier_Stop_Call) Run(run func()) *MockCgroupNotifier_Stop_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockCgroupNotifier_Stop_Call) Return() *MockCgroupNotifier_Stop_Call {
_c.Call.Return()
return _c
}
func (_c *MockCgroupNotifier_Stop_Call) RunAndReturn(run func()) *MockCgroupNotifier_Stop_Call {
_c.Run(run)
return _c
}
// NewMockNotifierFactory creates a new instance of MockNotifierFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockNotifierFactory(t interface {
mock.TestingT
Cleanup(func())
}) *MockNotifierFactory {
mock := &MockNotifierFactory{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockNotifierFactory is an autogenerated mock type for the NotifierFactory type
type MockNotifierFactory struct {
mock.Mock
}
type MockNotifierFactory_Expecter struct {
mock *mock.Mock
}
func (_m *MockNotifierFactory) EXPECT() *MockNotifierFactory_Expecter {
return &MockNotifierFactory_Expecter{mock: &_m.Mock}
}
// NewCgroupNotifier provides a mock function for the type MockNotifierFactory
func (_mock *MockNotifierFactory) NewCgroupNotifier(path string, attribute string, threshold int64) (CgroupNotifier, error) {
ret := _mock.Called(path, attribute, threshold)
if len(ret) == 0 {
panic("no return value specified for NewCgroupNotifier")
}
var r0 CgroupNotifier
var r1 error
if returnFunc, ok := ret.Get(0).(func(string, string, int64) (CgroupNotifier, error)); ok {
return returnFunc(path, attribute, threshold)
}
if returnFunc, ok := ret.Get(0).(func(string, string, int64) CgroupNotifier); ok {
r0 = returnFunc(path, attribute, threshold)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(CgroupNotifier)
}
}
if returnFunc, ok := ret.Get(1).(func(string, string, int64) error); ok {
r1 = returnFunc(path, attribute, threshold)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNotifierFactory_NewCgroupNotifier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewCgroupNotifier'
type MockNotifierFactory_NewCgroupNotifier_Call struct {
*mock.Call
}
// NewCgroupNotifier is a helper method to define mock.On call
// - path string
// - attribute string
// - threshold int64
func (_e *MockNotifierFactory_Expecter) NewCgroupNotifier(path interface{}, attribute interface{}, threshold interface{}) *MockNotifierFactory_NewCgroupNotifier_Call {
return &MockNotifierFactory_NewCgroupNotifier_Call{Call: _e.mock.On("NewCgroupNotifier", path, attribute, threshold)}
}
func (_c *MockNotifierFactory_NewCgroupNotifier_Call) Run(run func(path string, attribute string, threshold int64)) *MockNotifierFactory_NewCgroupNotifier_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 int64
if args[2] != nil {
arg2 = args[2].(int64)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockNotifierFactory_NewCgroupNotifier_Call) Return(cgroupNotifier CgroupNotifier, err error) *MockNotifierFactory_NewCgroupNotifier_Call {
_c.Call.Return(cgroupNotifier, err)
return _c
}
func (_c *MockNotifierFactory_NewCgroupNotifier_Call) RunAndReturn(run func(path string, attribute string, threshold int64) (CgroupNotifier, error)) *MockNotifierFactory_NewCgroupNotifier_Call {
_c.Call.Return(run)
return _c
}
// NewMockThresholdNotifier creates a new instance of MockThresholdNotifier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockThresholdNotifier(t interface {
mock.TestingT
Cleanup(func())
}) *MockThresholdNotifier {
mock := &MockThresholdNotifier{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockThresholdNotifier is an autogenerated mock type for the ThresholdNotifier type
type MockThresholdNotifier struct {
mock.Mock
}
type MockThresholdNotifier_Expecter struct {
mock *mock.Mock
}
func (_m *MockThresholdNotifier) EXPECT() *MockThresholdNotifier_Expecter {
return &MockThresholdNotifier_Expecter{mock: &_m.Mock}
}
// Description provides a mock function for the type MockThresholdNotifier
func (_mock *MockThresholdNotifier) Description() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Description")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockThresholdNotifier_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description'
type MockThresholdNotifier_Description_Call struct {
*mock.Call
}
// Description is a helper method to define mock.On call
func (_e *MockThresholdNotifier_Expecter) Description() *MockThresholdNotifier_Description_Call {
return &MockThresholdNotifier_Description_Call{Call: _e.mock.On("Description")}
}
func (_c *MockThresholdNotifier_Description_Call) Run(run func()) *MockThresholdNotifier_Description_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockThresholdNotifier_Description_Call) Return(s string) *MockThresholdNotifier_Description_Call {
_c.Call.Return(s)
return _c
}
func (_c *MockThresholdNotifier_Description_Call) RunAndReturn(run func() string) *MockThresholdNotifier_Description_Call {
_c.Call.Return(run)
return _c
}
// Start provides a mock function for the type MockThresholdNotifier
func (_mock *MockThresholdNotifier) Start() {
_mock.Called()
return
}
// MockThresholdNotifier_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
type MockThresholdNotifier_Start_Call struct {
*mock.Call
}
// Start is a helper method to define mock.On call
func (_e *MockThresholdNotifier_Expecter) Start() *MockThresholdNotifier_Start_Call {
return &MockThresholdNotifier_Start_Call{Call: _e.mock.On("Start")}
}
func (_c *MockThresholdNotifier_Start_Call) Run(run func()) *MockThresholdNotifier_Start_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockThresholdNotifier_Start_Call) Return() *MockThresholdNotifier_Start_Call {
_c.Call.Return()
return _c
}
func (_c *MockThresholdNotifier_Start_Call) RunAndReturn(run func()) *MockThresholdNotifier_Start_Call {
_c.Run(run)
return _c
}
// UpdateThreshold provides a mock function for the type MockThresholdNotifier
func (_mock *MockThresholdNotifier) UpdateThreshold(summary *v1alpha1.Summary) error {
ret := _mock.Called(summary)
if len(ret) == 0 {
panic("no return value specified for UpdateThreshold")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Summary) error); ok {
r0 = returnFunc(summary)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockThresholdNotifier_UpdateThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateThreshold'
type MockThresholdNotifier_UpdateThreshold_Call struct {
*mock.Call
}
// UpdateThreshold is a helper method to define mock.On call
// - summary *v1alpha1.Summary
func (_e *MockThresholdNotifier_Expecter) UpdateThreshold(summary interface{}) *MockThresholdNotifier_UpdateThreshold_Call {
return &MockThresholdNotifier_UpdateThreshold_Call{Call: _e.mock.On("UpdateThreshold", summary)}
}
func (_c *MockThresholdNotifier_UpdateThreshold_Call) Run(run func(summary *v1alpha1.Summary)) *MockThresholdNotifier_UpdateThreshold_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 *v1alpha1.Summary
if args[0] != nil {
arg0 = args[0].(*v1alpha1.Summary)
}
run(
arg0,
)
})
return _c
}
func (_c *MockThresholdNotifier_UpdateThreshold_Call) Return(err error) *MockThresholdNotifier_UpdateThreshold_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockThresholdNotifier_UpdateThreshold_Call) RunAndReturn(run func(summary *v1alpha1.Summary) error) *MockThresholdNotifier_UpdateThreshold_Call {
_c.Call.Return(run)
return _c
}

View file

@ -1,10 +1,12 @@
---
dir: testing
filename: "mock_{{.InterfaceName | snakecase}}.go"
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: testing
with-expecter: true
filename: mocks.go
pkgname: testing
template: testify
template-data:
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/pkg/kubelet/pod:
interfaces:
Manager:
Manager: {}

View file

@ -14,19 +14,33 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package testing
import (
mock "github.com/stretchr/testify/mock"
kubelettypes "k8s.io/kubernetes/pkg/kubelet/types"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
types0 "k8s.io/kubernetes/pkg/kubelet/types"
)
// NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockManager(t interface {
mock.TestingT
Cleanup(func())
}) *MockManager {
mock := &MockManager{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockManager is an autogenerated mock type for the Manager type
type MockManager struct {
mock.Mock
@ -40,9 +54,10 @@ func (_m *MockManager) EXPECT() *MockManager_Expecter {
return &MockManager_Expecter{mock: &_m.Mock}
}
// AddPod provides a mock function with given fields: _a0
func (_m *MockManager) AddPod(_a0 *v1.Pod) {
_m.Called(_a0)
// AddPod provides a mock function for the type MockManager
func (_mock *MockManager) AddPod(pod *v1.Pod) {
_mock.Called(pod)
return
}
// MockManager_AddPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPod'
@ -51,14 +66,20 @@ type MockManager_AddPod_Call struct {
}
// AddPod is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockManager_Expecter) AddPod(_a0 interface{}) *MockManager_AddPod_Call {
return &MockManager_AddPod_Call{Call: _e.mock.On("AddPod", _a0)}
// - pod *v1.Pod
func (_e *MockManager_Expecter) AddPod(pod interface{}) *MockManager_AddPod_Call {
return &MockManager_AddPod_Call{Call: _e.mock.On("AddPod", pod)}
}
func (_c *MockManager_AddPod_Call) Run(run func(_a0 *v1.Pod)) *MockManager_AddPod_Call {
func (_c *MockManager_AddPod_Call) Run(run func(pod *v1.Pod)) *MockManager_AddPod_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
var arg0 *v1.Pod
if args[0] != nil {
arg0 = args[0].(*v1.Pod)
}
run(
arg0,
)
})
return _c
}
@ -68,14 +89,14 @@ func (_c *MockManager_AddPod_Call) Return() *MockManager_AddPod_Call {
return _c
}
func (_c *MockManager_AddPod_Call) RunAndReturn(run func(*v1.Pod)) *MockManager_AddPod_Call {
func (_c *MockManager_AddPod_Call) RunAndReturn(run func(pod *v1.Pod)) *MockManager_AddPod_Call {
_c.Run(run)
return _c
}
// GetMirrorPodByPod provides a mock function with given fields: _a0
func (_m *MockManager) GetMirrorPodByPod(_a0 *v1.Pod) (*v1.Pod, bool) {
ret := _m.Called(_a0)
// GetMirrorPodByPod provides a mock function for the type MockManager
func (_mock *MockManager) GetMirrorPodByPod(pod *v1.Pod) (*v1.Pod, bool) {
ret := _mock.Called(pod)
if len(ret) == 0 {
panic("no return value specified for GetMirrorPodByPod")
@ -83,23 +104,21 @@ func (_m *MockManager) GetMirrorPodByPod(_a0 *v1.Pod) (*v1.Pod, bool) {
var r0 *v1.Pod
var r1 bool
if rf, ok := ret.Get(0).(func(*v1.Pod) (*v1.Pod, bool)); ok {
return rf(_a0)
if returnFunc, ok := ret.Get(0).(func(*v1.Pod) (*v1.Pod, bool)); ok {
return returnFunc(pod)
}
if rf, ok := ret.Get(0).(func(*v1.Pod) *v1.Pod); ok {
r0 = rf(_a0)
if returnFunc, ok := ret.Get(0).(func(*v1.Pod) *v1.Pod); ok {
r0 = returnFunc(pod)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func(*v1.Pod) bool); ok {
r1 = rf(_a0)
if returnFunc, ok := ret.Get(1).(func(*v1.Pod) bool); ok {
r1 = returnFunc(pod)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
@ -109,31 +128,37 @@ type MockManager_GetMirrorPodByPod_Call struct {
}
// GetMirrorPodByPod is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockManager_Expecter) GetMirrorPodByPod(_a0 interface{}) *MockManager_GetMirrorPodByPod_Call {
return &MockManager_GetMirrorPodByPod_Call{Call: _e.mock.On("GetMirrorPodByPod", _a0)}
// - pod *v1.Pod
func (_e *MockManager_Expecter) GetMirrorPodByPod(pod interface{}) *MockManager_GetMirrorPodByPod_Call {
return &MockManager_GetMirrorPodByPod_Call{Call: _e.mock.On("GetMirrorPodByPod", pod)}
}
func (_c *MockManager_GetMirrorPodByPod_Call) Run(run func(_a0 *v1.Pod)) *MockManager_GetMirrorPodByPod_Call {
func (_c *MockManager_GetMirrorPodByPod_Call) Run(run func(pod *v1.Pod)) *MockManager_GetMirrorPodByPod_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
var arg0 *v1.Pod
if args[0] != nil {
arg0 = args[0].(*v1.Pod)
}
run(
arg0,
)
})
return _c
}
func (_c *MockManager_GetMirrorPodByPod_Call) Return(_a0 *v1.Pod, _a1 bool) *MockManager_GetMirrorPodByPod_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockManager_GetMirrorPodByPod_Call) Return(pod1 *v1.Pod, b bool) *MockManager_GetMirrorPodByPod_Call {
_c.Call.Return(pod1, b)
return _c
}
func (_c *MockManager_GetMirrorPodByPod_Call) RunAndReturn(run func(*v1.Pod) (*v1.Pod, bool)) *MockManager_GetMirrorPodByPod_Call {
func (_c *MockManager_GetMirrorPodByPod_Call) RunAndReturn(run func(pod *v1.Pod) (*v1.Pod, bool)) *MockManager_GetMirrorPodByPod_Call {
_c.Call.Return(run)
return _c
}
// GetPodAndMirrorPod provides a mock function with given fields: _a0
func (_m *MockManager) GetPodAndMirrorPod(_a0 *v1.Pod) (*v1.Pod, *v1.Pod, bool) {
ret := _m.Called(_a0)
// GetPodAndMirrorPod provides a mock function for the type MockManager
func (_mock *MockManager) GetPodAndMirrorPod(pod *v1.Pod) (*v1.Pod, *v1.Pod, bool) {
ret := _mock.Called(pod)
if len(ret) == 0 {
panic("no return value specified for GetPodAndMirrorPod")
@ -142,31 +167,28 @@ func (_m *MockManager) GetPodAndMirrorPod(_a0 *v1.Pod) (*v1.Pod, *v1.Pod, bool)
var r0 *v1.Pod
var r1 *v1.Pod
var r2 bool
if rf, ok := ret.Get(0).(func(*v1.Pod) (*v1.Pod, *v1.Pod, bool)); ok {
return rf(_a0)
if returnFunc, ok := ret.Get(0).(func(*v1.Pod) (*v1.Pod, *v1.Pod, bool)); ok {
return returnFunc(pod)
}
if rf, ok := ret.Get(0).(func(*v1.Pod) *v1.Pod); ok {
r0 = rf(_a0)
if returnFunc, ok := ret.Get(0).(func(*v1.Pod) *v1.Pod); ok {
r0 = returnFunc(pod)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func(*v1.Pod) *v1.Pod); ok {
r1 = rf(_a0)
if returnFunc, ok := ret.Get(1).(func(*v1.Pod) *v1.Pod); ok {
r1 = returnFunc(pod)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*v1.Pod)
}
}
if rf, ok := ret.Get(2).(func(*v1.Pod) bool); ok {
r2 = rf(_a0)
if returnFunc, ok := ret.Get(2).(func(*v1.Pod) bool); ok {
r2 = returnFunc(pod)
} else {
r2 = ret.Get(2).(bool)
}
return r0, r1, r2
}
@ -176,31 +198,37 @@ type MockManager_GetPodAndMirrorPod_Call struct {
}
// GetPodAndMirrorPod is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockManager_Expecter) GetPodAndMirrorPod(_a0 interface{}) *MockManager_GetPodAndMirrorPod_Call {
return &MockManager_GetPodAndMirrorPod_Call{Call: _e.mock.On("GetPodAndMirrorPod", _a0)}
// - pod *v1.Pod
func (_e *MockManager_Expecter) GetPodAndMirrorPod(pod interface{}) *MockManager_GetPodAndMirrorPod_Call {
return &MockManager_GetPodAndMirrorPod_Call{Call: _e.mock.On("GetPodAndMirrorPod", pod)}
}
func (_c *MockManager_GetPodAndMirrorPod_Call) Run(run func(_a0 *v1.Pod)) *MockManager_GetPodAndMirrorPod_Call {
func (_c *MockManager_GetPodAndMirrorPod_Call) Run(run func(pod *v1.Pod)) *MockManager_GetPodAndMirrorPod_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
var arg0 *v1.Pod
if args[0] != nil {
arg0 = args[0].(*v1.Pod)
}
run(
arg0,
)
})
return _c
}
func (_c *MockManager_GetPodAndMirrorPod_Call) Return(_a0 *v1.Pod, mirrorPod *v1.Pod, wasMirror bool) *MockManager_GetPodAndMirrorPod_Call {
_c.Call.Return(_a0, mirrorPod, wasMirror)
func (_c *MockManager_GetPodAndMirrorPod_Call) Return(pod1 *v1.Pod, mirrorPod *v1.Pod, wasMirror bool) *MockManager_GetPodAndMirrorPod_Call {
_c.Call.Return(pod1, mirrorPod, wasMirror)
return _c
}
func (_c *MockManager_GetPodAndMirrorPod_Call) RunAndReturn(run func(*v1.Pod) (*v1.Pod, *v1.Pod, bool)) *MockManager_GetPodAndMirrorPod_Call {
func (_c *MockManager_GetPodAndMirrorPod_Call) RunAndReturn(run func(pod *v1.Pod) (*v1.Pod, *v1.Pod, bool)) *MockManager_GetPodAndMirrorPod_Call {
_c.Call.Return(run)
return _c
}
// GetPodByFullName provides a mock function with given fields: podFullName
func (_m *MockManager) GetPodByFullName(podFullName string) (*v1.Pod, bool) {
ret := _m.Called(podFullName)
// GetPodByFullName provides a mock function for the type MockManager
func (_mock *MockManager) GetPodByFullName(podFullName string) (*v1.Pod, bool) {
ret := _mock.Called(podFullName)
if len(ret) == 0 {
panic("no return value specified for GetPodByFullName")
@ -208,23 +236,21 @@ func (_m *MockManager) GetPodByFullName(podFullName string) (*v1.Pod, bool) {
var r0 *v1.Pod
var r1 bool
if rf, ok := ret.Get(0).(func(string) (*v1.Pod, bool)); ok {
return rf(podFullName)
if returnFunc, ok := ret.Get(0).(func(string) (*v1.Pod, bool)); ok {
return returnFunc(podFullName)
}
if rf, ok := ret.Get(0).(func(string) *v1.Pod); ok {
r0 = rf(podFullName)
if returnFunc, ok := ret.Get(0).(func(string) *v1.Pod); ok {
r0 = returnFunc(podFullName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func(string) bool); ok {
r1 = rf(podFullName)
if returnFunc, ok := ret.Get(1).(func(string) bool); ok {
r1 = returnFunc(podFullName)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
@ -241,24 +267,30 @@ func (_e *MockManager_Expecter) GetPodByFullName(podFullName interface{}) *MockM
func (_c *MockManager_GetPodByFullName_Call) Run(run func(podFullName string)) *MockManager_GetPodByFullName_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
run(
arg0,
)
})
return _c
}
func (_c *MockManager_GetPodByFullName_Call) Return(_a0 *v1.Pod, _a1 bool) *MockManager_GetPodByFullName_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockManager_GetPodByFullName_Call) Return(pod *v1.Pod, b bool) *MockManager_GetPodByFullName_Call {
_c.Call.Return(pod, b)
return _c
}
func (_c *MockManager_GetPodByFullName_Call) RunAndReturn(run func(string) (*v1.Pod, bool)) *MockManager_GetPodByFullName_Call {
func (_c *MockManager_GetPodByFullName_Call) RunAndReturn(run func(podFullName string) (*v1.Pod, bool)) *MockManager_GetPodByFullName_Call {
_c.Call.Return(run)
return _c
}
// GetPodByMirrorPod provides a mock function with given fields: _a0
func (_m *MockManager) GetPodByMirrorPod(_a0 *v1.Pod) (*v1.Pod, bool) {
ret := _m.Called(_a0)
// GetPodByMirrorPod provides a mock function for the type MockManager
func (_mock *MockManager) GetPodByMirrorPod(pod *v1.Pod) (*v1.Pod, bool) {
ret := _mock.Called(pod)
if len(ret) == 0 {
panic("no return value specified for GetPodByMirrorPod")
@ -266,23 +298,21 @@ func (_m *MockManager) GetPodByMirrorPod(_a0 *v1.Pod) (*v1.Pod, bool) {
var r0 *v1.Pod
var r1 bool
if rf, ok := ret.Get(0).(func(*v1.Pod) (*v1.Pod, bool)); ok {
return rf(_a0)
if returnFunc, ok := ret.Get(0).(func(*v1.Pod) (*v1.Pod, bool)); ok {
return returnFunc(pod)
}
if rf, ok := ret.Get(0).(func(*v1.Pod) *v1.Pod); ok {
r0 = rf(_a0)
if returnFunc, ok := ret.Get(0).(func(*v1.Pod) *v1.Pod); ok {
r0 = returnFunc(pod)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func(*v1.Pod) bool); ok {
r1 = rf(_a0)
if returnFunc, ok := ret.Get(1).(func(*v1.Pod) bool); ok {
r1 = returnFunc(pod)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
@ -292,31 +322,37 @@ type MockManager_GetPodByMirrorPod_Call struct {
}
// GetPodByMirrorPod is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockManager_Expecter) GetPodByMirrorPod(_a0 interface{}) *MockManager_GetPodByMirrorPod_Call {
return &MockManager_GetPodByMirrorPod_Call{Call: _e.mock.On("GetPodByMirrorPod", _a0)}
// - pod *v1.Pod
func (_e *MockManager_Expecter) GetPodByMirrorPod(pod interface{}) *MockManager_GetPodByMirrorPod_Call {
return &MockManager_GetPodByMirrorPod_Call{Call: _e.mock.On("GetPodByMirrorPod", pod)}
}
func (_c *MockManager_GetPodByMirrorPod_Call) Run(run func(_a0 *v1.Pod)) *MockManager_GetPodByMirrorPod_Call {
func (_c *MockManager_GetPodByMirrorPod_Call) Run(run func(pod *v1.Pod)) *MockManager_GetPodByMirrorPod_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
var arg0 *v1.Pod
if args[0] != nil {
arg0 = args[0].(*v1.Pod)
}
run(
arg0,
)
})
return _c
}
func (_c *MockManager_GetPodByMirrorPod_Call) Return(_a0 *v1.Pod, _a1 bool) *MockManager_GetPodByMirrorPod_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockManager_GetPodByMirrorPod_Call) Return(pod1 *v1.Pod, b bool) *MockManager_GetPodByMirrorPod_Call {
_c.Call.Return(pod1, b)
return _c
}
func (_c *MockManager_GetPodByMirrorPod_Call) RunAndReturn(run func(*v1.Pod) (*v1.Pod, bool)) *MockManager_GetPodByMirrorPod_Call {
func (_c *MockManager_GetPodByMirrorPod_Call) RunAndReturn(run func(pod *v1.Pod) (*v1.Pod, bool)) *MockManager_GetPodByMirrorPod_Call {
_c.Call.Return(run)
return _c
}
// GetPodByName provides a mock function with given fields: namespace, name
func (_m *MockManager) GetPodByName(namespace string, name string) (*v1.Pod, bool) {
ret := _m.Called(namespace, name)
// GetPodByName provides a mock function for the type MockManager
func (_mock *MockManager) GetPodByName(namespace string, name string) (*v1.Pod, bool) {
ret := _mock.Called(namespace, name)
if len(ret) == 0 {
panic("no return value specified for GetPodByName")
@ -324,23 +360,21 @@ func (_m *MockManager) GetPodByName(namespace string, name string) (*v1.Pod, boo
var r0 *v1.Pod
var r1 bool
if rf, ok := ret.Get(0).(func(string, string) (*v1.Pod, bool)); ok {
return rf(namespace, name)
if returnFunc, ok := ret.Get(0).(func(string, string) (*v1.Pod, bool)); ok {
return returnFunc(namespace, name)
}
if rf, ok := ret.Get(0).(func(string, string) *v1.Pod); ok {
r0 = rf(namespace, name)
if returnFunc, ok := ret.Get(0).(func(string, string) *v1.Pod); ok {
r0 = returnFunc(namespace, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func(string, string) bool); ok {
r1 = rf(namespace, name)
if returnFunc, ok := ret.Get(1).(func(string, string) bool); ok {
r1 = returnFunc(namespace, name)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
@ -358,24 +392,35 @@ func (_e *MockManager_Expecter) GetPodByName(namespace interface{}, name interfa
func (_c *MockManager_GetPodByName_Call) Run(run func(namespace string, name string)) *MockManager_GetPodByName_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockManager_GetPodByName_Call) Return(_a0 *v1.Pod, _a1 bool) *MockManager_GetPodByName_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockManager_GetPodByName_Call) Return(pod *v1.Pod, b bool) *MockManager_GetPodByName_Call {
_c.Call.Return(pod, b)
return _c
}
func (_c *MockManager_GetPodByName_Call) RunAndReturn(run func(string, string) (*v1.Pod, bool)) *MockManager_GetPodByName_Call {
func (_c *MockManager_GetPodByName_Call) RunAndReturn(run func(namespace string, name string) (*v1.Pod, bool)) *MockManager_GetPodByName_Call {
_c.Call.Return(run)
return _c
}
// GetPodByUID provides a mock function with given fields: _a0
func (_m *MockManager) GetPodByUID(_a0 types.UID) (*v1.Pod, bool) {
ret := _m.Called(_a0)
// GetPodByUID provides a mock function for the type MockManager
func (_mock *MockManager) GetPodByUID(uID types.UID) (*v1.Pod, bool) {
ret := _mock.Called(uID)
if len(ret) == 0 {
panic("no return value specified for GetPodByUID")
@ -383,23 +428,21 @@ func (_m *MockManager) GetPodByUID(_a0 types.UID) (*v1.Pod, bool) {
var r0 *v1.Pod
var r1 bool
if rf, ok := ret.Get(0).(func(types.UID) (*v1.Pod, bool)); ok {
return rf(_a0)
if returnFunc, ok := ret.Get(0).(func(types.UID) (*v1.Pod, bool)); ok {
return returnFunc(uID)
}
if rf, ok := ret.Get(0).(func(types.UID) *v1.Pod); ok {
r0 = rf(_a0)
if returnFunc, ok := ret.Get(0).(func(types.UID) *v1.Pod); ok {
r0 = returnFunc(uID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func(types.UID) bool); ok {
r1 = rf(_a0)
if returnFunc, ok := ret.Get(1).(func(types.UID) bool); ok {
r1 = returnFunc(uID)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
@ -409,45 +452,50 @@ type MockManager_GetPodByUID_Call struct {
}
// GetPodByUID is a helper method to define mock.On call
// - _a0 types.UID
func (_e *MockManager_Expecter) GetPodByUID(_a0 interface{}) *MockManager_GetPodByUID_Call {
return &MockManager_GetPodByUID_Call{Call: _e.mock.On("GetPodByUID", _a0)}
// - uID types.UID
func (_e *MockManager_Expecter) GetPodByUID(uID interface{}) *MockManager_GetPodByUID_Call {
return &MockManager_GetPodByUID_Call{Call: _e.mock.On("GetPodByUID", uID)}
}
func (_c *MockManager_GetPodByUID_Call) Run(run func(_a0 types.UID)) *MockManager_GetPodByUID_Call {
func (_c *MockManager_GetPodByUID_Call) Run(run func(uID types.UID)) *MockManager_GetPodByUID_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.UID))
var arg0 types.UID
if args[0] != nil {
arg0 = args[0].(types.UID)
}
run(
arg0,
)
})
return _c
}
func (_c *MockManager_GetPodByUID_Call) Return(_a0 *v1.Pod, _a1 bool) *MockManager_GetPodByUID_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockManager_GetPodByUID_Call) Return(pod *v1.Pod, b bool) *MockManager_GetPodByUID_Call {
_c.Call.Return(pod, b)
return _c
}
func (_c *MockManager_GetPodByUID_Call) RunAndReturn(run func(types.UID) (*v1.Pod, bool)) *MockManager_GetPodByUID_Call {
func (_c *MockManager_GetPodByUID_Call) RunAndReturn(run func(uID types.UID) (*v1.Pod, bool)) *MockManager_GetPodByUID_Call {
_c.Call.Return(run)
return _c
}
// GetPods provides a mock function with no fields
func (_m *MockManager) GetPods() []*v1.Pod {
ret := _m.Called()
// GetPods provides a mock function for the type MockManager
func (_mock *MockManager) GetPods() []*v1.Pod {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetPods")
}
var r0 []*v1.Pod
if rf, ok := ret.Get(0).(func() []*v1.Pod); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() []*v1.Pod); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.Pod)
}
}
return r0
}
@ -468,8 +516,8 @@ func (_c *MockManager_GetPods_Call) Run(run func()) *MockManager_GetPods_Call {
return _c
}
func (_c *MockManager_GetPods_Call) Return(_a0 []*v1.Pod) *MockManager_GetPods_Call {
_c.Call.Return(_a0)
func (_c *MockManager_GetPods_Call) Return(pods []*v1.Pod) *MockManager_GetPods_Call {
_c.Call.Return(pods)
return _c
}
@ -478,9 +526,9 @@ func (_c *MockManager_GetPods_Call) RunAndReturn(run func() []*v1.Pod) *MockMana
return _c
}
// GetPodsAndMirrorPods provides a mock function with no fields
func (_m *MockManager) GetPodsAndMirrorPods() ([]*v1.Pod, []*v1.Pod, []string) {
ret := _m.Called()
// GetPodsAndMirrorPods provides a mock function for the type MockManager
func (_mock *MockManager) GetPodsAndMirrorPods() ([]*v1.Pod, []*v1.Pod, []string) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetPodsAndMirrorPods")
@ -489,33 +537,30 @@ func (_m *MockManager) GetPodsAndMirrorPods() ([]*v1.Pod, []*v1.Pod, []string) {
var r0 []*v1.Pod
var r1 []*v1.Pod
var r2 []string
if rf, ok := ret.Get(0).(func() ([]*v1.Pod, []*v1.Pod, []string)); ok {
return rf()
if returnFunc, ok := ret.Get(0).(func() ([]*v1.Pod, []*v1.Pod, []string)); ok {
return returnFunc()
}
if rf, ok := ret.Get(0).(func() []*v1.Pod); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() []*v1.Pod); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*v1.Pod)
}
}
if rf, ok := ret.Get(1).(func() []*v1.Pod); ok {
r1 = rf()
if returnFunc, ok := ret.Get(1).(func() []*v1.Pod); ok {
r1 = returnFunc()
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]*v1.Pod)
}
}
if rf, ok := ret.Get(2).(func() []string); ok {
r2 = rf()
if returnFunc, ok := ret.Get(2).(func() []string); ok {
r2 = returnFunc()
} else {
if ret.Get(2) != nil {
r2 = ret.Get(2).([]string)
}
}
return r0, r1, r2
}
@ -546,23 +591,22 @@ func (_c *MockManager_GetPodsAndMirrorPods_Call) RunAndReturn(run func() ([]*v1.
return _c
}
// GetStaticPodToMirrorPodMap provides a mock function with no fields
func (_m *MockManager) GetStaticPodToMirrorPodMap() map[*v1.Pod]*v1.Pod {
ret := _m.Called()
// GetStaticPodToMirrorPodMap provides a mock function for the type MockManager
func (_mock *MockManager) GetStaticPodToMirrorPodMap() map[*v1.Pod]*v1.Pod {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetStaticPodToMirrorPodMap")
}
var r0 map[*v1.Pod]*v1.Pod
if rf, ok := ret.Get(0).(func() map[*v1.Pod]*v1.Pod); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() map[*v1.Pod]*v1.Pod); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[*v1.Pod]*v1.Pod)
}
}
return r0
}
@ -583,8 +627,8 @@ func (_c *MockManager_GetStaticPodToMirrorPodMap_Call) Run(run func()) *MockMana
return _c
}
func (_c *MockManager_GetStaticPodToMirrorPodMap_Call) Return(_a0 map[*v1.Pod]*v1.Pod) *MockManager_GetStaticPodToMirrorPodMap_Call {
_c.Call.Return(_a0)
func (_c *MockManager_GetStaticPodToMirrorPodMap_Call) Return(podToPod map[*v1.Pod]*v1.Pod) *MockManager_GetStaticPodToMirrorPodMap_Call {
_c.Call.Return(podToPod)
return _c
}
@ -593,35 +637,33 @@ func (_c *MockManager_GetStaticPodToMirrorPodMap_Call) RunAndReturn(run func() m
return _c
}
// GetUIDTranslations provides a mock function with no fields
func (_m *MockManager) GetUIDTranslations() (map[kubelettypes.ResolvedPodUID]kubelettypes.MirrorPodUID, map[kubelettypes.MirrorPodUID]kubelettypes.ResolvedPodUID) {
ret := _m.Called()
// GetUIDTranslations provides a mock function for the type MockManager
func (_mock *MockManager) GetUIDTranslations() (map[types0.ResolvedPodUID]types0.MirrorPodUID, map[types0.MirrorPodUID]types0.ResolvedPodUID) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetUIDTranslations")
}
var r0 map[kubelettypes.ResolvedPodUID]kubelettypes.MirrorPodUID
var r1 map[kubelettypes.MirrorPodUID]kubelettypes.ResolvedPodUID
if rf, ok := ret.Get(0).(func() (map[kubelettypes.ResolvedPodUID]kubelettypes.MirrorPodUID, map[kubelettypes.MirrorPodUID]kubelettypes.ResolvedPodUID)); ok {
return rf()
var r0 map[types0.ResolvedPodUID]types0.MirrorPodUID
var r1 map[types0.MirrorPodUID]types0.ResolvedPodUID
if returnFunc, ok := ret.Get(0).(func() (map[types0.ResolvedPodUID]types0.MirrorPodUID, map[types0.MirrorPodUID]types0.ResolvedPodUID)); ok {
return returnFunc()
}
if rf, ok := ret.Get(0).(func() map[kubelettypes.ResolvedPodUID]kubelettypes.MirrorPodUID); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() map[types0.ResolvedPodUID]types0.MirrorPodUID); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[kubelettypes.ResolvedPodUID]kubelettypes.MirrorPodUID)
r0 = ret.Get(0).(map[types0.ResolvedPodUID]types0.MirrorPodUID)
}
}
if rf, ok := ret.Get(1).(func() map[kubelettypes.MirrorPodUID]kubelettypes.ResolvedPodUID); ok {
r1 = rf()
if returnFunc, ok := ret.Get(1).(func() map[types0.MirrorPodUID]types0.ResolvedPodUID); ok {
r1 = returnFunc()
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(map[kubelettypes.MirrorPodUID]kubelettypes.ResolvedPodUID)
r1 = ret.Get(1).(map[types0.MirrorPodUID]types0.ResolvedPodUID)
}
}
return r0, r1
}
@ -642,19 +684,20 @@ func (_c *MockManager_GetUIDTranslations_Call) Run(run func()) *MockManager_GetU
return _c
}
func (_c *MockManager_GetUIDTranslations_Call) Return(podToMirror map[kubelettypes.ResolvedPodUID]kubelettypes.MirrorPodUID, mirrorToPod map[kubelettypes.MirrorPodUID]kubelettypes.ResolvedPodUID) *MockManager_GetUIDTranslations_Call {
func (_c *MockManager_GetUIDTranslations_Call) Return(podToMirror map[types0.ResolvedPodUID]types0.MirrorPodUID, mirrorToPod map[types0.MirrorPodUID]types0.ResolvedPodUID) *MockManager_GetUIDTranslations_Call {
_c.Call.Return(podToMirror, mirrorToPod)
return _c
}
func (_c *MockManager_GetUIDTranslations_Call) RunAndReturn(run func() (map[kubelettypes.ResolvedPodUID]kubelettypes.MirrorPodUID, map[kubelettypes.MirrorPodUID]kubelettypes.ResolvedPodUID)) *MockManager_GetUIDTranslations_Call {
func (_c *MockManager_GetUIDTranslations_Call) RunAndReturn(run func() (map[types0.ResolvedPodUID]types0.MirrorPodUID, map[types0.MirrorPodUID]types0.ResolvedPodUID)) *MockManager_GetUIDTranslations_Call {
_c.Call.Return(run)
return _c
}
// RemovePod provides a mock function with given fields: _a0
func (_m *MockManager) RemovePod(_a0 *v1.Pod) {
_m.Called(_a0)
// RemovePod provides a mock function for the type MockManager
func (_mock *MockManager) RemovePod(pod *v1.Pod) {
_mock.Called(pod)
return
}
// MockManager_RemovePod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemovePod'
@ -663,14 +706,20 @@ type MockManager_RemovePod_Call struct {
}
// RemovePod is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockManager_Expecter) RemovePod(_a0 interface{}) *MockManager_RemovePod_Call {
return &MockManager_RemovePod_Call{Call: _e.mock.On("RemovePod", _a0)}
// - pod *v1.Pod
func (_e *MockManager_Expecter) RemovePod(pod interface{}) *MockManager_RemovePod_Call {
return &MockManager_RemovePod_Call{Call: _e.mock.On("RemovePod", pod)}
}
func (_c *MockManager_RemovePod_Call) Run(run func(_a0 *v1.Pod)) *MockManager_RemovePod_Call {
func (_c *MockManager_RemovePod_Call) Run(run func(pod *v1.Pod)) *MockManager_RemovePod_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
var arg0 *v1.Pod
if args[0] != nil {
arg0 = args[0].(*v1.Pod)
}
run(
arg0,
)
})
return _c
}
@ -680,14 +729,15 @@ func (_c *MockManager_RemovePod_Call) Return() *MockManager_RemovePod_Call {
return _c
}
func (_c *MockManager_RemovePod_Call) RunAndReturn(run func(*v1.Pod)) *MockManager_RemovePod_Call {
func (_c *MockManager_RemovePod_Call) RunAndReturn(run func(pod *v1.Pod)) *MockManager_RemovePod_Call {
_c.Run(run)
return _c
}
// SetPods provides a mock function with given fields: pods
func (_m *MockManager) SetPods(pods []*v1.Pod) {
_m.Called(pods)
// SetPods provides a mock function for the type MockManager
func (_mock *MockManager) SetPods(pods []*v1.Pod) {
_mock.Called(pods)
return
}
// MockManager_SetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPods'
@ -703,7 +753,13 @@ func (_e *MockManager_Expecter) SetPods(pods interface{}) *MockManager_SetPods_C
func (_c *MockManager_SetPods_Call) Run(run func(pods []*v1.Pod)) *MockManager_SetPods_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]*v1.Pod))
var arg0 []*v1.Pod
if args[0] != nil {
arg0 = args[0].([]*v1.Pod)
}
run(
arg0,
)
})
return _c
}
@ -713,26 +769,25 @@ func (_c *MockManager_SetPods_Call) Return() *MockManager_SetPods_Call {
return _c
}
func (_c *MockManager_SetPods_Call) RunAndReturn(run func([]*v1.Pod)) *MockManager_SetPods_Call {
func (_c *MockManager_SetPods_Call) RunAndReturn(run func(pods []*v1.Pod)) *MockManager_SetPods_Call {
_c.Run(run)
return _c
}
// TranslatePodUID provides a mock function with given fields: uid
func (_m *MockManager) TranslatePodUID(uid types.UID) kubelettypes.ResolvedPodUID {
ret := _m.Called(uid)
// TranslatePodUID provides a mock function for the type MockManager
func (_mock *MockManager) TranslatePodUID(uid types.UID) types0.ResolvedPodUID {
ret := _mock.Called(uid)
if len(ret) == 0 {
panic("no return value specified for TranslatePodUID")
}
var r0 kubelettypes.ResolvedPodUID
if rf, ok := ret.Get(0).(func(types.UID) kubelettypes.ResolvedPodUID); ok {
r0 = rf(uid)
var r0 types0.ResolvedPodUID
if returnFunc, ok := ret.Get(0).(func(types.UID) types0.ResolvedPodUID); ok {
r0 = returnFunc(uid)
} else {
r0 = ret.Get(0).(kubelettypes.ResolvedPodUID)
r0 = ret.Get(0).(types0.ResolvedPodUID)
}
return r0
}
@ -749,24 +804,31 @@ func (_e *MockManager_Expecter) TranslatePodUID(uid interface{}) *MockManager_Tr
func (_c *MockManager_TranslatePodUID_Call) Run(run func(uid types.UID)) *MockManager_TranslatePodUID_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.UID))
var arg0 types.UID
if args[0] != nil {
arg0 = args[0].(types.UID)
}
run(
arg0,
)
})
return _c
}
func (_c *MockManager_TranslatePodUID_Call) Return(_a0 kubelettypes.ResolvedPodUID) *MockManager_TranslatePodUID_Call {
_c.Call.Return(_a0)
func (_c *MockManager_TranslatePodUID_Call) Return(resolvedPodUID types0.ResolvedPodUID) *MockManager_TranslatePodUID_Call {
_c.Call.Return(resolvedPodUID)
return _c
}
func (_c *MockManager_TranslatePodUID_Call) RunAndReturn(run func(types.UID) kubelettypes.ResolvedPodUID) *MockManager_TranslatePodUID_Call {
func (_c *MockManager_TranslatePodUID_Call) RunAndReturn(run func(uid types.UID) types0.ResolvedPodUID) *MockManager_TranslatePodUID_Call {
_c.Call.Return(run)
return _c
}
// UpdatePod provides a mock function with given fields: _a0
func (_m *MockManager) UpdatePod(_a0 *v1.Pod) {
_m.Called(_a0)
// UpdatePod provides a mock function for the type MockManager
func (_mock *MockManager) UpdatePod(pod *v1.Pod) {
_mock.Called(pod)
return
}
// MockManager_UpdatePod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePod'
@ -775,14 +837,20 @@ type MockManager_UpdatePod_Call struct {
}
// UpdatePod is a helper method to define mock.On call
// - _a0 *v1.Pod
func (_e *MockManager_Expecter) UpdatePod(_a0 interface{}) *MockManager_UpdatePod_Call {
return &MockManager_UpdatePod_Call{Call: _e.mock.On("UpdatePod", _a0)}
// - pod *v1.Pod
func (_e *MockManager_Expecter) UpdatePod(pod interface{}) *MockManager_UpdatePod_Call {
return &MockManager_UpdatePod_Call{Call: _e.mock.On("UpdatePod", pod)}
}
func (_c *MockManager_UpdatePod_Call) Run(run func(_a0 *v1.Pod)) *MockManager_UpdatePod_Call {
func (_c *MockManager_UpdatePod_Call) Run(run func(pod *v1.Pod)) *MockManager_UpdatePod_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*v1.Pod))
var arg0 *v1.Pod
if args[0] != nil {
arg0 = args[0].(*v1.Pod)
}
run(
arg0,
)
})
return _c
}
@ -792,21 +860,7 @@ func (_c *MockManager_UpdatePod_Call) Return() *MockManager_UpdatePod_Call {
return _c
}
func (_c *MockManager_UpdatePod_Call) RunAndReturn(run func(*v1.Pod)) *MockManager_UpdatePod_Call {
func (_c *MockManager_UpdatePod_Call) RunAndReturn(run func(pod *v1.Pod)) *MockManager_UpdatePod_Call {
_c.Run(run)
return _c
}
// NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockManager(t interface {
mock.TestingT
Cleanup(func())
}) *MockManager {
mock := &MockManager{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,13 +1,13 @@
---
dir: testing
filename: "mock_{{.InterfaceName | snakecase}}.go"
boilerplate-file: ../../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: testing
with-expecter: true
filename: mocks.go
pkgname: testing
template: testify
template-data:
boilerplate-file: ../../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/pkg/kubelet/server/stats:
interfaces:
Provider:
config:
filename: mock_stats_provider.go
SummaryProvider:
Provider: {}
SummaryProvider: {}

View file

@ -1,171 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package testing
import (
context "context"
mock "github.com/stretchr/testify/mock"
v1alpha1 "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
)
// MockSummaryProvider is an autogenerated mock type for the SummaryProvider type
type MockSummaryProvider struct {
mock.Mock
}
type MockSummaryProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockSummaryProvider) EXPECT() *MockSummaryProvider_Expecter {
return &MockSummaryProvider_Expecter{mock: &_m.Mock}
}
// Get provides a mock function with given fields: ctx, updateStats
func (_m *MockSummaryProvider) Get(ctx context.Context, updateStats bool) (*v1alpha1.Summary, error) {
ret := _m.Called(ctx, updateStats)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 *v1alpha1.Summary
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, bool) (*v1alpha1.Summary, error)); ok {
return rf(ctx, updateStats)
}
if rf, ok := ret.Get(0).(func(context.Context, bool) *v1alpha1.Summary); ok {
r0 = rf(ctx, updateStats)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1alpha1.Summary)
}
}
if rf, ok := ret.Get(1).(func(context.Context, bool) error); ok {
r1 = rf(ctx, updateStats)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockSummaryProvider_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
type MockSummaryProvider_Get_Call struct {
*mock.Call
}
// Get is a helper method to define mock.On call
// - ctx context.Context
// - updateStats bool
func (_e *MockSummaryProvider_Expecter) Get(ctx interface{}, updateStats interface{}) *MockSummaryProvider_Get_Call {
return &MockSummaryProvider_Get_Call{Call: _e.mock.On("Get", ctx, updateStats)}
}
func (_c *MockSummaryProvider_Get_Call) Run(run func(ctx context.Context, updateStats bool)) *MockSummaryProvider_Get_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(bool))
})
return _c
}
func (_c *MockSummaryProvider_Get_Call) Return(_a0 *v1alpha1.Summary, _a1 error) *MockSummaryProvider_Get_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockSummaryProvider_Get_Call) RunAndReturn(run func(context.Context, bool) (*v1alpha1.Summary, error)) *MockSummaryProvider_Get_Call {
_c.Call.Return(run)
return _c
}
// GetCPUAndMemoryStats provides a mock function with given fields: ctx
func (_m *MockSummaryProvider) GetCPUAndMemoryStats(ctx context.Context) (*v1alpha1.Summary, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetCPUAndMemoryStats")
}
var r0 *v1alpha1.Summary
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (*v1alpha1.Summary, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) *v1alpha1.Summary); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1alpha1.Summary)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockSummaryProvider_GetCPUAndMemoryStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCPUAndMemoryStats'
type MockSummaryProvider_GetCPUAndMemoryStats_Call struct {
*mock.Call
}
// GetCPUAndMemoryStats is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockSummaryProvider_Expecter) GetCPUAndMemoryStats(ctx interface{}) *MockSummaryProvider_GetCPUAndMemoryStats_Call {
return &MockSummaryProvider_GetCPUAndMemoryStats_Call{Call: _e.mock.On("GetCPUAndMemoryStats", ctx)}
}
func (_c *MockSummaryProvider_GetCPUAndMemoryStats_Call) Run(run func(ctx context.Context)) *MockSummaryProvider_GetCPUAndMemoryStats_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *MockSummaryProvider_GetCPUAndMemoryStats_Call) Return(_a0 *v1alpha1.Summary, _a1 error) *MockSummaryProvider_GetCPUAndMemoryStats_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockSummaryProvider_GetCPUAndMemoryStats_Call) RunAndReturn(run func(context.Context) (*v1alpha1.Summary, error)) *MockSummaryProvider_GetCPUAndMemoryStats_Call {
_c.Call.Return(run)
return _c
}
// NewMockSummaryProvider creates a new instance of MockSummaryProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockSummaryProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockSummaryProvider {
mock := &MockSummaryProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,10 +1,12 @@
---
dir: testing
filename: "mock_{{.InterfaceName | snakecase}}.go"
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: testing
with-expecter: true
filename: mocks.go
pkgname: testing
template: testify
template-data:
boilerplate-file: ../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/pkg/kubelet/status:
interfaces:
PodStatusProvider:
PodStatusProvider: {}

View file

@ -14,18 +14,32 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package testing
import (
mock "github.com/stretchr/testify/mock"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
)
// NewMockPodStatusProvider creates a new instance of MockPodStatusProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockPodStatusProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockPodStatusProvider {
mock := &MockPodStatusProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockPodStatusProvider is an autogenerated mock type for the PodStatusProvider type
type MockPodStatusProvider struct {
mock.Mock
@ -39,9 +53,9 @@ func (_m *MockPodStatusProvider) EXPECT() *MockPodStatusProvider_Expecter {
return &MockPodStatusProvider_Expecter{mock: &_m.Mock}
}
// GetPodStatus provides a mock function with given fields: uid
func (_m *MockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool) {
ret := _m.Called(uid)
// GetPodStatus provides a mock function for the type MockPodStatusProvider
func (_mock *MockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool) {
ret := _mock.Called(uid)
if len(ret) == 0 {
panic("no return value specified for GetPodStatus")
@ -49,21 +63,19 @@ func (_m *MockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool
var r0 v1.PodStatus
var r1 bool
if rf, ok := ret.Get(0).(func(types.UID) (v1.PodStatus, bool)); ok {
return rf(uid)
if returnFunc, ok := ret.Get(0).(func(types.UID) (v1.PodStatus, bool)); ok {
return returnFunc(uid)
}
if rf, ok := ret.Get(0).(func(types.UID) v1.PodStatus); ok {
r0 = rf(uid)
if returnFunc, ok := ret.Get(0).(func(types.UID) v1.PodStatus); ok {
r0 = returnFunc(uid)
} else {
r0 = ret.Get(0).(v1.PodStatus)
}
if rf, ok := ret.Get(1).(func(types.UID) bool); ok {
r1 = rf(uid)
if returnFunc, ok := ret.Get(1).(func(types.UID) bool); ok {
r1 = returnFunc(uid)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
@ -80,31 +92,23 @@ func (_e *MockPodStatusProvider_Expecter) GetPodStatus(uid interface{}) *MockPod
func (_c *MockPodStatusProvider_GetPodStatus_Call) Run(run func(uid types.UID)) *MockPodStatusProvider_GetPodStatus_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.UID))
var arg0 types.UID
if args[0] != nil {
arg0 = args[0].(types.UID)
}
run(
arg0,
)
})
return _c
}
func (_c *MockPodStatusProvider_GetPodStatus_Call) Return(_a0 v1.PodStatus, _a1 bool) *MockPodStatusProvider_GetPodStatus_Call {
_c.Call.Return(_a0, _a1)
func (_c *MockPodStatusProvider_GetPodStatus_Call) Return(podStatus v1.PodStatus, b bool) *MockPodStatusProvider_GetPodStatus_Call {
_c.Call.Return(podStatus, b)
return _c
}
func (_c *MockPodStatusProvider_GetPodStatus_Call) RunAndReturn(run func(types.UID) (v1.PodStatus, bool)) *MockPodStatusProvider_GetPodStatus_Call {
func (_c *MockPodStatusProvider_GetPodStatus_Call) RunAndReturn(run func(uid types.UID) (v1.PodStatus, bool)) *MockPodStatusProvider_GetPodStatus_Call {
_c.Call.Return(run)
return _c
}
// NewMockPodStatusProvider creates a new instance of MockPodStatusProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockPodStatusProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockPodStatusProvider {
mock := &MockPodStatusProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,10 +1,11 @@
---
dir: .
filename: "mock_{{.InterfaceName | snakecase}}_test.go"
boilerplate-file: ../../../../../hack/boilerplate/boilerplate.generatego.txt
outpkg: rest
with-expecter: true
pkgname: rest
template: testify
template-data:
boilerplate-file: ../../../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/client-go/rest:
interfaces:
BackoffManager:
BackoffManager: {}

View file

@ -14,18 +14,33 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package rest
import (
"net/url"
"time"
mock "github.com/stretchr/testify/mock"
time "time"
url "net/url"
)
// NewMockBackoffManager creates a new instance of MockBackoffManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockBackoffManager(t interface {
mock.TestingT
Cleanup(func())
}) *MockBackoffManager {
mock := &MockBackoffManager{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockBackoffManager is an autogenerated mock type for the BackoffManager type
type MockBackoffManager struct {
mock.Mock
@ -39,21 +54,20 @@ func (_m *MockBackoffManager) EXPECT() *MockBackoffManager_Expecter {
return &MockBackoffManager_Expecter{mock: &_m.Mock}
}
// CalculateBackoff provides a mock function with given fields: actualURL
func (_m *MockBackoffManager) CalculateBackoff(actualURL *url.URL) time.Duration {
ret := _m.Called(actualURL)
// CalculateBackoff provides a mock function for the type MockBackoffManager
func (_mock *MockBackoffManager) CalculateBackoff(actualURL *url.URL) time.Duration {
ret := _mock.Called(actualURL)
if len(ret) == 0 {
panic("no return value specified for CalculateBackoff")
}
var r0 time.Duration
if rf, ok := ret.Get(0).(func(*url.URL) time.Duration); ok {
r0 = rf(actualURL)
if returnFunc, ok := ret.Get(0).(func(*url.URL) time.Duration); ok {
r0 = returnFunc(actualURL)
} else {
r0 = ret.Get(0).(time.Duration)
}
return r0
}
@ -70,24 +84,31 @@ func (_e *MockBackoffManager_Expecter) CalculateBackoff(actualURL interface{}) *
func (_c *MockBackoffManager_CalculateBackoff_Call) Run(run func(actualURL *url.URL)) *MockBackoffManager_CalculateBackoff_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*url.URL))
var arg0 *url.URL
if args[0] != nil {
arg0 = args[0].(*url.URL)
}
run(
arg0,
)
})
return _c
}
func (_c *MockBackoffManager_CalculateBackoff_Call) Return(_a0 time.Duration) *MockBackoffManager_CalculateBackoff_Call {
_c.Call.Return(_a0)
func (_c *MockBackoffManager_CalculateBackoff_Call) Return(duration time.Duration) *MockBackoffManager_CalculateBackoff_Call {
_c.Call.Return(duration)
return _c
}
func (_c *MockBackoffManager_CalculateBackoff_Call) RunAndReturn(run func(*url.URL) time.Duration) *MockBackoffManager_CalculateBackoff_Call {
func (_c *MockBackoffManager_CalculateBackoff_Call) RunAndReturn(run func(actualURL *url.URL) time.Duration) *MockBackoffManager_CalculateBackoff_Call {
_c.Call.Return(run)
return _c
}
// Sleep provides a mock function with given fields: d
func (_m *MockBackoffManager) Sleep(d time.Duration) {
_m.Called(d)
// Sleep provides a mock function for the type MockBackoffManager
func (_mock *MockBackoffManager) Sleep(d time.Duration) {
_mock.Called(d)
return
}
// MockBackoffManager_Sleep_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sleep'
@ -103,7 +124,13 @@ func (_e *MockBackoffManager_Expecter) Sleep(d interface{}) *MockBackoffManager_
func (_c *MockBackoffManager_Sleep_Call) Run(run func(d time.Duration)) *MockBackoffManager_Sleep_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Duration))
var arg0 time.Duration
if args[0] != nil {
arg0 = args[0].(time.Duration)
}
run(
arg0,
)
})
return _c
}
@ -113,14 +140,15 @@ func (_c *MockBackoffManager_Sleep_Call) Return() *MockBackoffManager_Sleep_Call
return _c
}
func (_c *MockBackoffManager_Sleep_Call) RunAndReturn(run func(time.Duration)) *MockBackoffManager_Sleep_Call {
func (_c *MockBackoffManager_Sleep_Call) RunAndReturn(run func(d time.Duration)) *MockBackoffManager_Sleep_Call {
_c.Run(run)
return _c
}
// UpdateBackoff provides a mock function with given fields: actualURL, err, responseCode
func (_m *MockBackoffManager) UpdateBackoff(actualURL *url.URL, err error, responseCode int) {
_m.Called(actualURL, err, responseCode)
// UpdateBackoff provides a mock function for the type MockBackoffManager
func (_mock *MockBackoffManager) UpdateBackoff(actualURL *url.URL, err error, responseCode int) {
_mock.Called(actualURL, err, responseCode)
return
}
// MockBackoffManager_UpdateBackoff_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBackoff'
@ -138,7 +166,23 @@ func (_e *MockBackoffManager_Expecter) UpdateBackoff(actualURL interface{}, err
func (_c *MockBackoffManager_UpdateBackoff_Call) Run(run func(actualURL *url.URL, err error, responseCode int)) *MockBackoffManager_UpdateBackoff_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*url.URL), args[1].(error), args[2].(int))
var arg0 *url.URL
if args[0] != nil {
arg0 = args[0].(*url.URL)
}
var arg1 error
if args[1] != nil {
arg1 = args[1].(error)
}
var arg2 int
if args[2] != nil {
arg2 = args[2].(int)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
@ -148,21 +192,7 @@ func (_c *MockBackoffManager_UpdateBackoff_Call) Return() *MockBackoffManager_Up
return _c
}
func (_c *MockBackoffManager_UpdateBackoff_Call) RunAndReturn(run func(*url.URL, error, int)) *MockBackoffManager_UpdateBackoff_Call {
func (_c *MockBackoffManager_UpdateBackoff_Call) RunAndReturn(run func(actualURL *url.URL, err error, responseCode int)) *MockBackoffManager_UpdateBackoff_Call {
_c.Run(run)
return _c
}
// NewMockBackoffManager creates a new instance of MockBackoffManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockBackoffManager(t interface {
mock.TestingT
Cleanup(func())
}) *MockBackoffManager {
mock := &MockBackoffManager{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,12 +1,14 @@
---
dir: .
filename: mock_{{.InterfaceName | snakecase}}.go
outpkg: driver
boilerplate-file: ../../../../../../hack/boilerplate/boilerplate.generatego.txt
with-expecter: True
filename: mocks.go
pkgname: driver
template: testify
template-data:
boilerplate-file: ../../../../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
github.com/container-storage-interface/spec/lib/go/csi:
interfaces:
ControllerServer:
IdentityServer:
NodeServer:
ControllerServer: {}
IdentityServer: {}
NodeServer: {}

View file

@ -1,879 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package driver
import (
context "context"
csi "github.com/container-storage-interface/spec/lib/go/csi"
mock "github.com/stretchr/testify/mock"
)
// MockControllerServer is an autogenerated mock type for the ControllerServer type
type MockControllerServer struct {
mock.Mock
}
type MockControllerServer_Expecter struct {
mock *mock.Mock
}
func (_m *MockControllerServer) EXPECT() *MockControllerServer_Expecter {
return &MockControllerServer_Expecter{mock: &_m.Mock}
}
// ControllerExpandVolume provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ControllerExpandVolume(_a0 context.Context, _a1 *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ControllerExpandVolume")
}
var r0 *csi.ControllerExpandVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerExpandVolumeRequest) *csi.ControllerExpandVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ControllerExpandVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ControllerExpandVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ControllerExpandVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ControllerExpandVolume'
type MockControllerServer_ControllerExpandVolume_Call struct {
*mock.Call
}
// ControllerExpandVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ControllerExpandVolumeRequest
func (_e *MockControllerServer_Expecter) ControllerExpandVolume(_a0 interface{}, _a1 interface{}) *MockControllerServer_ControllerExpandVolume_Call {
return &MockControllerServer_ControllerExpandVolume_Call{Call: _e.mock.On("ControllerExpandVolume", _a0, _a1)}
}
func (_c *MockControllerServer_ControllerExpandVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.ControllerExpandVolumeRequest)) *MockControllerServer_ControllerExpandVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ControllerExpandVolumeRequest))
})
return _c
}
func (_c *MockControllerServer_ControllerExpandVolume_Call) Return(_a0 *csi.ControllerExpandVolumeResponse, _a1 error) *MockControllerServer_ControllerExpandVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ControllerExpandVolume_Call) RunAndReturn(run func(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)) *MockControllerServer_ControllerExpandVolume_Call {
_c.Call.Return(run)
return _c
}
// ControllerGetCapabilities provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ControllerGetCapabilities(_a0 context.Context, _a1 *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ControllerGetCapabilities")
}
var r0 *csi.ControllerGetCapabilitiesResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetCapabilitiesRequest) *csi.ControllerGetCapabilitiesResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ControllerGetCapabilitiesResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ControllerGetCapabilitiesRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ControllerGetCapabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ControllerGetCapabilities'
type MockControllerServer_ControllerGetCapabilities_Call struct {
*mock.Call
}
// ControllerGetCapabilities is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ControllerGetCapabilitiesRequest
func (_e *MockControllerServer_Expecter) ControllerGetCapabilities(_a0 interface{}, _a1 interface{}) *MockControllerServer_ControllerGetCapabilities_Call {
return &MockControllerServer_ControllerGetCapabilities_Call{Call: _e.mock.On("ControllerGetCapabilities", _a0, _a1)}
}
func (_c *MockControllerServer_ControllerGetCapabilities_Call) Run(run func(_a0 context.Context, _a1 *csi.ControllerGetCapabilitiesRequest)) *MockControllerServer_ControllerGetCapabilities_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ControllerGetCapabilitiesRequest))
})
return _c
}
func (_c *MockControllerServer_ControllerGetCapabilities_Call) Return(_a0 *csi.ControllerGetCapabilitiesResponse, _a1 error) *MockControllerServer_ControllerGetCapabilities_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ControllerGetCapabilities_Call) RunAndReturn(run func(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)) *MockControllerServer_ControllerGetCapabilities_Call {
_c.Call.Return(run)
return _c
}
// ControllerGetVolume provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ControllerGetVolume(_a0 context.Context, _a1 *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ControllerGetVolume")
}
var r0 *csi.ControllerGetVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetVolumeRequest) *csi.ControllerGetVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ControllerGetVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ControllerGetVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ControllerGetVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ControllerGetVolume'
type MockControllerServer_ControllerGetVolume_Call struct {
*mock.Call
}
// ControllerGetVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ControllerGetVolumeRequest
func (_e *MockControllerServer_Expecter) ControllerGetVolume(_a0 interface{}, _a1 interface{}) *MockControllerServer_ControllerGetVolume_Call {
return &MockControllerServer_ControllerGetVolume_Call{Call: _e.mock.On("ControllerGetVolume", _a0, _a1)}
}
func (_c *MockControllerServer_ControllerGetVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.ControllerGetVolumeRequest)) *MockControllerServer_ControllerGetVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ControllerGetVolumeRequest))
})
return _c
}
func (_c *MockControllerServer_ControllerGetVolume_Call) Return(_a0 *csi.ControllerGetVolumeResponse, _a1 error) *MockControllerServer_ControllerGetVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ControllerGetVolume_Call) RunAndReturn(run func(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)) *MockControllerServer_ControllerGetVolume_Call {
_c.Call.Return(run)
return _c
}
// ControllerModifyVolume provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ControllerModifyVolume(_a0 context.Context, _a1 *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ControllerModifyVolume")
}
var r0 *csi.ControllerModifyVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerModifyVolumeRequest) *csi.ControllerModifyVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ControllerModifyVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ControllerModifyVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ControllerModifyVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ControllerModifyVolume'
type MockControllerServer_ControllerModifyVolume_Call struct {
*mock.Call
}
// ControllerModifyVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ControllerModifyVolumeRequest
func (_e *MockControllerServer_Expecter) ControllerModifyVolume(_a0 interface{}, _a1 interface{}) *MockControllerServer_ControllerModifyVolume_Call {
return &MockControllerServer_ControllerModifyVolume_Call{Call: _e.mock.On("ControllerModifyVolume", _a0, _a1)}
}
func (_c *MockControllerServer_ControllerModifyVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.ControllerModifyVolumeRequest)) *MockControllerServer_ControllerModifyVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ControllerModifyVolumeRequest))
})
return _c
}
func (_c *MockControllerServer_ControllerModifyVolume_Call) Return(_a0 *csi.ControllerModifyVolumeResponse, _a1 error) *MockControllerServer_ControllerModifyVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ControllerModifyVolume_Call) RunAndReturn(run func(context.Context, *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)) *MockControllerServer_ControllerModifyVolume_Call {
_c.Call.Return(run)
return _c
}
// ControllerPublishVolume provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ControllerPublishVolume(_a0 context.Context, _a1 *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ControllerPublishVolume")
}
var r0 *csi.ControllerPublishVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerPublishVolumeRequest) *csi.ControllerPublishVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ControllerPublishVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ControllerPublishVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ControllerPublishVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ControllerPublishVolume'
type MockControllerServer_ControllerPublishVolume_Call struct {
*mock.Call
}
// ControllerPublishVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ControllerPublishVolumeRequest
func (_e *MockControllerServer_Expecter) ControllerPublishVolume(_a0 interface{}, _a1 interface{}) *MockControllerServer_ControllerPublishVolume_Call {
return &MockControllerServer_ControllerPublishVolume_Call{Call: _e.mock.On("ControllerPublishVolume", _a0, _a1)}
}
func (_c *MockControllerServer_ControllerPublishVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.ControllerPublishVolumeRequest)) *MockControllerServer_ControllerPublishVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ControllerPublishVolumeRequest))
})
return _c
}
func (_c *MockControllerServer_ControllerPublishVolume_Call) Return(_a0 *csi.ControllerPublishVolumeResponse, _a1 error) *MockControllerServer_ControllerPublishVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ControllerPublishVolume_Call) RunAndReturn(run func(context.Context, *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)) *MockControllerServer_ControllerPublishVolume_Call {
_c.Call.Return(run)
return _c
}
// ControllerUnpublishVolume provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ControllerUnpublishVolume(_a0 context.Context, _a1 *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ControllerUnpublishVolume")
}
var r0 *csi.ControllerUnpublishVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ControllerUnpublishVolumeRequest) *csi.ControllerUnpublishVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ControllerUnpublishVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ControllerUnpublishVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ControllerUnpublishVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ControllerUnpublishVolume'
type MockControllerServer_ControllerUnpublishVolume_Call struct {
*mock.Call
}
// ControllerUnpublishVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ControllerUnpublishVolumeRequest
func (_e *MockControllerServer_Expecter) ControllerUnpublishVolume(_a0 interface{}, _a1 interface{}) *MockControllerServer_ControllerUnpublishVolume_Call {
return &MockControllerServer_ControllerUnpublishVolume_Call{Call: _e.mock.On("ControllerUnpublishVolume", _a0, _a1)}
}
func (_c *MockControllerServer_ControllerUnpublishVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.ControllerUnpublishVolumeRequest)) *MockControllerServer_ControllerUnpublishVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ControllerUnpublishVolumeRequest))
})
return _c
}
func (_c *MockControllerServer_ControllerUnpublishVolume_Call) Return(_a0 *csi.ControllerUnpublishVolumeResponse, _a1 error) *MockControllerServer_ControllerUnpublishVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ControllerUnpublishVolume_Call) RunAndReturn(run func(context.Context, *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)) *MockControllerServer_ControllerUnpublishVolume_Call {
_c.Call.Return(run)
return _c
}
// CreateSnapshot provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) CreateSnapshot(_a0 context.Context, _a1 *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for CreateSnapshot")
}
var r0 *csi.CreateSnapshotResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.CreateSnapshotRequest) *csi.CreateSnapshotResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.CreateSnapshotResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.CreateSnapshotRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_CreateSnapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSnapshot'
type MockControllerServer_CreateSnapshot_Call struct {
*mock.Call
}
// CreateSnapshot is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.CreateSnapshotRequest
func (_e *MockControllerServer_Expecter) CreateSnapshot(_a0 interface{}, _a1 interface{}) *MockControllerServer_CreateSnapshot_Call {
return &MockControllerServer_CreateSnapshot_Call{Call: _e.mock.On("CreateSnapshot", _a0, _a1)}
}
func (_c *MockControllerServer_CreateSnapshot_Call) Run(run func(_a0 context.Context, _a1 *csi.CreateSnapshotRequest)) *MockControllerServer_CreateSnapshot_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.CreateSnapshotRequest))
})
return _c
}
func (_c *MockControllerServer_CreateSnapshot_Call) Return(_a0 *csi.CreateSnapshotResponse, _a1 error) *MockControllerServer_CreateSnapshot_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_CreateSnapshot_Call) RunAndReturn(run func(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)) *MockControllerServer_CreateSnapshot_Call {
_c.Call.Return(run)
return _c
}
// CreateVolume provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) CreateVolume(_a0 context.Context, _a1 *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for CreateVolume")
}
var r0 *csi.CreateVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.CreateVolumeRequest) *csi.CreateVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.CreateVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.CreateVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_CreateVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVolume'
type MockControllerServer_CreateVolume_Call struct {
*mock.Call
}
// CreateVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.CreateVolumeRequest
func (_e *MockControllerServer_Expecter) CreateVolume(_a0 interface{}, _a1 interface{}) *MockControllerServer_CreateVolume_Call {
return &MockControllerServer_CreateVolume_Call{Call: _e.mock.On("CreateVolume", _a0, _a1)}
}
func (_c *MockControllerServer_CreateVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.CreateVolumeRequest)) *MockControllerServer_CreateVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.CreateVolumeRequest))
})
return _c
}
func (_c *MockControllerServer_CreateVolume_Call) Return(_a0 *csi.CreateVolumeResponse, _a1 error) *MockControllerServer_CreateVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_CreateVolume_Call) RunAndReturn(run func(context.Context, *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)) *MockControllerServer_CreateVolume_Call {
_c.Call.Return(run)
return _c
}
// DeleteSnapshot provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) DeleteSnapshot(_a0 context.Context, _a1 *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for DeleteSnapshot")
}
var r0 *csi.DeleteSnapshotResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.DeleteSnapshotRequest) *csi.DeleteSnapshotResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.DeleteSnapshotResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.DeleteSnapshotRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_DeleteSnapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSnapshot'
type MockControllerServer_DeleteSnapshot_Call struct {
*mock.Call
}
// DeleteSnapshot is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.DeleteSnapshotRequest
func (_e *MockControllerServer_Expecter) DeleteSnapshot(_a0 interface{}, _a1 interface{}) *MockControllerServer_DeleteSnapshot_Call {
return &MockControllerServer_DeleteSnapshot_Call{Call: _e.mock.On("DeleteSnapshot", _a0, _a1)}
}
func (_c *MockControllerServer_DeleteSnapshot_Call) Run(run func(_a0 context.Context, _a1 *csi.DeleteSnapshotRequest)) *MockControllerServer_DeleteSnapshot_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.DeleteSnapshotRequest))
})
return _c
}
func (_c *MockControllerServer_DeleteSnapshot_Call) Return(_a0 *csi.DeleteSnapshotResponse, _a1 error) *MockControllerServer_DeleteSnapshot_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_DeleteSnapshot_Call) RunAndReturn(run func(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)) *MockControllerServer_DeleteSnapshot_Call {
_c.Call.Return(run)
return _c
}
// DeleteVolume provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) DeleteVolume(_a0 context.Context, _a1 *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for DeleteVolume")
}
var r0 *csi.DeleteVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.DeleteVolumeRequest) *csi.DeleteVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.DeleteVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.DeleteVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_DeleteVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteVolume'
type MockControllerServer_DeleteVolume_Call struct {
*mock.Call
}
// DeleteVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.DeleteVolumeRequest
func (_e *MockControllerServer_Expecter) DeleteVolume(_a0 interface{}, _a1 interface{}) *MockControllerServer_DeleteVolume_Call {
return &MockControllerServer_DeleteVolume_Call{Call: _e.mock.On("DeleteVolume", _a0, _a1)}
}
func (_c *MockControllerServer_DeleteVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.DeleteVolumeRequest)) *MockControllerServer_DeleteVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.DeleteVolumeRequest))
})
return _c
}
func (_c *MockControllerServer_DeleteVolume_Call) Return(_a0 *csi.DeleteVolumeResponse, _a1 error) *MockControllerServer_DeleteVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_DeleteVolume_Call) RunAndReturn(run func(context.Context, *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)) *MockControllerServer_DeleteVolume_Call {
_c.Call.Return(run)
return _c
}
// GetCapacity provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) GetCapacity(_a0 context.Context, _a1 *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetCapacity")
}
var r0 *csi.GetCapacityResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.GetCapacityRequest) *csi.GetCapacityResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.GetCapacityResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.GetCapacityRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_GetCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCapacity'
type MockControllerServer_GetCapacity_Call struct {
*mock.Call
}
// GetCapacity is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.GetCapacityRequest
func (_e *MockControllerServer_Expecter) GetCapacity(_a0 interface{}, _a1 interface{}) *MockControllerServer_GetCapacity_Call {
return &MockControllerServer_GetCapacity_Call{Call: _e.mock.On("GetCapacity", _a0, _a1)}
}
func (_c *MockControllerServer_GetCapacity_Call) Run(run func(_a0 context.Context, _a1 *csi.GetCapacityRequest)) *MockControllerServer_GetCapacity_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.GetCapacityRequest))
})
return _c
}
func (_c *MockControllerServer_GetCapacity_Call) Return(_a0 *csi.GetCapacityResponse, _a1 error) *MockControllerServer_GetCapacity_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_GetCapacity_Call) RunAndReturn(run func(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)) *MockControllerServer_GetCapacity_Call {
_c.Call.Return(run)
return _c
}
// ListSnapshots provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ListSnapshots(_a0 context.Context, _a1 *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ListSnapshots")
}
var r0 *csi.ListSnapshotsResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ListSnapshotsRequest) *csi.ListSnapshotsResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ListSnapshotsResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ListSnapshotsRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ListSnapshots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSnapshots'
type MockControllerServer_ListSnapshots_Call struct {
*mock.Call
}
// ListSnapshots is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ListSnapshotsRequest
func (_e *MockControllerServer_Expecter) ListSnapshots(_a0 interface{}, _a1 interface{}) *MockControllerServer_ListSnapshots_Call {
return &MockControllerServer_ListSnapshots_Call{Call: _e.mock.On("ListSnapshots", _a0, _a1)}
}
func (_c *MockControllerServer_ListSnapshots_Call) Run(run func(_a0 context.Context, _a1 *csi.ListSnapshotsRequest)) *MockControllerServer_ListSnapshots_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ListSnapshotsRequest))
})
return _c
}
func (_c *MockControllerServer_ListSnapshots_Call) Return(_a0 *csi.ListSnapshotsResponse, _a1 error) *MockControllerServer_ListSnapshots_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ListSnapshots_Call) RunAndReturn(run func(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)) *MockControllerServer_ListSnapshots_Call {
_c.Call.Return(run)
return _c
}
// ListVolumes provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ListVolumes(_a0 context.Context, _a1 *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ListVolumes")
}
var r0 *csi.ListVolumesResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ListVolumesRequest) *csi.ListVolumesResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ListVolumesResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ListVolumesRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ListVolumes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListVolumes'
type MockControllerServer_ListVolumes_Call struct {
*mock.Call
}
// ListVolumes is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ListVolumesRequest
func (_e *MockControllerServer_Expecter) ListVolumes(_a0 interface{}, _a1 interface{}) *MockControllerServer_ListVolumes_Call {
return &MockControllerServer_ListVolumes_Call{Call: _e.mock.On("ListVolumes", _a0, _a1)}
}
func (_c *MockControllerServer_ListVolumes_Call) Run(run func(_a0 context.Context, _a1 *csi.ListVolumesRequest)) *MockControllerServer_ListVolumes_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ListVolumesRequest))
})
return _c
}
func (_c *MockControllerServer_ListVolumes_Call) Return(_a0 *csi.ListVolumesResponse, _a1 error) *MockControllerServer_ListVolumes_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ListVolumes_Call) RunAndReturn(run func(context.Context, *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)) *MockControllerServer_ListVolumes_Call {
_c.Call.Return(run)
return _c
}
// ValidateVolumeCapabilities provides a mock function with given fields: _a0, _a1
func (_m *MockControllerServer) ValidateVolumeCapabilities(_a0 context.Context, _a1 *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ValidateVolumeCapabilities")
}
var r0 *csi.ValidateVolumeCapabilitiesResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ValidateVolumeCapabilitiesRequest) *csi.ValidateVolumeCapabilitiesResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ValidateVolumeCapabilitiesResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ValidateVolumeCapabilitiesRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockControllerServer_ValidateVolumeCapabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateVolumeCapabilities'
type MockControllerServer_ValidateVolumeCapabilities_Call struct {
*mock.Call
}
// ValidateVolumeCapabilities is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ValidateVolumeCapabilitiesRequest
func (_e *MockControllerServer_Expecter) ValidateVolumeCapabilities(_a0 interface{}, _a1 interface{}) *MockControllerServer_ValidateVolumeCapabilities_Call {
return &MockControllerServer_ValidateVolumeCapabilities_Call{Call: _e.mock.On("ValidateVolumeCapabilities", _a0, _a1)}
}
func (_c *MockControllerServer_ValidateVolumeCapabilities_Call) Run(run func(_a0 context.Context, _a1 *csi.ValidateVolumeCapabilitiesRequest)) *MockControllerServer_ValidateVolumeCapabilities_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ValidateVolumeCapabilitiesRequest))
})
return _c
}
func (_c *MockControllerServer_ValidateVolumeCapabilities_Call) Return(_a0 *csi.ValidateVolumeCapabilitiesResponse, _a1 error) *MockControllerServer_ValidateVolumeCapabilities_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockControllerServer_ValidateVolumeCapabilities_Call) RunAndReturn(run func(context.Context, *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)) *MockControllerServer_ValidateVolumeCapabilities_Call {
_c.Call.Return(run)
return _c
}
// NewMockControllerServer creates a new instance of MockControllerServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockControllerServer(t interface {
mock.TestingT
Cleanup(func())
}) *MockControllerServer {
mock := &MockControllerServer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,230 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package driver
import (
context "context"
csi "github.com/container-storage-interface/spec/lib/go/csi"
mock "github.com/stretchr/testify/mock"
)
// MockIdentityServer is an autogenerated mock type for the IdentityServer type
type MockIdentityServer struct {
mock.Mock
}
type MockIdentityServer_Expecter struct {
mock *mock.Mock
}
func (_m *MockIdentityServer) EXPECT() *MockIdentityServer_Expecter {
return &MockIdentityServer_Expecter{mock: &_m.Mock}
}
// GetPluginCapabilities provides a mock function with given fields: _a0, _a1
func (_m *MockIdentityServer) GetPluginCapabilities(_a0 context.Context, _a1 *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetPluginCapabilities")
}
var r0 *csi.GetPluginCapabilitiesResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.GetPluginCapabilitiesRequest) *csi.GetPluginCapabilitiesResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.GetPluginCapabilitiesResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.GetPluginCapabilitiesRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockIdentityServer_GetPluginCapabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPluginCapabilities'
type MockIdentityServer_GetPluginCapabilities_Call struct {
*mock.Call
}
// GetPluginCapabilities is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.GetPluginCapabilitiesRequest
func (_e *MockIdentityServer_Expecter) GetPluginCapabilities(_a0 interface{}, _a1 interface{}) *MockIdentityServer_GetPluginCapabilities_Call {
return &MockIdentityServer_GetPluginCapabilities_Call{Call: _e.mock.On("GetPluginCapabilities", _a0, _a1)}
}
func (_c *MockIdentityServer_GetPluginCapabilities_Call) Run(run func(_a0 context.Context, _a1 *csi.GetPluginCapabilitiesRequest)) *MockIdentityServer_GetPluginCapabilities_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.GetPluginCapabilitiesRequest))
})
return _c
}
func (_c *MockIdentityServer_GetPluginCapabilities_Call) Return(_a0 *csi.GetPluginCapabilitiesResponse, _a1 error) *MockIdentityServer_GetPluginCapabilities_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockIdentityServer_GetPluginCapabilities_Call) RunAndReturn(run func(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)) *MockIdentityServer_GetPluginCapabilities_Call {
_c.Call.Return(run)
return _c
}
// GetPluginInfo provides a mock function with given fields: _a0, _a1
func (_m *MockIdentityServer) GetPluginInfo(_a0 context.Context, _a1 *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetPluginInfo")
}
var r0 *csi.GetPluginInfoResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.GetPluginInfoRequest) *csi.GetPluginInfoResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.GetPluginInfoResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.GetPluginInfoRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockIdentityServer_GetPluginInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPluginInfo'
type MockIdentityServer_GetPluginInfo_Call struct {
*mock.Call
}
// GetPluginInfo is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.GetPluginInfoRequest
func (_e *MockIdentityServer_Expecter) GetPluginInfo(_a0 interface{}, _a1 interface{}) *MockIdentityServer_GetPluginInfo_Call {
return &MockIdentityServer_GetPluginInfo_Call{Call: _e.mock.On("GetPluginInfo", _a0, _a1)}
}
func (_c *MockIdentityServer_GetPluginInfo_Call) Run(run func(_a0 context.Context, _a1 *csi.GetPluginInfoRequest)) *MockIdentityServer_GetPluginInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.GetPluginInfoRequest))
})
return _c
}
func (_c *MockIdentityServer_GetPluginInfo_Call) Return(_a0 *csi.GetPluginInfoResponse, _a1 error) *MockIdentityServer_GetPluginInfo_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockIdentityServer_GetPluginInfo_Call) RunAndReturn(run func(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)) *MockIdentityServer_GetPluginInfo_Call {
_c.Call.Return(run)
return _c
}
// Probe provides a mock function with given fields: _a0, _a1
func (_m *MockIdentityServer) Probe(_a0 context.Context, _a1 *csi.ProbeRequest) (*csi.ProbeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for Probe")
}
var r0 *csi.ProbeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.ProbeRequest) *csi.ProbeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.ProbeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.ProbeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockIdentityServer_Probe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Probe'
type MockIdentityServer_Probe_Call struct {
*mock.Call
}
// Probe is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.ProbeRequest
func (_e *MockIdentityServer_Expecter) Probe(_a0 interface{}, _a1 interface{}) *MockIdentityServer_Probe_Call {
return &MockIdentityServer_Probe_Call{Call: _e.mock.On("Probe", _a0, _a1)}
}
func (_c *MockIdentityServer_Probe_Call) Run(run func(_a0 context.Context, _a1 *csi.ProbeRequest)) *MockIdentityServer_Probe_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.ProbeRequest))
})
return _c
}
func (_c *MockIdentityServer_Probe_Call) Return(_a0 *csi.ProbeResponse, _a1 error) *MockIdentityServer_Probe_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockIdentityServer_Probe_Call) RunAndReturn(run func(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error)) *MockIdentityServer_Probe_Call {
_c.Call.Return(run)
return _c
}
// NewMockIdentityServer creates a new instance of MockIdentityServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockIdentityServer(t interface {
mock.TestingT
Cleanup(func())
}) *MockIdentityServer {
mock := &MockIdentityServer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,525 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package driver
import (
context "context"
csi "github.com/container-storage-interface/spec/lib/go/csi"
mock "github.com/stretchr/testify/mock"
)
// MockNodeServer is an autogenerated mock type for the NodeServer type
type MockNodeServer struct {
mock.Mock
}
type MockNodeServer_Expecter struct {
mock *mock.Mock
}
func (_m *MockNodeServer) EXPECT() *MockNodeServer_Expecter {
return &MockNodeServer_Expecter{mock: &_m.Mock}
}
// NodeExpandVolume provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodeExpandVolume(_a0 context.Context, _a1 *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodeExpandVolume")
}
var r0 *csi.NodeExpandVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeExpandVolumeRequest) *csi.NodeExpandVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodeExpandVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodeExpandVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodeExpandVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeExpandVolume'
type MockNodeServer_NodeExpandVolume_Call struct {
*mock.Call
}
// NodeExpandVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodeExpandVolumeRequest
func (_e *MockNodeServer_Expecter) NodeExpandVolume(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodeExpandVolume_Call {
return &MockNodeServer_NodeExpandVolume_Call{Call: _e.mock.On("NodeExpandVolume", _a0, _a1)}
}
func (_c *MockNodeServer_NodeExpandVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.NodeExpandVolumeRequest)) *MockNodeServer_NodeExpandVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodeExpandVolumeRequest))
})
return _c
}
func (_c *MockNodeServer_NodeExpandVolume_Call) Return(_a0 *csi.NodeExpandVolumeResponse, _a1 error) *MockNodeServer_NodeExpandVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodeExpandVolume_Call) RunAndReturn(run func(context.Context, *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)) *MockNodeServer_NodeExpandVolume_Call {
_c.Call.Return(run)
return _c
}
// NodeGetCapabilities provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodeGetCapabilities(_a0 context.Context, _a1 *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodeGetCapabilities")
}
var r0 *csi.NodeGetCapabilitiesResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeGetCapabilitiesRequest) *csi.NodeGetCapabilitiesResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodeGetCapabilitiesResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodeGetCapabilitiesRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodeGetCapabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeGetCapabilities'
type MockNodeServer_NodeGetCapabilities_Call struct {
*mock.Call
}
// NodeGetCapabilities is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodeGetCapabilitiesRequest
func (_e *MockNodeServer_Expecter) NodeGetCapabilities(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodeGetCapabilities_Call {
return &MockNodeServer_NodeGetCapabilities_Call{Call: _e.mock.On("NodeGetCapabilities", _a0, _a1)}
}
func (_c *MockNodeServer_NodeGetCapabilities_Call) Run(run func(_a0 context.Context, _a1 *csi.NodeGetCapabilitiesRequest)) *MockNodeServer_NodeGetCapabilities_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodeGetCapabilitiesRequest))
})
return _c
}
func (_c *MockNodeServer_NodeGetCapabilities_Call) Return(_a0 *csi.NodeGetCapabilitiesResponse, _a1 error) *MockNodeServer_NodeGetCapabilities_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodeGetCapabilities_Call) RunAndReturn(run func(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)) *MockNodeServer_NodeGetCapabilities_Call {
_c.Call.Return(run)
return _c
}
// NodeGetInfo provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodeGetInfo(_a0 context.Context, _a1 *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodeGetInfo")
}
var r0 *csi.NodeGetInfoResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeGetInfoRequest) *csi.NodeGetInfoResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodeGetInfoResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodeGetInfoRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodeGetInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeGetInfo'
type MockNodeServer_NodeGetInfo_Call struct {
*mock.Call
}
// NodeGetInfo is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodeGetInfoRequest
func (_e *MockNodeServer_Expecter) NodeGetInfo(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodeGetInfo_Call {
return &MockNodeServer_NodeGetInfo_Call{Call: _e.mock.On("NodeGetInfo", _a0, _a1)}
}
func (_c *MockNodeServer_NodeGetInfo_Call) Run(run func(_a0 context.Context, _a1 *csi.NodeGetInfoRequest)) *MockNodeServer_NodeGetInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodeGetInfoRequest))
})
return _c
}
func (_c *MockNodeServer_NodeGetInfo_Call) Return(_a0 *csi.NodeGetInfoResponse, _a1 error) *MockNodeServer_NodeGetInfo_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodeGetInfo_Call) RunAndReturn(run func(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)) *MockNodeServer_NodeGetInfo_Call {
_c.Call.Return(run)
return _c
}
// NodeGetVolumeStats provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodeGetVolumeStats(_a0 context.Context, _a1 *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodeGetVolumeStats")
}
var r0 *csi.NodeGetVolumeStatsResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeGetVolumeStatsRequest) *csi.NodeGetVolumeStatsResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodeGetVolumeStatsResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodeGetVolumeStatsRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodeGetVolumeStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeGetVolumeStats'
type MockNodeServer_NodeGetVolumeStats_Call struct {
*mock.Call
}
// NodeGetVolumeStats is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodeGetVolumeStatsRequest
func (_e *MockNodeServer_Expecter) NodeGetVolumeStats(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodeGetVolumeStats_Call {
return &MockNodeServer_NodeGetVolumeStats_Call{Call: _e.mock.On("NodeGetVolumeStats", _a0, _a1)}
}
func (_c *MockNodeServer_NodeGetVolumeStats_Call) Run(run func(_a0 context.Context, _a1 *csi.NodeGetVolumeStatsRequest)) *MockNodeServer_NodeGetVolumeStats_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodeGetVolumeStatsRequest))
})
return _c
}
func (_c *MockNodeServer_NodeGetVolumeStats_Call) Return(_a0 *csi.NodeGetVolumeStatsResponse, _a1 error) *MockNodeServer_NodeGetVolumeStats_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodeGetVolumeStats_Call) RunAndReturn(run func(context.Context, *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)) *MockNodeServer_NodeGetVolumeStats_Call {
_c.Call.Return(run)
return _c
}
// NodePublishVolume provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodePublishVolume(_a0 context.Context, _a1 *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodePublishVolume")
}
var r0 *csi.NodePublishVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodePublishVolumeRequest) *csi.NodePublishVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodePublishVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodePublishVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodePublishVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodePublishVolume'
type MockNodeServer_NodePublishVolume_Call struct {
*mock.Call
}
// NodePublishVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodePublishVolumeRequest
func (_e *MockNodeServer_Expecter) NodePublishVolume(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodePublishVolume_Call {
return &MockNodeServer_NodePublishVolume_Call{Call: _e.mock.On("NodePublishVolume", _a0, _a1)}
}
func (_c *MockNodeServer_NodePublishVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.NodePublishVolumeRequest)) *MockNodeServer_NodePublishVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodePublishVolumeRequest))
})
return _c
}
func (_c *MockNodeServer_NodePublishVolume_Call) Return(_a0 *csi.NodePublishVolumeResponse, _a1 error) *MockNodeServer_NodePublishVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodePublishVolume_Call) RunAndReturn(run func(context.Context, *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)) *MockNodeServer_NodePublishVolume_Call {
_c.Call.Return(run)
return _c
}
// NodeStageVolume provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodeStageVolume(_a0 context.Context, _a1 *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodeStageVolume")
}
var r0 *csi.NodeStageVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeStageVolumeRequest) *csi.NodeStageVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodeStageVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodeStageVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodeStageVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeStageVolume'
type MockNodeServer_NodeStageVolume_Call struct {
*mock.Call
}
// NodeStageVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodeStageVolumeRequest
func (_e *MockNodeServer_Expecter) NodeStageVolume(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodeStageVolume_Call {
return &MockNodeServer_NodeStageVolume_Call{Call: _e.mock.On("NodeStageVolume", _a0, _a1)}
}
func (_c *MockNodeServer_NodeStageVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.NodeStageVolumeRequest)) *MockNodeServer_NodeStageVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodeStageVolumeRequest))
})
return _c
}
func (_c *MockNodeServer_NodeStageVolume_Call) Return(_a0 *csi.NodeStageVolumeResponse, _a1 error) *MockNodeServer_NodeStageVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodeStageVolume_Call) RunAndReturn(run func(context.Context, *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)) *MockNodeServer_NodeStageVolume_Call {
_c.Call.Return(run)
return _c
}
// NodeUnpublishVolume provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodeUnpublishVolume(_a0 context.Context, _a1 *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodeUnpublishVolume")
}
var r0 *csi.NodeUnpublishVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeUnpublishVolumeRequest) *csi.NodeUnpublishVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodeUnpublishVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodeUnpublishVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodeUnpublishVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeUnpublishVolume'
type MockNodeServer_NodeUnpublishVolume_Call struct {
*mock.Call
}
// NodeUnpublishVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodeUnpublishVolumeRequest
func (_e *MockNodeServer_Expecter) NodeUnpublishVolume(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodeUnpublishVolume_Call {
return &MockNodeServer_NodeUnpublishVolume_Call{Call: _e.mock.On("NodeUnpublishVolume", _a0, _a1)}
}
func (_c *MockNodeServer_NodeUnpublishVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.NodeUnpublishVolumeRequest)) *MockNodeServer_NodeUnpublishVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodeUnpublishVolumeRequest))
})
return _c
}
func (_c *MockNodeServer_NodeUnpublishVolume_Call) Return(_a0 *csi.NodeUnpublishVolumeResponse, _a1 error) *MockNodeServer_NodeUnpublishVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodeUnpublishVolume_Call) RunAndReturn(run func(context.Context, *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)) *MockNodeServer_NodeUnpublishVolume_Call {
_c.Call.Return(run)
return _c
}
// NodeUnstageVolume provides a mock function with given fields: _a0, _a1
func (_m *MockNodeServer) NodeUnstageVolume(_a0 context.Context, _a1 *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for NodeUnstageVolume")
}
var r0 *csi.NodeUnstageVolumeResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *csi.NodeUnstageVolumeRequest) *csi.NodeUnstageVolumeResponse); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*csi.NodeUnstageVolumeResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *csi.NodeUnstageVolumeRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockNodeServer_NodeUnstageVolume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeUnstageVolume'
type MockNodeServer_NodeUnstageVolume_Call struct {
*mock.Call
}
// NodeUnstageVolume is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *csi.NodeUnstageVolumeRequest
func (_e *MockNodeServer_Expecter) NodeUnstageVolume(_a0 interface{}, _a1 interface{}) *MockNodeServer_NodeUnstageVolume_Call {
return &MockNodeServer_NodeUnstageVolume_Call{Call: _e.mock.On("NodeUnstageVolume", _a0, _a1)}
}
func (_c *MockNodeServer_NodeUnstageVolume_Call) Run(run func(_a0 context.Context, _a1 *csi.NodeUnstageVolumeRequest)) *MockNodeServer_NodeUnstageVolume_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*csi.NodeUnstageVolumeRequest))
})
return _c
}
func (_c *MockNodeServer_NodeUnstageVolume_Call) Return(_a0 *csi.NodeUnstageVolumeResponse, _a1 error) *MockNodeServer_NodeUnstageVolume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockNodeServer_NodeUnstageVolume_Call) RunAndReturn(run func(context.Context, *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)) *MockNodeServer_NodeUnstageVolume_Call {
_c.Call.Return(run)
return _c
}
// NewMockNodeServer creates a new instance of MockNodeServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockNodeServer(t interface {
mock.TestingT
Cleanup(func())
}) *MockNodeServer {
mock := &MockNodeServer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,12 @@
---
dir: .
filename: mock_{{.InterfaceName | snakecase}}.go
boilerplate-file: ../../../../hack/boilerplate/boilerplate.generatego.txt
inpackage: true
with-expecter: true
filename: mocks.go
template: testify
template-data:
boilerplate-file: ../../../../hack/boilerplate/boilerplate.generatego.txt
unroll-variadic: true
packages:
k8s.io/kubernetes/test/utils/oidc/handlers:
interfaces:
JWKsHandler:
config:
filename: mock_jwks_handler.go
TokenHandler:
JWKsHandler: {}
TokenHandler: {}

View file

@ -1,96 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package handlers
import (
mock "github.com/stretchr/testify/mock"
jose "gopkg.in/go-jose/go-jose.v2"
)
// MockJWKsHandler is an autogenerated mock type for the JWKsHandler type
type MockJWKsHandler struct {
mock.Mock
}
type MockJWKsHandler_Expecter struct {
mock *mock.Mock
}
func (_m *MockJWKsHandler) EXPECT() *MockJWKsHandler_Expecter {
return &MockJWKsHandler_Expecter{mock: &_m.Mock}
}
// KeySet provides a mock function with no fields
func (_m *MockJWKsHandler) KeySet() jose.JSONWebKeySet {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for KeySet")
}
var r0 jose.JSONWebKeySet
if rf, ok := ret.Get(0).(func() jose.JSONWebKeySet); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(jose.JSONWebKeySet)
}
return r0
}
// MockJWKsHandler_KeySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KeySet'
type MockJWKsHandler_KeySet_Call struct {
*mock.Call
}
// KeySet is a helper method to define mock.On call
func (_e *MockJWKsHandler_Expecter) KeySet() *MockJWKsHandler_KeySet_Call {
return &MockJWKsHandler_KeySet_Call{Call: _e.mock.On("KeySet")}
}
func (_c *MockJWKsHandler_KeySet_Call) Run(run func()) *MockJWKsHandler_KeySet_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockJWKsHandler_KeySet_Call) Return(_a0 jose.JSONWebKeySet) *MockJWKsHandler_KeySet_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockJWKsHandler_KeySet_Call) RunAndReturn(run func() jose.JSONWebKeySet) *MockJWKsHandler_KeySet_Call {
_c.Call.Return(run)
return _c
}
// NewMockJWKsHandler creates a new instance of MockJWKsHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockJWKsHandler(t interface {
mock.TestingT
Cleanup(func())
}) *MockJWKsHandler {
mock := &MockJWKsHandler{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -1,103 +0,0 @@
/*
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.
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.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package handlers
import mock "github.com/stretchr/testify/mock"
// MockTokenHandler is an autogenerated mock type for the TokenHandler type
type MockTokenHandler struct {
mock.Mock
}
type MockTokenHandler_Expecter struct {
mock *mock.Mock
}
func (_m *MockTokenHandler) EXPECT() *MockTokenHandler_Expecter {
return &MockTokenHandler_Expecter{mock: &_m.Mock}
}
// Token provides a mock function with no fields
func (_m *MockTokenHandler) Token() (Token, error) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Token")
}
var r0 Token
var r1 error
if rf, ok := ret.Get(0).(func() (Token, error)); ok {
return rf()
}
if rf, ok := ret.Get(0).(func() Token); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(Token)
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockTokenHandler_Token_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Token'
type MockTokenHandler_Token_Call struct {
*mock.Call
}
// Token is a helper method to define mock.On call
func (_e *MockTokenHandler_Expecter) Token() *MockTokenHandler_Token_Call {
return &MockTokenHandler_Token_Call{Call: _e.mock.On("Token")}
}
func (_c *MockTokenHandler_Token_Call) Run(run func()) *MockTokenHandler_Token_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockTokenHandler_Token_Call) Return(_a0 Token, _a1 error) *MockTokenHandler_Token_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockTokenHandler_Token_Call) RunAndReturn(run func() (Token, error)) *MockTokenHandler_Token_Call {
_c.Call.Return(run)
return _c
}
// NewMockTokenHandler creates a new instance of MockTokenHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockTokenHandler(t interface {
mock.TestingT
Cleanup(func())
}) *MockTokenHandler {
mock := &MockTokenHandler{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View file

@ -0,0 +1,177 @@
/*
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.
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.
*/
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package handlers
import (
mock "github.com/stretchr/testify/mock"
"gopkg.in/go-jose/go-jose.v2"
)
// NewMockTokenHandler creates a new instance of MockTokenHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockTokenHandler(t interface {
mock.TestingT
Cleanup(func())
}) *MockTokenHandler {
mock := &MockTokenHandler{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockTokenHandler is an autogenerated mock type for the TokenHandler type
type MockTokenHandler struct {
mock.Mock
}
type MockTokenHandler_Expecter struct {
mock *mock.Mock
}
func (_m *MockTokenHandler) EXPECT() *MockTokenHandler_Expecter {
return &MockTokenHandler_Expecter{mock: &_m.Mock}
}
// Token provides a mock function for the type MockTokenHandler
func (_mock *MockTokenHandler) Token() (Token, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Token")
}
var r0 Token
var r1 error
if returnFunc, ok := ret.Get(0).(func() (Token, error)); ok {
return returnFunc()
}
if returnFunc, ok := ret.Get(0).(func() Token); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(Token)
}
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockTokenHandler_Token_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Token'
type MockTokenHandler_Token_Call struct {
*mock.Call
}
// Token is a helper method to define mock.On call
func (_e *MockTokenHandler_Expecter) Token() *MockTokenHandler_Token_Call {
return &MockTokenHandler_Token_Call{Call: _e.mock.On("Token")}
}
func (_c *MockTokenHandler_Token_Call) Run(run func()) *MockTokenHandler_Token_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockTokenHandler_Token_Call) Return(token Token, err error) *MockTokenHandler_Token_Call {
_c.Call.Return(token, err)
return _c
}
func (_c *MockTokenHandler_Token_Call) RunAndReturn(run func() (Token, error)) *MockTokenHandler_Token_Call {
_c.Call.Return(run)
return _c
}
// NewMockJWKsHandler creates a new instance of MockJWKsHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockJWKsHandler(t interface {
mock.TestingT
Cleanup(func())
}) *MockJWKsHandler {
mock := &MockJWKsHandler{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockJWKsHandler is an autogenerated mock type for the JWKsHandler type
type MockJWKsHandler struct {
mock.Mock
}
type MockJWKsHandler_Expecter struct {
mock *mock.Mock
}
func (_m *MockJWKsHandler) EXPECT() *MockJWKsHandler_Expecter {
return &MockJWKsHandler_Expecter{mock: &_m.Mock}
}
// KeySet provides a mock function for the type MockJWKsHandler
func (_mock *MockJWKsHandler) KeySet() jose.JSONWebKeySet {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for KeySet")
}
var r0 jose.JSONWebKeySet
if returnFunc, ok := ret.Get(0).(func() jose.JSONWebKeySet); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(jose.JSONWebKeySet)
}
return r0
}
// MockJWKsHandler_KeySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KeySet'
type MockJWKsHandler_KeySet_Call struct {
*mock.Call
}
// KeySet is a helper method to define mock.On call
func (_e *MockJWKsHandler_Expecter) KeySet() *MockJWKsHandler_KeySet_Call {
return &MockJWKsHandler_KeySet_Call{Call: _e.mock.On("KeySet")}
}
func (_c *MockJWKsHandler_KeySet_Call) Run(run func()) *MockJWKsHandler_KeySet_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockJWKsHandler_KeySet_Call) Return(jSONWebKeySet jose.JSONWebKeySet) *MockJWKsHandler_KeySet_Call {
_c.Call.Return(jSONWebKeySet)
return _c
}
func (_c *MockJWKsHandler_KeySet_Call) RunAndReturn(run func() jose.JSONWebKeySet) *MockJWKsHandler_KeySet_Call {
_c.Call.Return(run)
return _c
}