diff --git a/hack/tools/go.mod b/hack/tools/go.mod index e827a25232c..5b2f1a20548 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -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 diff --git a/hack/tools/go.sum b/hack/tools/go.sum index cb6a866c667..7cfa518fd26 100644 --- a/hack/tools/go.sum +++ b/hack/tools/go.sum @@ -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= diff --git a/hack/update-mocks.sh b/hack/update-mocks.sh index eb2b9760b8f..f84bb368521 100755 --- a/hack/update-mocks.sh +++ b/hack/update-mocks.sh @@ -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 diff --git a/pkg/kubelet/apis/podresources/.mockery.yaml b/pkg/kubelet/apis/podresources/.mockery.yaml index d25fc0979c7..bf7308edb78 100644 --- a/pkg/kubelet/apis/podresources/.mockery.yaml +++ b/pkg/kubelet/apis/podresources/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/apis/podresources/testing/cpus_provider.go b/pkg/kubelet/apis/podresources/testing/cpus_provider.go deleted file mode 100644 index ff193543d3e..00000000000 --- a/pkg/kubelet/apis/podresources/testing/cpus_provider.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/apis/podresources/testing/devices_provider.go b/pkg/kubelet/apis/podresources/testing/devices_provider.go deleted file mode 100644 index db086aa6b9c..00000000000 --- a/pkg/kubelet/apis/podresources/testing/devices_provider.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/apis/podresources/testing/dynamic_resources_provider.go b/pkg/kubelet/apis/podresources/testing/dynamic_resources_provider.go deleted file mode 100644 index e68ba5f8fda..00000000000 --- a/pkg/kubelet/apis/podresources/testing/dynamic_resources_provider.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/apis/podresources/testing/memory_provider.go b/pkg/kubelet/apis/podresources/testing/memory_provider.go deleted file mode 100644 index 506778e8508..00000000000 --- a/pkg/kubelet/apis/podresources/testing/memory_provider.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/apis/podresources/testing/mocks.go b/pkg/kubelet/apis/podresources/testing/mocks.go new file mode 100644 index 00000000000..cbda9159c9b --- /dev/null +++ b/pkg/kubelet/apis/podresources/testing/mocks.go @@ -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 +} diff --git a/pkg/kubelet/apis/podresources/testing/pods_provider.go b/pkg/kubelet/apis/podresources/testing/pods_provider.go deleted file mode 100644 index d917e0c7cad..00000000000 --- a/pkg/kubelet/apis/podresources/testing/pods_provider.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/cadvisor/.mockery.yaml b/pkg/kubelet/cadvisor/.mockery.yaml index b8d6ef3efaa..586061a15d9 100644 --- a/pkg/kubelet/cadvisor/.mockery.yaml +++ b/pkg/kubelet/cadvisor/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/cadvisor/testing/cadvisor_mock.go b/pkg/kubelet/cadvisor/testing/mocks.go similarity index 57% rename from pkg/kubelet/cadvisor/testing/cadvisor_mock.go rename to pkg/kubelet/cadvisor/testing/mocks.go index 3073773ba68..b781cad143a 100644 --- a/pkg/kubelet/cadvisor/testing/cadvisor_mock.go +++ b/pkg/kubelet/cadvisor/testing/mocks.go @@ -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 -} diff --git a/pkg/kubelet/cm/.mockery.yaml b/pkg/kubelet/cm/.mockery.yaml index 3a8ae030844..3236f7ce935 100644 --- a/pkg/kubelet/cm/.mockery.yaml +++ b/pkg/kubelet/cm/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/cm/testing/mock_container_manager.go b/pkg/kubelet/cm/testing/mock_container_manager.go deleted file mode 100644 index 0d56cec6ffd..00000000000 --- a/pkg/kubelet/cm/testing/mock_container_manager.go +++ /dev/null @@ -1,1729 +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 ( - cm "k8s.io/kubernetes/pkg/kubelet/cm" - cache "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" - - config "k8s.io/kubernetes/pkg/kubelet/config" - - container "k8s.io/kubernetes/pkg/kubelet/container" - - context "context" - - cri "k8s.io/cri-api/pkg/apis" - - framework "k8s.io/kubernetes/pkg/scheduler/framework" - - healthz "k8s.io/apiserver/pkg/server/healthz" - - lifecycle "k8s.io/kubernetes/pkg/kubelet/lifecycle" - - mock "github.com/stretchr/testify/mock" - - podresourcesv1 "k8s.io/kubelet/pkg/apis/podresources/v1" - - resourceupdates "k8s.io/kubernetes/pkg/kubelet/cm/resourceupdates" - - status "k8s.io/kubernetes/pkg/kubelet/status" - - types "k8s.io/apimachinery/pkg/types" - - v1 "k8s.io/api/core/v1" -) - -// MockContainerManager is an autogenerated mock type for the ContainerManager type -type MockContainerManager struct { - mock.Mock -} - -type MockContainerManager_Expecter struct { - mock *mock.Mock -} - -func (_m *MockContainerManager) EXPECT() *MockContainerManager_Expecter { - return &MockContainerManager_Expecter{mock: &_m.Mock} -} - -// ContainerHasExclusiveCPUs provides a mock function with given fields: pod, _a1 -func (_m *MockContainerManager) ContainerHasExclusiveCPUs(pod *v1.Pod, _a1 *v1.Container) bool { - ret := _m.Called(pod, _a1) - - if len(ret) == 0 { - panic("no return value specified for ContainerHasExclusiveCPUs") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(*v1.Pod, *v1.Container) bool); ok { - r0 = rf(pod, _a1) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockContainerManager_ContainerHasExclusiveCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerHasExclusiveCPUs' -type MockContainerManager_ContainerHasExclusiveCPUs_Call struct { - *mock.Call -} - -// ContainerHasExclusiveCPUs is a helper method to define mock.On call -// - pod *v1.Pod -// - _a1 *v1.Container -func (_e *MockContainerManager_Expecter) ContainerHasExclusiveCPUs(pod interface{}, _a1 interface{}) *MockContainerManager_ContainerHasExclusiveCPUs_Call { - return &MockContainerManager_ContainerHasExclusiveCPUs_Call{Call: _e.mock.On("ContainerHasExclusiveCPUs", pod, _a1)} -} - -func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) Run(run func(pod *v1.Pod, _a1 *v1.Container)) *MockContainerManager_ContainerHasExclusiveCPUs_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v1.Pod), args[1].(*v1.Container)) - }) - return _c -} - -func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) Return(_a0 bool) *MockContainerManager_ContainerHasExclusiveCPUs_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) RunAndReturn(run func(*v1.Pod, *v1.Container) bool) *MockContainerManager_ContainerHasExclusiveCPUs_Call { - _c.Call.Return(run) - return _c -} - -// GetAllocatableCPUs provides a mock function with no fields -func (_m *MockContainerManager) 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 -} - -// MockContainerManager_GetAllocatableCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableCPUs' -type MockContainerManager_GetAllocatableCPUs_Call struct { - *mock.Call -} - -// GetAllocatableCPUs is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetAllocatableCPUs() *MockContainerManager_GetAllocatableCPUs_Call { - return &MockContainerManager_GetAllocatableCPUs_Call{Call: _e.mock.On("GetAllocatableCPUs")} -} - -func (_c *MockContainerManager_GetAllocatableCPUs_Call) Run(run func()) *MockContainerManager_GetAllocatableCPUs_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetAllocatableCPUs_Call) Return(_a0 []int64) *MockContainerManager_GetAllocatableCPUs_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetAllocatableCPUs_Call) RunAndReturn(run func() []int64) *MockContainerManager_GetAllocatableCPUs_Call { - _c.Call.Return(run) - return _c -} - -// GetAllocatableDevices provides a mock function with no fields -func (_m *MockContainerManager) GetAllocatableDevices() []*podresourcesv1.ContainerDevices { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAllocatableDevices") - } - - var r0 []*podresourcesv1.ContainerDevices - if rf, ok := ret.Get(0).(func() []*podresourcesv1.ContainerDevices); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*podresourcesv1.ContainerDevices) - } - } - - return r0 -} - -// MockContainerManager_GetAllocatableDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableDevices' -type MockContainerManager_GetAllocatableDevices_Call struct { - *mock.Call -} - -// GetAllocatableDevices is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetAllocatableDevices() *MockContainerManager_GetAllocatableDevices_Call { - return &MockContainerManager_GetAllocatableDevices_Call{Call: _e.mock.On("GetAllocatableDevices")} -} - -func (_c *MockContainerManager_GetAllocatableDevices_Call) Run(run func()) *MockContainerManager_GetAllocatableDevices_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetAllocatableDevices_Call) Return(_a0 []*podresourcesv1.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetAllocatableDevices_Call) RunAndReturn(run func() []*podresourcesv1.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call { - _c.Call.Return(run) - return _c -} - -// GetAllocatableMemory provides a mock function with no fields -func (_m *MockContainerManager) GetAllocatableMemory() []*podresourcesv1.ContainerMemory { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAllocatableMemory") - } - - var r0 []*podresourcesv1.ContainerMemory - if rf, ok := ret.Get(0).(func() []*podresourcesv1.ContainerMemory); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*podresourcesv1.ContainerMemory) - } - } - - return r0 -} - -// MockContainerManager_GetAllocatableMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableMemory' -type MockContainerManager_GetAllocatableMemory_Call struct { - *mock.Call -} - -// GetAllocatableMemory is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetAllocatableMemory() *MockContainerManager_GetAllocatableMemory_Call { - return &MockContainerManager_GetAllocatableMemory_Call{Call: _e.mock.On("GetAllocatableMemory")} -} - -func (_c *MockContainerManager_GetAllocatableMemory_Call) Run(run func()) *MockContainerManager_GetAllocatableMemory_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetAllocatableMemory_Call) Return(_a0 []*podresourcesv1.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetAllocatableMemory_Call) RunAndReturn(run func() []*podresourcesv1.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call { - _c.Call.Return(run) - return _c -} - -// GetAllocateResourcesPodAdmitHandler provides a mock function with no fields -func (_m *MockContainerManager) GetAllocateResourcesPodAdmitHandler() lifecycle.PodAdmitHandler { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAllocateResourcesPodAdmitHandler") - } - - var r0 lifecycle.PodAdmitHandler - if rf, ok := ret.Get(0).(func() lifecycle.PodAdmitHandler); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(lifecycle.PodAdmitHandler) - } - } - - return r0 -} - -// MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocateResourcesPodAdmitHandler' -type MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call struct { - *mock.Call -} - -// GetAllocateResourcesPodAdmitHandler is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetAllocateResourcesPodAdmitHandler() *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { - return &MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call{Call: _e.mock.On("GetAllocateResourcesPodAdmitHandler")} -} - -func (_c *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call) Run(run func()) *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call) Return(_a0 lifecycle.PodAdmitHandler) *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call) RunAndReturn(run func() lifecycle.PodAdmitHandler) *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { - _c.Call.Return(run) - return _c -} - -// GetCPUs provides a mock function with given fields: podUID, containerName -func (_m *MockContainerManager) 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 -} - -// MockContainerManager_GetCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCPUs' -type MockContainerManager_GetCPUs_Call struct { - *mock.Call -} - -// GetCPUs is a helper method to define mock.On call -// - podUID string -// - containerName string -func (_e *MockContainerManager_Expecter) GetCPUs(podUID interface{}, containerName interface{}) *MockContainerManager_GetCPUs_Call { - return &MockContainerManager_GetCPUs_Call{Call: _e.mock.On("GetCPUs", podUID, containerName)} -} - -func (_c *MockContainerManager_GetCPUs_Call) Run(run func(podUID string, containerName string)) *MockContainerManager_GetCPUs_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockContainerManager_GetCPUs_Call) Return(_a0 []int64) *MockContainerManager_GetCPUs_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetCPUs_Call) RunAndReturn(run func(string, string) []int64) *MockContainerManager_GetCPUs_Call { - _c.Call.Return(run) - return _c -} - -// GetCapacity provides a mock function with given fields: localStorageCapacityIsolation -func (_m *MockContainerManager) GetCapacity(localStorageCapacityIsolation bool) v1.ResourceList { - ret := _m.Called(localStorageCapacityIsolation) - - if len(ret) == 0 { - panic("no return value specified for GetCapacity") - } - - var r0 v1.ResourceList - if rf, ok := ret.Get(0).(func(bool) v1.ResourceList); ok { - r0 = rf(localStorageCapacityIsolation) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(v1.ResourceList) - } - } - - return r0 -} - -// MockContainerManager_GetCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCapacity' -type MockContainerManager_GetCapacity_Call struct { - *mock.Call -} - -// GetCapacity is a helper method to define mock.On call -// - localStorageCapacityIsolation bool -func (_e *MockContainerManager_Expecter) GetCapacity(localStorageCapacityIsolation interface{}) *MockContainerManager_GetCapacity_Call { - return &MockContainerManager_GetCapacity_Call{Call: _e.mock.On("GetCapacity", localStorageCapacityIsolation)} -} - -func (_c *MockContainerManager_GetCapacity_Call) Run(run func(localStorageCapacityIsolation bool)) *MockContainerManager_GetCapacity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(bool)) - }) - return _c -} - -func (_c *MockContainerManager_GetCapacity_Call) Return(_a0 v1.ResourceList) *MockContainerManager_GetCapacity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetCapacity_Call) RunAndReturn(run func(bool) v1.ResourceList) *MockContainerManager_GetCapacity_Call { - _c.Call.Return(run) - return _c -} - -// GetDevicePluginResourceCapacity provides a mock function with no fields -func (_m *MockContainerManager) GetDevicePluginResourceCapacity() (v1.ResourceList, v1.ResourceList, []string) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetDevicePluginResourceCapacity") - } - - var r0 v1.ResourceList - var r1 v1.ResourceList - var r2 []string - if rf, ok := ret.Get(0).(func() (v1.ResourceList, v1.ResourceList, []string)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() v1.ResourceList); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(v1.ResourceList) - } - } - - if rf, ok := ret.Get(1).(func() v1.ResourceList); ok { - r1 = rf() - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(v1.ResourceList) - } - } - - if rf, ok := ret.Get(2).(func() []string); ok { - r2 = rf() - } else { - if ret.Get(2) != nil { - r2 = ret.Get(2).([]string) - } - } - - return r0, r1, r2 -} - -// MockContainerManager_GetDevicePluginResourceCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDevicePluginResourceCapacity' -type MockContainerManager_GetDevicePluginResourceCapacity_Call struct { - *mock.Call -} - -// GetDevicePluginResourceCapacity is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetDevicePluginResourceCapacity() *MockContainerManager_GetDevicePluginResourceCapacity_Call { - return &MockContainerManager_GetDevicePluginResourceCapacity_Call{Call: _e.mock.On("GetDevicePluginResourceCapacity")} -} - -func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) Run(run func()) *MockContainerManager_GetDevicePluginResourceCapacity_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) Return(_a0 v1.ResourceList, _a1 v1.ResourceList, _a2 []string) *MockContainerManager_GetDevicePluginResourceCapacity_Call { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) RunAndReturn(run func() (v1.ResourceList, v1.ResourceList, []string)) *MockContainerManager_GetDevicePluginResourceCapacity_Call { - _c.Call.Return(run) - return _c -} - -// GetDevices provides a mock function with given fields: podUID, containerName -func (_m *MockContainerManager) GetDevices(podUID string, containerName string) []*podresourcesv1.ContainerDevices { - ret := _m.Called(podUID, containerName) - - if len(ret) == 0 { - panic("no return value specified for GetDevices") - } - - var r0 []*podresourcesv1.ContainerDevices - if rf, ok := ret.Get(0).(func(string, string) []*podresourcesv1.ContainerDevices); ok { - r0 = rf(podUID, containerName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*podresourcesv1.ContainerDevices) - } - } - - return r0 -} - -// MockContainerManager_GetDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDevices' -type MockContainerManager_GetDevices_Call struct { - *mock.Call -} - -// GetDevices is a helper method to define mock.On call -// - podUID string -// - containerName string -func (_e *MockContainerManager_Expecter) GetDevices(podUID interface{}, containerName interface{}) *MockContainerManager_GetDevices_Call { - return &MockContainerManager_GetDevices_Call{Call: _e.mock.On("GetDevices", podUID, containerName)} -} - -func (_c *MockContainerManager_GetDevices_Call) Run(run func(podUID string, containerName string)) *MockContainerManager_GetDevices_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockContainerManager_GetDevices_Call) Return(_a0 []*podresourcesv1.ContainerDevices) *MockContainerManager_GetDevices_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetDevices_Call) RunAndReturn(run func(string, string) []*podresourcesv1.ContainerDevices) *MockContainerManager_GetDevices_Call { - _c.Call.Return(run) - return _c -} - -// GetDynamicResources provides a mock function with given fields: pod, _a1 -func (_m *MockContainerManager) GetDynamicResources(pod *v1.Pod, _a1 *v1.Container) []*podresourcesv1.DynamicResource { - ret := _m.Called(pod, _a1) - - 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, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*podresourcesv1.DynamicResource) - } - } - - return r0 -} - -// MockContainerManager_GetDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicResources' -type MockContainerManager_GetDynamicResources_Call struct { - *mock.Call -} - -// GetDynamicResources is a helper method to define mock.On call -// - pod *v1.Pod -// - _a1 *v1.Container -func (_e *MockContainerManager_Expecter) GetDynamicResources(pod interface{}, _a1 interface{}) *MockContainerManager_GetDynamicResources_Call { - return &MockContainerManager_GetDynamicResources_Call{Call: _e.mock.On("GetDynamicResources", pod, _a1)} -} - -func (_c *MockContainerManager_GetDynamicResources_Call) Run(run func(pod *v1.Pod, _a1 *v1.Container)) *MockContainerManager_GetDynamicResources_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v1.Pod), args[1].(*v1.Container)) - }) - return _c -} - -func (_c *MockContainerManager_GetDynamicResources_Call) Return(_a0 []*podresourcesv1.DynamicResource) *MockContainerManager_GetDynamicResources_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetDynamicResources_Call) RunAndReturn(run func(*v1.Pod, *v1.Container) []*podresourcesv1.DynamicResource) *MockContainerManager_GetDynamicResources_Call { - _c.Call.Return(run) - return _c -} - -// GetHealthCheckers provides a mock function with no fields -func (_m *MockContainerManager) GetHealthCheckers() []healthz.HealthChecker { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetHealthCheckers") - } - - var r0 []healthz.HealthChecker - if rf, ok := ret.Get(0).(func() []healthz.HealthChecker); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]healthz.HealthChecker) - } - } - - return r0 -} - -// MockContainerManager_GetHealthCheckers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHealthCheckers' -type MockContainerManager_GetHealthCheckers_Call struct { - *mock.Call -} - -// GetHealthCheckers is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetHealthCheckers() *MockContainerManager_GetHealthCheckers_Call { - return &MockContainerManager_GetHealthCheckers_Call{Call: _e.mock.On("GetHealthCheckers")} -} - -func (_c *MockContainerManager_GetHealthCheckers_Call) Run(run func()) *MockContainerManager_GetHealthCheckers_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetHealthCheckers_Call) Return(_a0 []healthz.HealthChecker) *MockContainerManager_GetHealthCheckers_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetHealthCheckers_Call) RunAndReturn(run func() []healthz.HealthChecker) *MockContainerManager_GetHealthCheckers_Call { - _c.Call.Return(run) - return _c -} - -// GetMemory provides a mock function with given fields: podUID, containerName -func (_m *MockContainerManager) GetMemory(podUID string, containerName string) []*podresourcesv1.ContainerMemory { - ret := _m.Called(podUID, containerName) - - if len(ret) == 0 { - panic("no return value specified for GetMemory") - } - - var r0 []*podresourcesv1.ContainerMemory - if rf, ok := ret.Get(0).(func(string, string) []*podresourcesv1.ContainerMemory); ok { - r0 = rf(podUID, containerName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*podresourcesv1.ContainerMemory) - } - } - - return r0 -} - -// MockContainerManager_GetMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMemory' -type MockContainerManager_GetMemory_Call struct { - *mock.Call -} - -// GetMemory is a helper method to define mock.On call -// - podUID string -// - containerName string -func (_e *MockContainerManager_Expecter) GetMemory(podUID interface{}, containerName interface{}) *MockContainerManager_GetMemory_Call { - return &MockContainerManager_GetMemory_Call{Call: _e.mock.On("GetMemory", podUID, containerName)} -} - -func (_c *MockContainerManager_GetMemory_Call) Run(run func(podUID string, containerName string)) *MockContainerManager_GetMemory_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string)) - }) - return _c -} - -func (_c *MockContainerManager_GetMemory_Call) Return(_a0 []*podresourcesv1.ContainerMemory) *MockContainerManager_GetMemory_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetMemory_Call) RunAndReturn(run func(string, string) []*podresourcesv1.ContainerMemory) *MockContainerManager_GetMemory_Call { - _c.Call.Return(run) - return _c -} - -// GetMountedSubsystems provides a mock function with no fields -func (_m *MockContainerManager) GetMountedSubsystems() *cm.CgroupSubsystems { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetMountedSubsystems") - } - - var r0 *cm.CgroupSubsystems - if rf, ok := ret.Get(0).(func() *cm.CgroupSubsystems); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cm.CgroupSubsystems) - } - } - - return r0 -} - -// MockContainerManager_GetMountedSubsystems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMountedSubsystems' -type MockContainerManager_GetMountedSubsystems_Call struct { - *mock.Call -} - -// GetMountedSubsystems is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetMountedSubsystems() *MockContainerManager_GetMountedSubsystems_Call { - return &MockContainerManager_GetMountedSubsystems_Call{Call: _e.mock.On("GetMountedSubsystems")} -} - -func (_c *MockContainerManager_GetMountedSubsystems_Call) Run(run func()) *MockContainerManager_GetMountedSubsystems_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetMountedSubsystems_Call) Return(_a0 *cm.CgroupSubsystems) *MockContainerManager_GetMountedSubsystems_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetMountedSubsystems_Call) RunAndReturn(run func() *cm.CgroupSubsystems) *MockContainerManager_GetMountedSubsystems_Call { - _c.Call.Return(run) - return _c -} - -// GetNodeAllocatableAbsolute provides a mock function with no fields -func (_m *MockContainerManager) GetNodeAllocatableAbsolute() v1.ResourceList { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNodeAllocatableAbsolute") - } - - var r0 v1.ResourceList - if rf, ok := ret.Get(0).(func() v1.ResourceList); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(v1.ResourceList) - } - } - - return r0 -} - -// MockContainerManager_GetNodeAllocatableAbsolute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeAllocatableAbsolute' -type MockContainerManager_GetNodeAllocatableAbsolute_Call struct { - *mock.Call -} - -// GetNodeAllocatableAbsolute is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetNodeAllocatableAbsolute() *MockContainerManager_GetNodeAllocatableAbsolute_Call { - return &MockContainerManager_GetNodeAllocatableAbsolute_Call{Call: _e.mock.On("GetNodeAllocatableAbsolute")} -} - -func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) Run(run func()) *MockContainerManager_GetNodeAllocatableAbsolute_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) Return(_a0 v1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call { - _c.Call.Return(run) - return _c -} - -// GetNodeAllocatableReservation provides a mock function with no fields -func (_m *MockContainerManager) GetNodeAllocatableReservation() v1.ResourceList { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNodeAllocatableReservation") - } - - var r0 v1.ResourceList - if rf, ok := ret.Get(0).(func() v1.ResourceList); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(v1.ResourceList) - } - } - - return r0 -} - -// MockContainerManager_GetNodeAllocatableReservation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeAllocatableReservation' -type MockContainerManager_GetNodeAllocatableReservation_Call struct { - *mock.Call -} - -// GetNodeAllocatableReservation is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetNodeAllocatableReservation() *MockContainerManager_GetNodeAllocatableReservation_Call { - return &MockContainerManager_GetNodeAllocatableReservation_Call{Call: _e.mock.On("GetNodeAllocatableReservation")} -} - -func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) Run(run func()) *MockContainerManager_GetNodeAllocatableReservation_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) Return(_a0 v1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call { - _c.Call.Return(run) - return _c -} - -// GetNodeConfig provides a mock function with no fields -func (_m *MockContainerManager) GetNodeConfig() cm.NodeConfig { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNodeConfig") - } - - var r0 cm.NodeConfig - if rf, ok := ret.Get(0).(func() cm.NodeConfig); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(cm.NodeConfig) - } - - return r0 -} - -// MockContainerManager_GetNodeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeConfig' -type MockContainerManager_GetNodeConfig_Call struct { - *mock.Call -} - -// GetNodeConfig is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetNodeConfig() *MockContainerManager_GetNodeConfig_Call { - return &MockContainerManager_GetNodeConfig_Call{Call: _e.mock.On("GetNodeConfig")} -} - -func (_c *MockContainerManager_GetNodeConfig_Call) Run(run func()) *MockContainerManager_GetNodeConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetNodeConfig_Call) Return(_a0 cm.NodeConfig) *MockContainerManager_GetNodeConfig_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetNodeConfig_Call) RunAndReturn(run func() cm.NodeConfig) *MockContainerManager_GetNodeConfig_Call { - _c.Call.Return(run) - return _c -} - -// GetPluginRegistrationHandlers provides a mock function with no fields -func (_m *MockContainerManager) GetPluginRegistrationHandlers() map[string]cache.PluginHandler { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPluginRegistrationHandlers") - } - - var r0 map[string]cache.PluginHandler - if rf, ok := ret.Get(0).(func() map[string]cache.PluginHandler); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]cache.PluginHandler) - } - } - - return r0 -} - -// MockContainerManager_GetPluginRegistrationHandlers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPluginRegistrationHandlers' -type MockContainerManager_GetPluginRegistrationHandlers_Call struct { - *mock.Call -} - -// GetPluginRegistrationHandlers is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetPluginRegistrationHandlers() *MockContainerManager_GetPluginRegistrationHandlers_Call { - return &MockContainerManager_GetPluginRegistrationHandlers_Call{Call: _e.mock.On("GetPluginRegistrationHandlers")} -} - -func (_c *MockContainerManager_GetPluginRegistrationHandlers_Call) Run(run func()) *MockContainerManager_GetPluginRegistrationHandlers_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetPluginRegistrationHandlers_Call) Return(_a0 map[string]cache.PluginHandler) *MockContainerManager_GetPluginRegistrationHandlers_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetPluginRegistrationHandlers_Call) RunAndReturn(run func() map[string]cache.PluginHandler) *MockContainerManager_GetPluginRegistrationHandlers_Call { - _c.Call.Return(run) - return _c -} - -// GetPodCgroupRoot provides a mock function with no fields -func (_m *MockContainerManager) GetPodCgroupRoot() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPodCgroupRoot") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// MockContainerManager_GetPodCgroupRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodCgroupRoot' -type MockContainerManager_GetPodCgroupRoot_Call struct { - *mock.Call -} - -// GetPodCgroupRoot is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetPodCgroupRoot() *MockContainerManager_GetPodCgroupRoot_Call { - return &MockContainerManager_GetPodCgroupRoot_Call{Call: _e.mock.On("GetPodCgroupRoot")} -} - -func (_c *MockContainerManager_GetPodCgroupRoot_Call) Run(run func()) *MockContainerManager_GetPodCgroupRoot_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetPodCgroupRoot_Call) Return(_a0 string) *MockContainerManager_GetPodCgroupRoot_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetPodCgroupRoot_Call) RunAndReturn(run func() string) *MockContainerManager_GetPodCgroupRoot_Call { - _c.Call.Return(run) - return _c -} - -// GetQOSContainersInfo provides a mock function with no fields -func (_m *MockContainerManager) GetQOSContainersInfo() cm.QOSContainersInfo { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetQOSContainersInfo") - } - - var r0 cm.QOSContainersInfo - if rf, ok := ret.Get(0).(func() cm.QOSContainersInfo); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(cm.QOSContainersInfo) - } - - return r0 -} - -// MockContainerManager_GetQOSContainersInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetQOSContainersInfo' -type MockContainerManager_GetQOSContainersInfo_Call struct { - *mock.Call -} - -// GetQOSContainersInfo is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) GetQOSContainersInfo() *MockContainerManager_GetQOSContainersInfo_Call { - return &MockContainerManager_GetQOSContainersInfo_Call{Call: _e.mock.On("GetQOSContainersInfo")} -} - -func (_c *MockContainerManager_GetQOSContainersInfo_Call) Run(run func()) *MockContainerManager_GetQOSContainersInfo_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_GetQOSContainersInfo_Call) Return(_a0 cm.QOSContainersInfo) *MockContainerManager_GetQOSContainersInfo_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_GetQOSContainersInfo_Call) RunAndReturn(run func() cm.QOSContainersInfo) *MockContainerManager_GetQOSContainersInfo_Call { - _c.Call.Return(run) - return _c -} - -// GetResources provides a mock function with given fields: ctx, pod, _a2 -func (_m *MockContainerManager) GetResources(ctx context.Context, pod *v1.Pod, _a2 *v1.Container) (*container.RunContainerOptions, error) { - ret := _m.Called(ctx, pod, _a2) - - if len(ret) == 0 { - panic("no return value specified for GetResources") - } - - var r0 *container.RunContainerOptions - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod, *v1.Container) (*container.RunContainerOptions, error)); ok { - return rf(ctx, pod, _a2) - } - if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod, *v1.Container) *container.RunContainerOptions); ok { - r0 = rf(ctx, pod, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*container.RunContainerOptions) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *v1.Pod, *v1.Container) error); ok { - r1 = rf(ctx, pod, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockContainerManager_GetResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResources' -type MockContainerManager_GetResources_Call struct { - *mock.Call -} - -// GetResources is a helper method to define mock.On call -// - ctx context.Context -// - pod *v1.Pod -// - _a2 *v1.Container -func (_e *MockContainerManager_Expecter) GetResources(ctx interface{}, pod interface{}, _a2 interface{}) *MockContainerManager_GetResources_Call { - return &MockContainerManager_GetResources_Call{Call: _e.mock.On("GetResources", ctx, pod, _a2)} -} - -func (_c *MockContainerManager_GetResources_Call) Run(run func(ctx context.Context, pod *v1.Pod, _a2 *v1.Container)) *MockContainerManager_GetResources_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.Pod), args[2].(*v1.Container)) - }) - return _c -} - -func (_c *MockContainerManager_GetResources_Call) Return(_a0 *container.RunContainerOptions, _a1 error) *MockContainerManager_GetResources_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockContainerManager_GetResources_Call) RunAndReturn(run func(context.Context, *v1.Pod, *v1.Container) (*container.RunContainerOptions, error)) *MockContainerManager_GetResources_Call { - _c.Call.Return(run) - return _c -} - -// InternalContainerLifecycle provides a mock function with no fields -func (_m *MockContainerManager) InternalContainerLifecycle() cm.InternalContainerLifecycle { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for InternalContainerLifecycle") - } - - var r0 cm.InternalContainerLifecycle - if rf, ok := ret.Get(0).(func() cm.InternalContainerLifecycle); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(cm.InternalContainerLifecycle) - } - } - - return r0 -} - -// MockContainerManager_InternalContainerLifecycle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InternalContainerLifecycle' -type MockContainerManager_InternalContainerLifecycle_Call struct { - *mock.Call -} - -// InternalContainerLifecycle is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) InternalContainerLifecycle() *MockContainerManager_InternalContainerLifecycle_Call { - return &MockContainerManager_InternalContainerLifecycle_Call{Call: _e.mock.On("InternalContainerLifecycle")} -} - -func (_c *MockContainerManager_InternalContainerLifecycle_Call) Run(run func()) *MockContainerManager_InternalContainerLifecycle_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_InternalContainerLifecycle_Call) Return(_a0 cm.InternalContainerLifecycle) *MockContainerManager_InternalContainerLifecycle_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_InternalContainerLifecycle_Call) RunAndReturn(run func() cm.InternalContainerLifecycle) *MockContainerManager_InternalContainerLifecycle_Call { - _c.Call.Return(run) - return _c -} - -// NewPodContainerManager provides a mock function with no fields -func (_m *MockContainerManager) NewPodContainerManager() cm.PodContainerManager { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for NewPodContainerManager") - } - - var r0 cm.PodContainerManager - if rf, ok := ret.Get(0).(func() cm.PodContainerManager); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(cm.PodContainerManager) - } - } - - return r0 -} - -// MockContainerManager_NewPodContainerManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewPodContainerManager' -type MockContainerManager_NewPodContainerManager_Call struct { - *mock.Call -} - -// NewPodContainerManager is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) NewPodContainerManager() *MockContainerManager_NewPodContainerManager_Call { - return &MockContainerManager_NewPodContainerManager_Call{Call: _e.mock.On("NewPodContainerManager")} -} - -func (_c *MockContainerManager_NewPodContainerManager_Call) Run(run func()) *MockContainerManager_NewPodContainerManager_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_NewPodContainerManager_Call) Return(_a0 cm.PodContainerManager) *MockContainerManager_NewPodContainerManager_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_NewPodContainerManager_Call) RunAndReturn(run func() cm.PodContainerManager) *MockContainerManager_NewPodContainerManager_Call { - _c.Call.Return(run) - return _c -} - -// PodHasExclusiveCPUs provides a mock function with given fields: pod -func (_m *MockContainerManager) PodHasExclusiveCPUs(pod *v1.Pod) bool { - ret := _m.Called(pod) - - if len(ret) == 0 { - panic("no return value specified for PodHasExclusiveCPUs") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(*v1.Pod) bool); ok { - r0 = rf(pod) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockContainerManager_PodHasExclusiveCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PodHasExclusiveCPUs' -type MockContainerManager_PodHasExclusiveCPUs_Call struct { - *mock.Call -} - -// PodHasExclusiveCPUs is a helper method to define mock.On call -// - pod *v1.Pod -func (_e *MockContainerManager_Expecter) PodHasExclusiveCPUs(pod interface{}) *MockContainerManager_PodHasExclusiveCPUs_Call { - return &MockContainerManager_PodHasExclusiveCPUs_Call{Call: _e.mock.On("PodHasExclusiveCPUs", pod)} -} - -func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) Run(run func(pod *v1.Pod)) *MockContainerManager_PodHasExclusiveCPUs_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v1.Pod)) - }) - return _c -} - -func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) Return(_a0 bool) *MockContainerManager_PodHasExclusiveCPUs_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) RunAndReturn(run func(*v1.Pod) bool) *MockContainerManager_PodHasExclusiveCPUs_Call { - _c.Call.Return(run) - return _c -} - -// PodMightNeedToUnprepareResources provides a mock function with given fields: UID -func (_m *MockContainerManager) PodMightNeedToUnprepareResources(UID types.UID) bool { - ret := _m.Called(UID) - - if len(ret) == 0 { - panic("no return value specified for PodMightNeedToUnprepareResources") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(types.UID) bool); ok { - r0 = rf(UID) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockContainerManager_PodMightNeedToUnprepareResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PodMightNeedToUnprepareResources' -type MockContainerManager_PodMightNeedToUnprepareResources_Call struct { - *mock.Call -} - -// PodMightNeedToUnprepareResources is a helper method to define mock.On call -// - UID types.UID -func (_e *MockContainerManager_Expecter) PodMightNeedToUnprepareResources(UID interface{}) *MockContainerManager_PodMightNeedToUnprepareResources_Call { - return &MockContainerManager_PodMightNeedToUnprepareResources_Call{Call: _e.mock.On("PodMightNeedToUnprepareResources", UID)} -} - -func (_c *MockContainerManager_PodMightNeedToUnprepareResources_Call) Run(run func(UID types.UID)) *MockContainerManager_PodMightNeedToUnprepareResources_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(types.UID)) - }) - return _c -} - -func (_c *MockContainerManager_PodMightNeedToUnprepareResources_Call) Return(_a0 bool) *MockContainerManager_PodMightNeedToUnprepareResources_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_PodMightNeedToUnprepareResources_Call) RunAndReturn(run func(types.UID) bool) *MockContainerManager_PodMightNeedToUnprepareResources_Call { - _c.Call.Return(run) - return _c -} - -// PrepareDynamicResources provides a mock function with given fields: _a0, _a1 -func (_m *MockContainerManager) PrepareDynamicResources(_a0 context.Context, _a1 *v1.Pod) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for PrepareDynamicResources") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockContainerManager_PrepareDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareDynamicResources' -type MockContainerManager_PrepareDynamicResources_Call struct { - *mock.Call -} - -// PrepareDynamicResources is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *v1.Pod -func (_e *MockContainerManager_Expecter) PrepareDynamicResources(_a0 interface{}, _a1 interface{}) *MockContainerManager_PrepareDynamicResources_Call { - return &MockContainerManager_PrepareDynamicResources_Call{Call: _e.mock.On("PrepareDynamicResources", _a0, _a1)} -} - -func (_c *MockContainerManager_PrepareDynamicResources_Call) Run(run func(_a0 context.Context, _a1 *v1.Pod)) *MockContainerManager_PrepareDynamicResources_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.Pod)) - }) - return _c -} - -func (_c *MockContainerManager_PrepareDynamicResources_Call) Return(_a0 error) *MockContainerManager_PrepareDynamicResources_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_PrepareDynamicResources_Call) RunAndReturn(run func(context.Context, *v1.Pod) error) *MockContainerManager_PrepareDynamicResources_Call { - _c.Call.Return(run) - return _c -} - -// ShouldResetExtendedResourceCapacity provides a mock function with no fields -func (_m *MockContainerManager) ShouldResetExtendedResourceCapacity() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ShouldResetExtendedResourceCapacity") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// MockContainerManager_ShouldResetExtendedResourceCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShouldResetExtendedResourceCapacity' -type MockContainerManager_ShouldResetExtendedResourceCapacity_Call struct { - *mock.Call -} - -// ShouldResetExtendedResourceCapacity is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) ShouldResetExtendedResourceCapacity() *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { - return &MockContainerManager_ShouldResetExtendedResourceCapacity_Call{Call: _e.mock.On("ShouldResetExtendedResourceCapacity")} -} - -func (_c *MockContainerManager_ShouldResetExtendedResourceCapacity_Call) Run(run func()) *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_ShouldResetExtendedResourceCapacity_Call) Return(_a0 bool) *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_ShouldResetExtendedResourceCapacity_Call) RunAndReturn(run func() bool) *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { - _c.Call.Return(run) - return _c -} - -// Start provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7 -func (_m *MockContainerManager) Start(_a0 context.Context, _a1 *v1.Node, _a2 cm.ActivePodsFunc, _a3 cm.GetNodeFunc, _a4 config.SourcesReady, _a5 status.PodStatusProvider, _a6 cri.RuntimeService, _a7 bool) error { - ret := _m.Called(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7) - - if len(ret) == 0 { - panic("no return value specified for Start") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.Node, cm.ActivePodsFunc, cm.GetNodeFunc, config.SourcesReady, status.PodStatusProvider, cri.RuntimeService, bool) error); ok { - r0 = rf(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockContainerManager_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockContainerManager_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *v1.Node -// - _a2 cm.ActivePodsFunc -// - _a3 cm.GetNodeFunc -// - _a4 config.SourcesReady -// - _a5 status.PodStatusProvider -// - _a6 cri.RuntimeService -// - _a7 bool -func (_e *MockContainerManager_Expecter) Start(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}, _a5 interface{}, _a6 interface{}, _a7 interface{}) *MockContainerManager_Start_Call { - return &MockContainerManager_Start_Call{Call: _e.mock.On("Start", _a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7)} -} - -func (_c *MockContainerManager_Start_Call) Run(run func(_a0 context.Context, _a1 *v1.Node, _a2 cm.ActivePodsFunc, _a3 cm.GetNodeFunc, _a4 config.SourcesReady, _a5 status.PodStatusProvider, _a6 cri.RuntimeService, _a7 bool)) *MockContainerManager_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.Node), args[2].(cm.ActivePodsFunc), args[3].(cm.GetNodeFunc), args[4].(config.SourcesReady), args[5].(status.PodStatusProvider), args[6].(cri.RuntimeService), args[7].(bool)) - }) - return _c -} - -func (_c *MockContainerManager_Start_Call) Return(_a0 error) *MockContainerManager_Start_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_Start_Call) RunAndReturn(run func(context.Context, *v1.Node, cm.ActivePodsFunc, cm.GetNodeFunc, config.SourcesReady, status.PodStatusProvider, cri.RuntimeService, bool) error) *MockContainerManager_Start_Call { - _c.Call.Return(run) - return _c -} - -// Status provides a mock function with no fields -func (_m *MockContainerManager) Status() cm.Status { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Status") - } - - var r0 cm.Status - if rf, ok := ret.Get(0).(func() cm.Status); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(cm.Status) - } - - return r0 -} - -// MockContainerManager_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' -type MockContainerManager_Status_Call struct { - *mock.Call -} - -// Status is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) Status() *MockContainerManager_Status_Call { - return &MockContainerManager_Status_Call{Call: _e.mock.On("Status")} -} - -func (_c *MockContainerManager_Status_Call) Run(run func()) *MockContainerManager_Status_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_Status_Call) Return(_a0 cm.Status) *MockContainerManager_Status_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_Status_Call) RunAndReturn(run func() cm.Status) *MockContainerManager_Status_Call { - _c.Call.Return(run) - return _c -} - -// SystemCgroupsLimit provides a mock function with no fields -func (_m *MockContainerManager) SystemCgroupsLimit() v1.ResourceList { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SystemCgroupsLimit") - } - - var r0 v1.ResourceList - if rf, ok := ret.Get(0).(func() v1.ResourceList); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(v1.ResourceList) - } - } - - return r0 -} - -// MockContainerManager_SystemCgroupsLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SystemCgroupsLimit' -type MockContainerManager_SystemCgroupsLimit_Call struct { - *mock.Call -} - -// SystemCgroupsLimit is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) SystemCgroupsLimit() *MockContainerManager_SystemCgroupsLimit_Call { - return &MockContainerManager_SystemCgroupsLimit_Call{Call: _e.mock.On("SystemCgroupsLimit")} -} - -func (_c *MockContainerManager_SystemCgroupsLimit_Call) Run(run func()) *MockContainerManager_SystemCgroupsLimit_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_SystemCgroupsLimit_Call) Return(_a0 v1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_SystemCgroupsLimit_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call { - _c.Call.Return(run) - return _c -} - -// UnprepareDynamicResources provides a mock function with given fields: _a0, _a1 -func (_m *MockContainerManager) UnprepareDynamicResources(_a0 context.Context, _a1 *v1.Pod) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UnprepareDynamicResources") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockContainerManager_UnprepareDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnprepareDynamicResources' -type MockContainerManager_UnprepareDynamicResources_Call struct { - *mock.Call -} - -// UnprepareDynamicResources is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *v1.Pod -func (_e *MockContainerManager_Expecter) UnprepareDynamicResources(_a0 interface{}, _a1 interface{}) *MockContainerManager_UnprepareDynamicResources_Call { - return &MockContainerManager_UnprepareDynamicResources_Call{Call: _e.mock.On("UnprepareDynamicResources", _a0, _a1)} -} - -func (_c *MockContainerManager_UnprepareDynamicResources_Call) Run(run func(_a0 context.Context, _a1 *v1.Pod)) *MockContainerManager_UnprepareDynamicResources_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.Pod)) - }) - return _c -} - -func (_c *MockContainerManager_UnprepareDynamicResources_Call) Return(_a0 error) *MockContainerManager_UnprepareDynamicResources_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_UnprepareDynamicResources_Call) RunAndReturn(run func(context.Context, *v1.Pod) error) *MockContainerManager_UnprepareDynamicResources_Call { - _c.Call.Return(run) - return _c -} - -// UpdateAllocatedDevices provides a mock function with no fields -func (_m *MockContainerManager) UpdateAllocatedDevices() { - _m.Called() -} - -// MockContainerManager_UpdateAllocatedDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllocatedDevices' -type MockContainerManager_UpdateAllocatedDevices_Call struct { - *mock.Call -} - -// UpdateAllocatedDevices is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) UpdateAllocatedDevices() *MockContainerManager_UpdateAllocatedDevices_Call { - return &MockContainerManager_UpdateAllocatedDevices_Call{Call: _e.mock.On("UpdateAllocatedDevices")} -} - -func (_c *MockContainerManager_UpdateAllocatedDevices_Call) Run(run func()) *MockContainerManager_UpdateAllocatedDevices_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_UpdateAllocatedDevices_Call) Return() *MockContainerManager_UpdateAllocatedDevices_Call { - _c.Call.Return() - return _c -} - -func (_c *MockContainerManager_UpdateAllocatedDevices_Call) RunAndReturn(run func()) *MockContainerManager_UpdateAllocatedDevices_Call { - _c.Run(run) - return _c -} - -// UpdateAllocatedResourcesStatus provides a mock function with given fields: pod, _a1 -func (_m *MockContainerManager) UpdateAllocatedResourcesStatus(pod *v1.Pod, _a1 *v1.PodStatus) { - _m.Called(pod, _a1) -} - -// MockContainerManager_UpdateAllocatedResourcesStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllocatedResourcesStatus' -type MockContainerManager_UpdateAllocatedResourcesStatus_Call struct { - *mock.Call -} - -// UpdateAllocatedResourcesStatus is a helper method to define mock.On call -// - pod *v1.Pod -// - _a1 *v1.PodStatus -func (_e *MockContainerManager_Expecter) UpdateAllocatedResourcesStatus(pod interface{}, _a1 interface{}) *MockContainerManager_UpdateAllocatedResourcesStatus_Call { - return &MockContainerManager_UpdateAllocatedResourcesStatus_Call{Call: _e.mock.On("UpdateAllocatedResourcesStatus", pod, _a1)} -} - -func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) Run(run func(pod *v1.Pod, _a1 *v1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v1.Pod), args[1].(*v1.PodStatus)) - }) - return _c -} - -func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) Return() *MockContainerManager_UpdateAllocatedResourcesStatus_Call { - _c.Call.Return() - return _c -} - -func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) RunAndReturn(run func(*v1.Pod, *v1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call { - _c.Run(run) - return _c -} - -// UpdatePluginResources provides a mock function with given fields: _a0, _a1 -func (_m *MockContainerManager) UpdatePluginResources(_a0 *framework.NodeInfo, _a1 *lifecycle.PodAdmitAttributes) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdatePluginResources") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*framework.NodeInfo, *lifecycle.PodAdmitAttributes) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockContainerManager_UpdatePluginResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePluginResources' -type MockContainerManager_UpdatePluginResources_Call struct { - *mock.Call -} - -// UpdatePluginResources is a helper method to define mock.On call -// - _a0 *framework.NodeInfo -// - _a1 *lifecycle.PodAdmitAttributes -func (_e *MockContainerManager_Expecter) UpdatePluginResources(_a0 interface{}, _a1 interface{}) *MockContainerManager_UpdatePluginResources_Call { - return &MockContainerManager_UpdatePluginResources_Call{Call: _e.mock.On("UpdatePluginResources", _a0, _a1)} -} - -func (_c *MockContainerManager_UpdatePluginResources_Call) Run(run func(_a0 *framework.NodeInfo, _a1 *lifecycle.PodAdmitAttributes)) *MockContainerManager_UpdatePluginResources_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*framework.NodeInfo), args[1].(*lifecycle.PodAdmitAttributes)) - }) - return _c -} - -func (_c *MockContainerManager_UpdatePluginResources_Call) Return(_a0 error) *MockContainerManager_UpdatePluginResources_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_UpdatePluginResources_Call) RunAndReturn(run func(*framework.NodeInfo, *lifecycle.PodAdmitAttributes) error) *MockContainerManager_UpdatePluginResources_Call { - _c.Call.Return(run) - return _c -} - -// UpdateQOSCgroups provides a mock function with no fields -func (_m *MockContainerManager) UpdateQOSCgroups() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for UpdateQOSCgroups") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockContainerManager_UpdateQOSCgroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateQOSCgroups' -type MockContainerManager_UpdateQOSCgroups_Call struct { - *mock.Call -} - -// UpdateQOSCgroups is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) UpdateQOSCgroups() *MockContainerManager_UpdateQOSCgroups_Call { - return &MockContainerManager_UpdateQOSCgroups_Call{Call: _e.mock.On("UpdateQOSCgroups")} -} - -func (_c *MockContainerManager_UpdateQOSCgroups_Call) Run(run func()) *MockContainerManager_UpdateQOSCgroups_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_UpdateQOSCgroups_Call) Return(_a0 error) *MockContainerManager_UpdateQOSCgroups_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_UpdateQOSCgroups_Call) RunAndReturn(run func() error) *MockContainerManager_UpdateQOSCgroups_Call { - _c.Call.Return(run) - return _c -} - -// Updates provides a mock function with no fields -func (_m *MockContainerManager) Updates() <-chan resourceupdates.Update { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Updates") - } - - var r0 <-chan resourceupdates.Update - if rf, ok := ret.Get(0).(func() <-chan resourceupdates.Update); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan resourceupdates.Update) - } - } - - return r0 -} - -// MockContainerManager_Updates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Updates' -type MockContainerManager_Updates_Call struct { - *mock.Call -} - -// Updates is a helper method to define mock.On call -func (_e *MockContainerManager_Expecter) Updates() *MockContainerManager_Updates_Call { - return &MockContainerManager_Updates_Call{Call: _e.mock.On("Updates")} -} - -func (_c *MockContainerManager_Updates_Call) Run(run func()) *MockContainerManager_Updates_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockContainerManager_Updates_Call) Return(_a0 <-chan resourceupdates.Update) *MockContainerManager_Updates_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockContainerManager_Updates_Call) RunAndReturn(run func() <-chan resourceupdates.Update) *MockContainerManager_Updates_Call { - _c.Call.Return(run) - return _c -} - -// NewMockContainerManager creates a new instance of MockContainerManager. 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 NewMockContainerManager(t interface { - mock.TestingT - Cleanup(func()) -}) *MockContainerManager { - mock := &MockContainerManager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/kubelet/cm/testing/mock_pod_container_manager.go b/pkg/kubelet/cm/testing/mock_pod_container_manager.go deleted file mode 100644 index 97467682b06..00000000000 --- a/pkg/kubelet/cm/testing/mock_pod_container_manager.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/cm/testing/mocks.go b/pkg/kubelet/cm/testing/mocks.go new file mode 100644 index 00000000000..7c8df256102 --- /dev/null +++ b/pkg/kubelet/cm/testing/mocks.go @@ -0,0 +1,2452 @@ +/* +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 ( + "context" + + mock "github.com/stretchr/testify/mock" + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apiserver/pkg/server/healthz" + "k8s.io/cri-api/pkg/apis" + v10 "k8s.io/kubelet/pkg/apis/podresources/v1" + "k8s.io/kubernetes/pkg/kubelet/cm" + "k8s.io/kubernetes/pkg/kubelet/cm/resourceupdates" + "k8s.io/kubernetes/pkg/kubelet/config" + "k8s.io/kubernetes/pkg/kubelet/container" + "k8s.io/kubernetes/pkg/kubelet/lifecycle" + "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" + "k8s.io/kubernetes/pkg/kubelet/status" + "k8s.io/kubernetes/pkg/scheduler/framework" +) + +// NewMockContainerManager creates a new instance of MockContainerManager. 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 NewMockContainerManager(t interface { + mock.TestingT + Cleanup(func()) +}) *MockContainerManager { + mock := &MockContainerManager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockContainerManager is an autogenerated mock type for the ContainerManager type +type MockContainerManager struct { + mock.Mock +} + +type MockContainerManager_Expecter struct { + mock *mock.Mock +} + +func (_m *MockContainerManager) EXPECT() *MockContainerManager_Expecter { + return &MockContainerManager_Expecter{mock: &_m.Mock} +} + +// ContainerHasExclusiveCPUs provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) ContainerHasExclusiveCPUs(pod *v1.Pod, container *v1.Container) bool { + ret := _mock.Called(pod, container) + + if len(ret) == 0 { + panic("no return value specified for ContainerHasExclusiveCPUs") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(*v1.Pod, *v1.Container) bool); ok { + r0 = returnFunc(pod, container) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// MockContainerManager_ContainerHasExclusiveCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerHasExclusiveCPUs' +type MockContainerManager_ContainerHasExclusiveCPUs_Call struct { + *mock.Call +} + +// ContainerHasExclusiveCPUs is a helper method to define mock.On call +// - pod *v1.Pod +// - container *v1.Container +func (_e *MockContainerManager_Expecter) ContainerHasExclusiveCPUs(pod interface{}, container interface{}) *MockContainerManager_ContainerHasExclusiveCPUs_Call { + return &MockContainerManager_ContainerHasExclusiveCPUs_Call{Call: _e.mock.On("ContainerHasExclusiveCPUs", pod, container)} +} + +func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) Run(run func(pod *v1.Pod, container *v1.Container)) *MockContainerManager_ContainerHasExclusiveCPUs_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + var arg1 *v1.Container + if args[1] != nil { + arg1 = args[1].(*v1.Container) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) Return(b bool) *MockContainerManager_ContainerHasExclusiveCPUs_Call { + _c.Call.Return(b) + return _c +} + +func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) RunAndReturn(run func(pod *v1.Pod, container *v1.Container) bool) *MockContainerManager_ContainerHasExclusiveCPUs_Call { + _c.Call.Return(run) + return _c +} + +// GetAllocatableCPUs provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) 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 +} + +// MockContainerManager_GetAllocatableCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableCPUs' +type MockContainerManager_GetAllocatableCPUs_Call struct { + *mock.Call +} + +// GetAllocatableCPUs is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetAllocatableCPUs() *MockContainerManager_GetAllocatableCPUs_Call { + return &MockContainerManager_GetAllocatableCPUs_Call{Call: _e.mock.On("GetAllocatableCPUs")} +} + +func (_c *MockContainerManager_GetAllocatableCPUs_Call) Run(run func()) *MockContainerManager_GetAllocatableCPUs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetAllocatableCPUs_Call) Return(int64s []int64) *MockContainerManager_GetAllocatableCPUs_Call { + _c.Call.Return(int64s) + return _c +} + +func (_c *MockContainerManager_GetAllocatableCPUs_Call) RunAndReturn(run func() []int64) *MockContainerManager_GetAllocatableCPUs_Call { + _c.Call.Return(run) + return _c +} + +// GetAllocatableDevices provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetAllocatableDevices() []*v10.ContainerDevices { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAllocatableDevices") + } + + var r0 []*v10.ContainerDevices + if returnFunc, ok := ret.Get(0).(func() []*v10.ContainerDevices); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v10.ContainerDevices) + } + } + return r0 +} + +// MockContainerManager_GetAllocatableDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableDevices' +type MockContainerManager_GetAllocatableDevices_Call struct { + *mock.Call +} + +// GetAllocatableDevices is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetAllocatableDevices() *MockContainerManager_GetAllocatableDevices_Call { + return &MockContainerManager_GetAllocatableDevices_Call{Call: _e.mock.On("GetAllocatableDevices")} +} + +func (_c *MockContainerManager_GetAllocatableDevices_Call) Run(run func()) *MockContainerManager_GetAllocatableDevices_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetAllocatableDevices_Call) Return(containerDevicess []*v10.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call { + _c.Call.Return(containerDevicess) + return _c +} + +func (_c *MockContainerManager_GetAllocatableDevices_Call) RunAndReturn(run func() []*v10.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call { + _c.Call.Return(run) + return _c +} + +// GetAllocatableMemory provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetAllocatableMemory() []*v10.ContainerMemory { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAllocatableMemory") + } + + var r0 []*v10.ContainerMemory + if returnFunc, ok := ret.Get(0).(func() []*v10.ContainerMemory); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v10.ContainerMemory) + } + } + return r0 +} + +// MockContainerManager_GetAllocatableMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatableMemory' +type MockContainerManager_GetAllocatableMemory_Call struct { + *mock.Call +} + +// GetAllocatableMemory is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetAllocatableMemory() *MockContainerManager_GetAllocatableMemory_Call { + return &MockContainerManager_GetAllocatableMemory_Call{Call: _e.mock.On("GetAllocatableMemory")} +} + +func (_c *MockContainerManager_GetAllocatableMemory_Call) Run(run func()) *MockContainerManager_GetAllocatableMemory_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetAllocatableMemory_Call) Return(containerMemorys []*v10.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call { + _c.Call.Return(containerMemorys) + return _c +} + +func (_c *MockContainerManager_GetAllocatableMemory_Call) RunAndReturn(run func() []*v10.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call { + _c.Call.Return(run) + return _c +} + +// GetAllocateResourcesPodAdmitHandler provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetAllocateResourcesPodAdmitHandler() lifecycle.PodAdmitHandler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAllocateResourcesPodAdmitHandler") + } + + var r0 lifecycle.PodAdmitHandler + if returnFunc, ok := ret.Get(0).(func() lifecycle.PodAdmitHandler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(lifecycle.PodAdmitHandler) + } + } + return r0 +} + +// MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocateResourcesPodAdmitHandler' +type MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call struct { + *mock.Call +} + +// GetAllocateResourcesPodAdmitHandler is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetAllocateResourcesPodAdmitHandler() *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { + return &MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call{Call: _e.mock.On("GetAllocateResourcesPodAdmitHandler")} +} + +func (_c *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call) Run(run func()) *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call) Return(podAdmitHandler lifecycle.PodAdmitHandler) *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { + _c.Call.Return(podAdmitHandler) + return _c +} + +func (_c *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call) RunAndReturn(run func() lifecycle.PodAdmitHandler) *MockContainerManager_GetAllocateResourcesPodAdmitHandler_Call { + _c.Call.Return(run) + return _c +} + +// GetCPUs provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) 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 +} + +// MockContainerManager_GetCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCPUs' +type MockContainerManager_GetCPUs_Call struct { + *mock.Call +} + +// GetCPUs is a helper method to define mock.On call +// - podUID string +// - containerName string +func (_e *MockContainerManager_Expecter) GetCPUs(podUID interface{}, containerName interface{}) *MockContainerManager_GetCPUs_Call { + return &MockContainerManager_GetCPUs_Call{Call: _e.mock.On("GetCPUs", podUID, containerName)} +} + +func (_c *MockContainerManager_GetCPUs_Call) Run(run func(podUID string, containerName string)) *MockContainerManager_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 *MockContainerManager_GetCPUs_Call) Return(int64s []int64) *MockContainerManager_GetCPUs_Call { + _c.Call.Return(int64s) + return _c +} + +func (_c *MockContainerManager_GetCPUs_Call) RunAndReturn(run func(podUID string, containerName string) []int64) *MockContainerManager_GetCPUs_Call { + _c.Call.Return(run) + return _c +} + +// GetCapacity provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetCapacity(localStorageCapacityIsolation bool) v1.ResourceList { + ret := _mock.Called(localStorageCapacityIsolation) + + if len(ret) == 0 { + panic("no return value specified for GetCapacity") + } + + var r0 v1.ResourceList + if returnFunc, ok := ret.Get(0).(func(bool) v1.ResourceList); ok { + r0 = returnFunc(localStorageCapacityIsolation) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(v1.ResourceList) + } + } + return r0 +} + +// MockContainerManager_GetCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCapacity' +type MockContainerManager_GetCapacity_Call struct { + *mock.Call +} + +// GetCapacity is a helper method to define mock.On call +// - localStorageCapacityIsolation bool +func (_e *MockContainerManager_Expecter) GetCapacity(localStorageCapacityIsolation interface{}) *MockContainerManager_GetCapacity_Call { + return &MockContainerManager_GetCapacity_Call{Call: _e.mock.On("GetCapacity", localStorageCapacityIsolation)} +} + +func (_c *MockContainerManager_GetCapacity_Call) Run(run func(localStorageCapacityIsolation bool)) *MockContainerManager_GetCapacity_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 bool + if args[0] != nil { + arg0 = args[0].(bool) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockContainerManager_GetCapacity_Call) Return(resourceList v1.ResourceList) *MockContainerManager_GetCapacity_Call { + _c.Call.Return(resourceList) + return _c +} + +func (_c *MockContainerManager_GetCapacity_Call) RunAndReturn(run func(localStorageCapacityIsolation bool) v1.ResourceList) *MockContainerManager_GetCapacity_Call { + _c.Call.Return(run) + return _c +} + +// GetDevicePluginResourceCapacity provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetDevicePluginResourceCapacity() (v1.ResourceList, v1.ResourceList, []string) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDevicePluginResourceCapacity") + } + + var r0 v1.ResourceList + var r1 v1.ResourceList + var r2 []string + if returnFunc, ok := ret.Get(0).(func() (v1.ResourceList, v1.ResourceList, []string)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() v1.ResourceList); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(v1.ResourceList) + } + } + if returnFunc, ok := ret.Get(1).(func() v1.ResourceList); ok { + r1 = returnFunc() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(v1.ResourceList) + } + } + 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 +} + +// MockContainerManager_GetDevicePluginResourceCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDevicePluginResourceCapacity' +type MockContainerManager_GetDevicePluginResourceCapacity_Call struct { + *mock.Call +} + +// GetDevicePluginResourceCapacity is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetDevicePluginResourceCapacity() *MockContainerManager_GetDevicePluginResourceCapacity_Call { + return &MockContainerManager_GetDevicePluginResourceCapacity_Call{Call: _e.mock.On("GetDevicePluginResourceCapacity")} +} + +func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) Run(run func()) *MockContainerManager_GetDevicePluginResourceCapacity_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) Return(resourceList v1.ResourceList, resourceList1 v1.ResourceList, strings []string) *MockContainerManager_GetDevicePluginResourceCapacity_Call { + _c.Call.Return(resourceList, resourceList1, strings) + return _c +} + +func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) RunAndReturn(run func() (v1.ResourceList, v1.ResourceList, []string)) *MockContainerManager_GetDevicePluginResourceCapacity_Call { + _c.Call.Return(run) + return _c +} + +// GetDevices provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetDevices(podUID string, containerName string) []*v10.ContainerDevices { + ret := _mock.Called(podUID, containerName) + + if len(ret) == 0 { + panic("no return value specified for GetDevices") + } + + var r0 []*v10.ContainerDevices + if returnFunc, ok := ret.Get(0).(func(string, string) []*v10.ContainerDevices); ok { + r0 = returnFunc(podUID, containerName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v10.ContainerDevices) + } + } + return r0 +} + +// MockContainerManager_GetDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDevices' +type MockContainerManager_GetDevices_Call struct { + *mock.Call +} + +// GetDevices is a helper method to define mock.On call +// - podUID string +// - containerName string +func (_e *MockContainerManager_Expecter) GetDevices(podUID interface{}, containerName interface{}) *MockContainerManager_GetDevices_Call { + return &MockContainerManager_GetDevices_Call{Call: _e.mock.On("GetDevices", podUID, containerName)} +} + +func (_c *MockContainerManager_GetDevices_Call) Run(run func(podUID string, containerName string)) *MockContainerManager_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 *MockContainerManager_GetDevices_Call) Return(containerDevicess []*v10.ContainerDevices) *MockContainerManager_GetDevices_Call { + _c.Call.Return(containerDevicess) + return _c +} + +func (_c *MockContainerManager_GetDevices_Call) RunAndReturn(run func(podUID string, containerName string) []*v10.ContainerDevices) *MockContainerManager_GetDevices_Call { + _c.Call.Return(run) + return _c +} + +// GetDynamicResources provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetDynamicResources(pod *v1.Pod, container *v1.Container) []*v10.DynamicResource { + ret := _mock.Called(pod, container) + + if len(ret) == 0 { + panic("no return value specified for GetDynamicResources") + } + + var r0 []*v10.DynamicResource + if returnFunc, ok := ret.Get(0).(func(*v1.Pod, *v1.Container) []*v10.DynamicResource); ok { + r0 = returnFunc(pod, container) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v10.DynamicResource) + } + } + return r0 +} + +// MockContainerManager_GetDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicResources' +type MockContainerManager_GetDynamicResources_Call struct { + *mock.Call +} + +// GetDynamicResources is a helper method to define mock.On call +// - pod *v1.Pod +// - container *v1.Container +func (_e *MockContainerManager_Expecter) GetDynamicResources(pod interface{}, container interface{}) *MockContainerManager_GetDynamicResources_Call { + return &MockContainerManager_GetDynamicResources_Call{Call: _e.mock.On("GetDynamicResources", pod, container)} +} + +func (_c *MockContainerManager_GetDynamicResources_Call) Run(run func(pod *v1.Pod, container *v1.Container)) *MockContainerManager_GetDynamicResources_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + var arg1 *v1.Container + if args[1] != nil { + arg1 = args[1].(*v1.Container) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockContainerManager_GetDynamicResources_Call) Return(dynamicResources []*v10.DynamicResource) *MockContainerManager_GetDynamicResources_Call { + _c.Call.Return(dynamicResources) + return _c +} + +func (_c *MockContainerManager_GetDynamicResources_Call) RunAndReturn(run func(pod *v1.Pod, container *v1.Container) []*v10.DynamicResource) *MockContainerManager_GetDynamicResources_Call { + _c.Call.Return(run) + return _c +} + +// GetHealthCheckers provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetHealthCheckers() []healthz.HealthChecker { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetHealthCheckers") + } + + var r0 []healthz.HealthChecker + if returnFunc, ok := ret.Get(0).(func() []healthz.HealthChecker); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]healthz.HealthChecker) + } + } + return r0 +} + +// MockContainerManager_GetHealthCheckers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHealthCheckers' +type MockContainerManager_GetHealthCheckers_Call struct { + *mock.Call +} + +// GetHealthCheckers is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetHealthCheckers() *MockContainerManager_GetHealthCheckers_Call { + return &MockContainerManager_GetHealthCheckers_Call{Call: _e.mock.On("GetHealthCheckers")} +} + +func (_c *MockContainerManager_GetHealthCheckers_Call) Run(run func()) *MockContainerManager_GetHealthCheckers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetHealthCheckers_Call) Return(healthCheckers []healthz.HealthChecker) *MockContainerManager_GetHealthCheckers_Call { + _c.Call.Return(healthCheckers) + return _c +} + +func (_c *MockContainerManager_GetHealthCheckers_Call) RunAndReturn(run func() []healthz.HealthChecker) *MockContainerManager_GetHealthCheckers_Call { + _c.Call.Return(run) + return _c +} + +// GetMemory provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetMemory(podUID string, containerName string) []*v10.ContainerMemory { + ret := _mock.Called(podUID, containerName) + + if len(ret) == 0 { + panic("no return value specified for GetMemory") + } + + var r0 []*v10.ContainerMemory + if returnFunc, ok := ret.Get(0).(func(string, string) []*v10.ContainerMemory); ok { + r0 = returnFunc(podUID, containerName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v10.ContainerMemory) + } + } + return r0 +} + +// MockContainerManager_GetMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMemory' +type MockContainerManager_GetMemory_Call struct { + *mock.Call +} + +// GetMemory is a helper method to define mock.On call +// - podUID string +// - containerName string +func (_e *MockContainerManager_Expecter) GetMemory(podUID interface{}, containerName interface{}) *MockContainerManager_GetMemory_Call { + return &MockContainerManager_GetMemory_Call{Call: _e.mock.On("GetMemory", podUID, containerName)} +} + +func (_c *MockContainerManager_GetMemory_Call) Run(run func(podUID string, containerName string)) *MockContainerManager_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 *MockContainerManager_GetMemory_Call) Return(containerMemorys []*v10.ContainerMemory) *MockContainerManager_GetMemory_Call { + _c.Call.Return(containerMemorys) + return _c +} + +func (_c *MockContainerManager_GetMemory_Call) RunAndReturn(run func(podUID string, containerName string) []*v10.ContainerMemory) *MockContainerManager_GetMemory_Call { + _c.Call.Return(run) + return _c +} + +// GetMountedSubsystems provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetMountedSubsystems() *cm.CgroupSubsystems { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetMountedSubsystems") + } + + var r0 *cm.CgroupSubsystems + if returnFunc, ok := ret.Get(0).(func() *cm.CgroupSubsystems); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cm.CgroupSubsystems) + } + } + return r0 +} + +// MockContainerManager_GetMountedSubsystems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMountedSubsystems' +type MockContainerManager_GetMountedSubsystems_Call struct { + *mock.Call +} + +// GetMountedSubsystems is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetMountedSubsystems() *MockContainerManager_GetMountedSubsystems_Call { + return &MockContainerManager_GetMountedSubsystems_Call{Call: _e.mock.On("GetMountedSubsystems")} +} + +func (_c *MockContainerManager_GetMountedSubsystems_Call) Run(run func()) *MockContainerManager_GetMountedSubsystems_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetMountedSubsystems_Call) Return(cgroupSubsystems *cm.CgroupSubsystems) *MockContainerManager_GetMountedSubsystems_Call { + _c.Call.Return(cgroupSubsystems) + return _c +} + +func (_c *MockContainerManager_GetMountedSubsystems_Call) RunAndReturn(run func() *cm.CgroupSubsystems) *MockContainerManager_GetMountedSubsystems_Call { + _c.Call.Return(run) + return _c +} + +// GetNodeAllocatableAbsolute provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetNodeAllocatableAbsolute() v1.ResourceList { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNodeAllocatableAbsolute") + } + + var r0 v1.ResourceList + if returnFunc, ok := ret.Get(0).(func() v1.ResourceList); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(v1.ResourceList) + } + } + return r0 +} + +// MockContainerManager_GetNodeAllocatableAbsolute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeAllocatableAbsolute' +type MockContainerManager_GetNodeAllocatableAbsolute_Call struct { + *mock.Call +} + +// GetNodeAllocatableAbsolute is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetNodeAllocatableAbsolute() *MockContainerManager_GetNodeAllocatableAbsolute_Call { + return &MockContainerManager_GetNodeAllocatableAbsolute_Call{Call: _e.mock.On("GetNodeAllocatableAbsolute")} +} + +func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) Run(run func()) *MockContainerManager_GetNodeAllocatableAbsolute_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) Return(resourceList v1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call { + _c.Call.Return(resourceList) + return _c +} + +func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call { + _c.Call.Return(run) + return _c +} + +// GetNodeAllocatableReservation provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetNodeAllocatableReservation() v1.ResourceList { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNodeAllocatableReservation") + } + + var r0 v1.ResourceList + if returnFunc, ok := ret.Get(0).(func() v1.ResourceList); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(v1.ResourceList) + } + } + return r0 +} + +// MockContainerManager_GetNodeAllocatableReservation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeAllocatableReservation' +type MockContainerManager_GetNodeAllocatableReservation_Call struct { + *mock.Call +} + +// GetNodeAllocatableReservation is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetNodeAllocatableReservation() *MockContainerManager_GetNodeAllocatableReservation_Call { + return &MockContainerManager_GetNodeAllocatableReservation_Call{Call: _e.mock.On("GetNodeAllocatableReservation")} +} + +func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) Run(run func()) *MockContainerManager_GetNodeAllocatableReservation_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) Return(resourceList v1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call { + _c.Call.Return(resourceList) + return _c +} + +func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call { + _c.Call.Return(run) + return _c +} + +// GetNodeConfig provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetNodeConfig() cm.NodeConfig { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNodeConfig") + } + + var r0 cm.NodeConfig + if returnFunc, ok := ret.Get(0).(func() cm.NodeConfig); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(cm.NodeConfig) + } + return r0 +} + +// MockContainerManager_GetNodeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeConfig' +type MockContainerManager_GetNodeConfig_Call struct { + *mock.Call +} + +// GetNodeConfig is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetNodeConfig() *MockContainerManager_GetNodeConfig_Call { + return &MockContainerManager_GetNodeConfig_Call{Call: _e.mock.On("GetNodeConfig")} +} + +func (_c *MockContainerManager_GetNodeConfig_Call) Run(run func()) *MockContainerManager_GetNodeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetNodeConfig_Call) Return(nodeConfig cm.NodeConfig) *MockContainerManager_GetNodeConfig_Call { + _c.Call.Return(nodeConfig) + return _c +} + +func (_c *MockContainerManager_GetNodeConfig_Call) RunAndReturn(run func() cm.NodeConfig) *MockContainerManager_GetNodeConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetPluginRegistrationHandlers provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetPluginRegistrationHandlers() map[string]cache.PluginHandler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPluginRegistrationHandlers") + } + + var r0 map[string]cache.PluginHandler + if returnFunc, ok := ret.Get(0).(func() map[string]cache.PluginHandler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]cache.PluginHandler) + } + } + return r0 +} + +// MockContainerManager_GetPluginRegistrationHandlers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPluginRegistrationHandlers' +type MockContainerManager_GetPluginRegistrationHandlers_Call struct { + *mock.Call +} + +// GetPluginRegistrationHandlers is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetPluginRegistrationHandlers() *MockContainerManager_GetPluginRegistrationHandlers_Call { + return &MockContainerManager_GetPluginRegistrationHandlers_Call{Call: _e.mock.On("GetPluginRegistrationHandlers")} +} + +func (_c *MockContainerManager_GetPluginRegistrationHandlers_Call) Run(run func()) *MockContainerManager_GetPluginRegistrationHandlers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetPluginRegistrationHandlers_Call) Return(stringToPluginHandler map[string]cache.PluginHandler) *MockContainerManager_GetPluginRegistrationHandlers_Call { + _c.Call.Return(stringToPluginHandler) + return _c +} + +func (_c *MockContainerManager_GetPluginRegistrationHandlers_Call) RunAndReturn(run func() map[string]cache.PluginHandler) *MockContainerManager_GetPluginRegistrationHandlers_Call { + _c.Call.Return(run) + return _c +} + +// GetPodCgroupRoot provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetPodCgroupRoot() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPodCgroupRoot") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MockContainerManager_GetPodCgroupRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodCgroupRoot' +type MockContainerManager_GetPodCgroupRoot_Call struct { + *mock.Call +} + +// GetPodCgroupRoot is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetPodCgroupRoot() *MockContainerManager_GetPodCgroupRoot_Call { + return &MockContainerManager_GetPodCgroupRoot_Call{Call: _e.mock.On("GetPodCgroupRoot")} +} + +func (_c *MockContainerManager_GetPodCgroupRoot_Call) Run(run func()) *MockContainerManager_GetPodCgroupRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetPodCgroupRoot_Call) Return(s string) *MockContainerManager_GetPodCgroupRoot_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MockContainerManager_GetPodCgroupRoot_Call) RunAndReturn(run func() string) *MockContainerManager_GetPodCgroupRoot_Call { + _c.Call.Return(run) + return _c +} + +// GetQOSContainersInfo provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetQOSContainersInfo() cm.QOSContainersInfo { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetQOSContainersInfo") + } + + var r0 cm.QOSContainersInfo + if returnFunc, ok := ret.Get(0).(func() cm.QOSContainersInfo); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(cm.QOSContainersInfo) + } + return r0 +} + +// MockContainerManager_GetQOSContainersInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetQOSContainersInfo' +type MockContainerManager_GetQOSContainersInfo_Call struct { + *mock.Call +} + +// GetQOSContainersInfo is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) GetQOSContainersInfo() *MockContainerManager_GetQOSContainersInfo_Call { + return &MockContainerManager_GetQOSContainersInfo_Call{Call: _e.mock.On("GetQOSContainersInfo")} +} + +func (_c *MockContainerManager_GetQOSContainersInfo_Call) Run(run func()) *MockContainerManager_GetQOSContainersInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_GetQOSContainersInfo_Call) Return(qOSContainersInfo cm.QOSContainersInfo) *MockContainerManager_GetQOSContainersInfo_Call { + _c.Call.Return(qOSContainersInfo) + return _c +} + +func (_c *MockContainerManager_GetQOSContainersInfo_Call) RunAndReturn(run func() cm.QOSContainersInfo) *MockContainerManager_GetQOSContainersInfo_Call { + _c.Call.Return(run) + return _c +} + +// GetResources provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) GetResources(ctx context.Context, pod *v1.Pod, container1 *v1.Container) (*container.RunContainerOptions, error) { + ret := _mock.Called(ctx, pod, container1) + + if len(ret) == 0 { + panic("no return value specified for GetResources") + } + + var r0 *container.RunContainerOptions + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.Pod, *v1.Container) (*container.RunContainerOptions, error)); ok { + return returnFunc(ctx, pod, container1) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.Pod, *v1.Container) *container.RunContainerOptions); ok { + r0 = returnFunc(ctx, pod, container1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*container.RunContainerOptions) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *v1.Pod, *v1.Container) error); ok { + r1 = returnFunc(ctx, pod, container1) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockContainerManager_GetResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResources' +type MockContainerManager_GetResources_Call struct { + *mock.Call +} + +// GetResources is a helper method to define mock.On call +// - ctx context.Context +// - pod *v1.Pod +// - container1 *v1.Container +func (_e *MockContainerManager_Expecter) GetResources(ctx interface{}, pod interface{}, container1 interface{}) *MockContainerManager_GetResources_Call { + return &MockContainerManager_GetResources_Call{Call: _e.mock.On("GetResources", ctx, pod, container1)} +} + +func (_c *MockContainerManager_GetResources_Call) Run(run func(ctx context.Context, pod *v1.Pod, container1 *v1.Container)) *MockContainerManager_GetResources_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v1.Pod + if args[1] != nil { + arg1 = args[1].(*v1.Pod) + } + var arg2 *v1.Container + if args[2] != nil { + arg2 = args[2].(*v1.Container) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockContainerManager_GetResources_Call) Return(runContainerOptions *container.RunContainerOptions, err error) *MockContainerManager_GetResources_Call { + _c.Call.Return(runContainerOptions, err) + return _c +} + +func (_c *MockContainerManager_GetResources_Call) RunAndReturn(run func(ctx context.Context, pod *v1.Pod, container1 *v1.Container) (*container.RunContainerOptions, error)) *MockContainerManager_GetResources_Call { + _c.Call.Return(run) + return _c +} + +// InternalContainerLifecycle provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) InternalContainerLifecycle() cm.InternalContainerLifecycle { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for InternalContainerLifecycle") + } + + var r0 cm.InternalContainerLifecycle + if returnFunc, ok := ret.Get(0).(func() cm.InternalContainerLifecycle); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(cm.InternalContainerLifecycle) + } + } + return r0 +} + +// MockContainerManager_InternalContainerLifecycle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InternalContainerLifecycle' +type MockContainerManager_InternalContainerLifecycle_Call struct { + *mock.Call +} + +// InternalContainerLifecycle is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) InternalContainerLifecycle() *MockContainerManager_InternalContainerLifecycle_Call { + return &MockContainerManager_InternalContainerLifecycle_Call{Call: _e.mock.On("InternalContainerLifecycle")} +} + +func (_c *MockContainerManager_InternalContainerLifecycle_Call) Run(run func()) *MockContainerManager_InternalContainerLifecycle_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_InternalContainerLifecycle_Call) Return(internalContainerLifecycle cm.InternalContainerLifecycle) *MockContainerManager_InternalContainerLifecycle_Call { + _c.Call.Return(internalContainerLifecycle) + return _c +} + +func (_c *MockContainerManager_InternalContainerLifecycle_Call) RunAndReturn(run func() cm.InternalContainerLifecycle) *MockContainerManager_InternalContainerLifecycle_Call { + _c.Call.Return(run) + return _c +} + +// NewPodContainerManager provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) NewPodContainerManager() cm.PodContainerManager { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for NewPodContainerManager") + } + + var r0 cm.PodContainerManager + if returnFunc, ok := ret.Get(0).(func() cm.PodContainerManager); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(cm.PodContainerManager) + } + } + return r0 +} + +// MockContainerManager_NewPodContainerManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewPodContainerManager' +type MockContainerManager_NewPodContainerManager_Call struct { + *mock.Call +} + +// NewPodContainerManager is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) NewPodContainerManager() *MockContainerManager_NewPodContainerManager_Call { + return &MockContainerManager_NewPodContainerManager_Call{Call: _e.mock.On("NewPodContainerManager")} +} + +func (_c *MockContainerManager_NewPodContainerManager_Call) Run(run func()) *MockContainerManager_NewPodContainerManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_NewPodContainerManager_Call) Return(podContainerManager cm.PodContainerManager) *MockContainerManager_NewPodContainerManager_Call { + _c.Call.Return(podContainerManager) + return _c +} + +func (_c *MockContainerManager_NewPodContainerManager_Call) RunAndReturn(run func() cm.PodContainerManager) *MockContainerManager_NewPodContainerManager_Call { + _c.Call.Return(run) + return _c +} + +// PodHasExclusiveCPUs provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) PodHasExclusiveCPUs(pod *v1.Pod) bool { + ret := _mock.Called(pod) + + if len(ret) == 0 { + panic("no return value specified for PodHasExclusiveCPUs") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(*v1.Pod) bool); ok { + r0 = returnFunc(pod) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// MockContainerManager_PodHasExclusiveCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PodHasExclusiveCPUs' +type MockContainerManager_PodHasExclusiveCPUs_Call struct { + *mock.Call +} + +// PodHasExclusiveCPUs is a helper method to define mock.On call +// - pod *v1.Pod +func (_e *MockContainerManager_Expecter) PodHasExclusiveCPUs(pod interface{}) *MockContainerManager_PodHasExclusiveCPUs_Call { + return &MockContainerManager_PodHasExclusiveCPUs_Call{Call: _e.mock.On("PodHasExclusiveCPUs", pod)} +} + +func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) Run(run func(pod *v1.Pod)) *MockContainerManager_PodHasExclusiveCPUs_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) Return(b bool) *MockContainerManager_PodHasExclusiveCPUs_Call { + _c.Call.Return(b) + return _c +} + +func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) RunAndReturn(run func(pod *v1.Pod) bool) *MockContainerManager_PodHasExclusiveCPUs_Call { + _c.Call.Return(run) + return _c +} + +// PodMightNeedToUnprepareResources provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) PodMightNeedToUnprepareResources(UID types.UID) bool { + ret := _mock.Called(UID) + + if len(ret) == 0 { + panic("no return value specified for PodMightNeedToUnprepareResources") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(types.UID) bool); ok { + r0 = returnFunc(UID) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// MockContainerManager_PodMightNeedToUnprepareResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PodMightNeedToUnprepareResources' +type MockContainerManager_PodMightNeedToUnprepareResources_Call struct { + *mock.Call +} + +// PodMightNeedToUnprepareResources is a helper method to define mock.On call +// - UID types.UID +func (_e *MockContainerManager_Expecter) PodMightNeedToUnprepareResources(UID interface{}) *MockContainerManager_PodMightNeedToUnprepareResources_Call { + return &MockContainerManager_PodMightNeedToUnprepareResources_Call{Call: _e.mock.On("PodMightNeedToUnprepareResources", UID)} +} + +func (_c *MockContainerManager_PodMightNeedToUnprepareResources_Call) Run(run func(UID types.UID)) *MockContainerManager_PodMightNeedToUnprepareResources_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 types.UID + if args[0] != nil { + arg0 = args[0].(types.UID) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockContainerManager_PodMightNeedToUnprepareResources_Call) Return(b bool) *MockContainerManager_PodMightNeedToUnprepareResources_Call { + _c.Call.Return(b) + return _c +} + +func (_c *MockContainerManager_PodMightNeedToUnprepareResources_Call) RunAndReturn(run func(UID types.UID) bool) *MockContainerManager_PodMightNeedToUnprepareResources_Call { + _c.Call.Return(run) + return _c +} + +// PrepareDynamicResources provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) PrepareDynamicResources(context1 context.Context, pod *v1.Pod) error { + ret := _mock.Called(context1, pod) + + if len(ret) == 0 { + panic("no return value specified for PrepareDynamicResources") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.Pod) error); ok { + r0 = returnFunc(context1, pod) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockContainerManager_PrepareDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareDynamicResources' +type MockContainerManager_PrepareDynamicResources_Call struct { + *mock.Call +} + +// PrepareDynamicResources is a helper method to define mock.On call +// - context1 context.Context +// - pod *v1.Pod +func (_e *MockContainerManager_Expecter) PrepareDynamicResources(context1 interface{}, pod interface{}) *MockContainerManager_PrepareDynamicResources_Call { + return &MockContainerManager_PrepareDynamicResources_Call{Call: _e.mock.On("PrepareDynamicResources", context1, pod)} +} + +func (_c *MockContainerManager_PrepareDynamicResources_Call) Run(run func(context1 context.Context, pod *v1.Pod)) *MockContainerManager_PrepareDynamicResources_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v1.Pod + if args[1] != nil { + arg1 = args[1].(*v1.Pod) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockContainerManager_PrepareDynamicResources_Call) Return(err error) *MockContainerManager_PrepareDynamicResources_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockContainerManager_PrepareDynamicResources_Call) RunAndReturn(run func(context1 context.Context, pod *v1.Pod) error) *MockContainerManager_PrepareDynamicResources_Call { + _c.Call.Return(run) + return _c +} + +// ShouldResetExtendedResourceCapacity provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) ShouldResetExtendedResourceCapacity() bool { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ShouldResetExtendedResourceCapacity") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// MockContainerManager_ShouldResetExtendedResourceCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShouldResetExtendedResourceCapacity' +type MockContainerManager_ShouldResetExtendedResourceCapacity_Call struct { + *mock.Call +} + +// ShouldResetExtendedResourceCapacity is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) ShouldResetExtendedResourceCapacity() *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { + return &MockContainerManager_ShouldResetExtendedResourceCapacity_Call{Call: _e.mock.On("ShouldResetExtendedResourceCapacity")} +} + +func (_c *MockContainerManager_ShouldResetExtendedResourceCapacity_Call) Run(run func()) *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_ShouldResetExtendedResourceCapacity_Call) Return(b bool) *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { + _c.Call.Return(b) + return _c +} + +func (_c *MockContainerManager_ShouldResetExtendedResourceCapacity_Call) RunAndReturn(run func() bool) *MockContainerManager_ShouldResetExtendedResourceCapacity_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) Start(context1 context.Context, node *v1.Node, activePodsFunc cm.ActivePodsFunc, getNodeFunc cm.GetNodeFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, runtimeService cri.RuntimeService, b bool) error { + ret := _mock.Called(context1, node, activePodsFunc, getNodeFunc, sourcesReady, podStatusProvider, runtimeService, b) + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.Node, cm.ActivePodsFunc, cm.GetNodeFunc, config.SourcesReady, status.PodStatusProvider, cri.RuntimeService, bool) error); ok { + r0 = returnFunc(context1, node, activePodsFunc, getNodeFunc, sourcesReady, podStatusProvider, runtimeService, b) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockContainerManager_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type MockContainerManager_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - context1 context.Context +// - node *v1.Node +// - activePodsFunc cm.ActivePodsFunc +// - getNodeFunc cm.GetNodeFunc +// - sourcesReady config.SourcesReady +// - podStatusProvider status.PodStatusProvider +// - runtimeService cri.RuntimeService +// - b bool +func (_e *MockContainerManager_Expecter) Start(context1 interface{}, node interface{}, activePodsFunc interface{}, getNodeFunc interface{}, sourcesReady interface{}, podStatusProvider interface{}, runtimeService interface{}, b interface{}) *MockContainerManager_Start_Call { + return &MockContainerManager_Start_Call{Call: _e.mock.On("Start", context1, node, activePodsFunc, getNodeFunc, sourcesReady, podStatusProvider, runtimeService, b)} +} + +func (_c *MockContainerManager_Start_Call) Run(run func(context1 context.Context, node *v1.Node, activePodsFunc cm.ActivePodsFunc, getNodeFunc cm.GetNodeFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, runtimeService cri.RuntimeService, b bool)) *MockContainerManager_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v1.Node + if args[1] != nil { + arg1 = args[1].(*v1.Node) + } + var arg2 cm.ActivePodsFunc + if args[2] != nil { + arg2 = args[2].(cm.ActivePodsFunc) + } + var arg3 cm.GetNodeFunc + if args[3] != nil { + arg3 = args[3].(cm.GetNodeFunc) + } + var arg4 config.SourcesReady + if args[4] != nil { + arg4 = args[4].(config.SourcesReady) + } + var arg5 status.PodStatusProvider + if args[5] != nil { + arg5 = args[5].(status.PodStatusProvider) + } + var arg6 cri.RuntimeService + if args[6] != nil { + arg6 = args[6].(cri.RuntimeService) + } + var arg7 bool + if args[7] != nil { + arg7 = args[7].(bool) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + ) + }) + return _c +} + +func (_c *MockContainerManager_Start_Call) Return(err error) *MockContainerManager_Start_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockContainerManager_Start_Call) RunAndReturn(run func(context1 context.Context, node *v1.Node, activePodsFunc cm.ActivePodsFunc, getNodeFunc cm.GetNodeFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, runtimeService cri.RuntimeService, b bool) error) *MockContainerManager_Start_Call { + _c.Call.Return(run) + return _c +} + +// Status provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) Status() cm.Status { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Status") + } + + var r0 cm.Status + if returnFunc, ok := ret.Get(0).(func() cm.Status); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(cm.Status) + } + return r0 +} + +// MockContainerManager_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type MockContainerManager_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) Status() *MockContainerManager_Status_Call { + return &MockContainerManager_Status_Call{Call: _e.mock.On("Status")} +} + +func (_c *MockContainerManager_Status_Call) Run(run func()) *MockContainerManager_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_Status_Call) Return(status1 cm.Status) *MockContainerManager_Status_Call { + _c.Call.Return(status1) + return _c +} + +func (_c *MockContainerManager_Status_Call) RunAndReturn(run func() cm.Status) *MockContainerManager_Status_Call { + _c.Call.Return(run) + return _c +} + +// SystemCgroupsLimit provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) SystemCgroupsLimit() v1.ResourceList { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SystemCgroupsLimit") + } + + var r0 v1.ResourceList + if returnFunc, ok := ret.Get(0).(func() v1.ResourceList); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(v1.ResourceList) + } + } + return r0 +} + +// MockContainerManager_SystemCgroupsLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SystemCgroupsLimit' +type MockContainerManager_SystemCgroupsLimit_Call struct { + *mock.Call +} + +// SystemCgroupsLimit is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) SystemCgroupsLimit() *MockContainerManager_SystemCgroupsLimit_Call { + return &MockContainerManager_SystemCgroupsLimit_Call{Call: _e.mock.On("SystemCgroupsLimit")} +} + +func (_c *MockContainerManager_SystemCgroupsLimit_Call) Run(run func()) *MockContainerManager_SystemCgroupsLimit_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_SystemCgroupsLimit_Call) Return(resourceList v1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call { + _c.Call.Return(resourceList) + return _c +} + +func (_c *MockContainerManager_SystemCgroupsLimit_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call { + _c.Call.Return(run) + return _c +} + +// UnprepareDynamicResources provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) UnprepareDynamicResources(context1 context.Context, pod *v1.Pod) error { + ret := _mock.Called(context1, pod) + + if len(ret) == 0 { + panic("no return value specified for UnprepareDynamicResources") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.Pod) error); ok { + r0 = returnFunc(context1, pod) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockContainerManager_UnprepareDynamicResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnprepareDynamicResources' +type MockContainerManager_UnprepareDynamicResources_Call struct { + *mock.Call +} + +// UnprepareDynamicResources is a helper method to define mock.On call +// - context1 context.Context +// - pod *v1.Pod +func (_e *MockContainerManager_Expecter) UnprepareDynamicResources(context1 interface{}, pod interface{}) *MockContainerManager_UnprepareDynamicResources_Call { + return &MockContainerManager_UnprepareDynamicResources_Call{Call: _e.mock.On("UnprepareDynamicResources", context1, pod)} +} + +func (_c *MockContainerManager_UnprepareDynamicResources_Call) Run(run func(context1 context.Context, pod *v1.Pod)) *MockContainerManager_UnprepareDynamicResources_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v1.Pod + if args[1] != nil { + arg1 = args[1].(*v1.Pod) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockContainerManager_UnprepareDynamicResources_Call) Return(err error) *MockContainerManager_UnprepareDynamicResources_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockContainerManager_UnprepareDynamicResources_Call) RunAndReturn(run func(context1 context.Context, pod *v1.Pod) error) *MockContainerManager_UnprepareDynamicResources_Call { + _c.Call.Return(run) + return _c +} + +// UpdateAllocatedDevices provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) UpdateAllocatedDevices() { + _mock.Called() + return +} + +// MockContainerManager_UpdateAllocatedDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllocatedDevices' +type MockContainerManager_UpdateAllocatedDevices_Call struct { + *mock.Call +} + +// UpdateAllocatedDevices is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) UpdateAllocatedDevices() *MockContainerManager_UpdateAllocatedDevices_Call { + return &MockContainerManager_UpdateAllocatedDevices_Call{Call: _e.mock.On("UpdateAllocatedDevices")} +} + +func (_c *MockContainerManager_UpdateAllocatedDevices_Call) Run(run func()) *MockContainerManager_UpdateAllocatedDevices_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_UpdateAllocatedDevices_Call) Return() *MockContainerManager_UpdateAllocatedDevices_Call { + _c.Call.Return() + return _c +} + +func (_c *MockContainerManager_UpdateAllocatedDevices_Call) RunAndReturn(run func()) *MockContainerManager_UpdateAllocatedDevices_Call { + _c.Run(run) + return _c +} + +// UpdateAllocatedResourcesStatus provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) UpdateAllocatedResourcesStatus(pod *v1.Pod, status1 *v1.PodStatus) { + _mock.Called(pod, status1) + return +} + +// MockContainerManager_UpdateAllocatedResourcesStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllocatedResourcesStatus' +type MockContainerManager_UpdateAllocatedResourcesStatus_Call struct { + *mock.Call +} + +// UpdateAllocatedResourcesStatus is a helper method to define mock.On call +// - pod *v1.Pod +// - status1 *v1.PodStatus +func (_e *MockContainerManager_Expecter) UpdateAllocatedResourcesStatus(pod interface{}, status1 interface{}) *MockContainerManager_UpdateAllocatedResourcesStatus_Call { + return &MockContainerManager_UpdateAllocatedResourcesStatus_Call{Call: _e.mock.On("UpdateAllocatedResourcesStatus", pod, status1)} +} + +func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) Run(run func(pod *v1.Pod, status1 *v1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + var arg1 *v1.PodStatus + if args[1] != nil { + arg1 = args[1].(*v1.PodStatus) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) Return() *MockContainerManager_UpdateAllocatedResourcesStatus_Call { + _c.Call.Return() + return _c +} + +func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) RunAndReturn(run func(pod *v1.Pod, status1 *v1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call { + _c.Run(run) + return _c +} + +// UpdatePluginResources provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) UpdatePluginResources(nodeInfo *framework.NodeInfo, podAdmitAttributes *lifecycle.PodAdmitAttributes) error { + ret := _mock.Called(nodeInfo, podAdmitAttributes) + + if len(ret) == 0 { + panic("no return value specified for UpdatePluginResources") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*framework.NodeInfo, *lifecycle.PodAdmitAttributes) error); ok { + r0 = returnFunc(nodeInfo, podAdmitAttributes) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockContainerManager_UpdatePluginResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePluginResources' +type MockContainerManager_UpdatePluginResources_Call struct { + *mock.Call +} + +// UpdatePluginResources is a helper method to define mock.On call +// - nodeInfo *framework.NodeInfo +// - podAdmitAttributes *lifecycle.PodAdmitAttributes +func (_e *MockContainerManager_Expecter) UpdatePluginResources(nodeInfo interface{}, podAdmitAttributes interface{}) *MockContainerManager_UpdatePluginResources_Call { + return &MockContainerManager_UpdatePluginResources_Call{Call: _e.mock.On("UpdatePluginResources", nodeInfo, podAdmitAttributes)} +} + +func (_c *MockContainerManager_UpdatePluginResources_Call) Run(run func(nodeInfo *framework.NodeInfo, podAdmitAttributes *lifecycle.PodAdmitAttributes)) *MockContainerManager_UpdatePluginResources_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *framework.NodeInfo + if args[0] != nil { + arg0 = args[0].(*framework.NodeInfo) + } + var arg1 *lifecycle.PodAdmitAttributes + if args[1] != nil { + arg1 = args[1].(*lifecycle.PodAdmitAttributes) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockContainerManager_UpdatePluginResources_Call) Return(err error) *MockContainerManager_UpdatePluginResources_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockContainerManager_UpdatePluginResources_Call) RunAndReturn(run func(nodeInfo *framework.NodeInfo, podAdmitAttributes *lifecycle.PodAdmitAttributes) error) *MockContainerManager_UpdatePluginResources_Call { + _c.Call.Return(run) + return _c +} + +// UpdateQOSCgroups provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) UpdateQOSCgroups() error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for UpdateQOSCgroups") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockContainerManager_UpdateQOSCgroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateQOSCgroups' +type MockContainerManager_UpdateQOSCgroups_Call struct { + *mock.Call +} + +// UpdateQOSCgroups is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) UpdateQOSCgroups() *MockContainerManager_UpdateQOSCgroups_Call { + return &MockContainerManager_UpdateQOSCgroups_Call{Call: _e.mock.On("UpdateQOSCgroups")} +} + +func (_c *MockContainerManager_UpdateQOSCgroups_Call) Run(run func()) *MockContainerManager_UpdateQOSCgroups_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_UpdateQOSCgroups_Call) Return(err error) *MockContainerManager_UpdateQOSCgroups_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockContainerManager_UpdateQOSCgroups_Call) RunAndReturn(run func() error) *MockContainerManager_UpdateQOSCgroups_Call { + _c.Call.Return(run) + return _c +} + +// Updates provides a mock function for the type MockContainerManager +func (_mock *MockContainerManager) Updates() <-chan resourceupdates.Update { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Updates") + } + + var r0 <-chan resourceupdates.Update + if returnFunc, ok := ret.Get(0).(func() <-chan resourceupdates.Update); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan resourceupdates.Update) + } + } + return r0 +} + +// MockContainerManager_Updates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Updates' +type MockContainerManager_Updates_Call struct { + *mock.Call +} + +// Updates is a helper method to define mock.On call +func (_e *MockContainerManager_Expecter) Updates() *MockContainerManager_Updates_Call { + return &MockContainerManager_Updates_Call{Call: _e.mock.On("Updates")} +} + +func (_c *MockContainerManager_Updates_Call) Run(run func()) *MockContainerManager_Updates_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockContainerManager_Updates_Call) Return(updateCh <-chan resourceupdates.Update) *MockContainerManager_Updates_Call { + _c.Call.Return(updateCh) + return _c +} + +func (_c *MockContainerManager_Updates_Call) RunAndReturn(run func() <-chan resourceupdates.Update) *MockContainerManager_Updates_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 +} + +// 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 for the type MockPodContainerManager +func (_mock *MockPodContainerManager) Destroy(name cm.CgroupName) error { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for Destroy") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(cm.CgroupName) error); ok { + r0 = returnFunc(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) { + var arg0 cm.CgroupName + if args[0] != nil { + arg0 = args[0].(cm.CgroupName) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_Destroy_Call) Return(err error) *MockPodContainerManager_Destroy_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPodContainerManager_Destroy_Call) RunAndReturn(run func(name cm.CgroupName) error) *MockPodContainerManager_Destroy_Call { + _c.Call.Return(run) + return _c +} + +// EnsureExists provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) EnsureExists(pod *v1.Pod) error { + ret := _mock.Called(pod) + + if len(ret) == 0 { + panic("no return value specified for EnsureExists") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*v1.Pod) error); ok { + r0 = returnFunc(pod) + } 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 +// - pod *v1.Pod +func (_e *MockPodContainerManager_Expecter) EnsureExists(pod interface{}) *MockPodContainerManager_EnsureExists_Call { + return &MockPodContainerManager_EnsureExists_Call{Call: _e.mock.On("EnsureExists", pod)} +} + +func (_c *MockPodContainerManager_EnsureExists_Call) Run(run func(pod *v1.Pod)) *MockPodContainerManager_EnsureExists_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_EnsureExists_Call) Return(err error) *MockPodContainerManager_EnsureExists_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPodContainerManager_EnsureExists_Call) RunAndReturn(run func(pod *v1.Pod) error) *MockPodContainerManager_EnsureExists_Call { + _c.Call.Return(run) + return _c +} + +// Exists provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) Exists(pod *v1.Pod) bool { + ret := _mock.Called(pod) + + if len(ret) == 0 { + panic("no return value specified for Exists") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(*v1.Pod) bool); ok { + r0 = returnFunc(pod) + } 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 +// - pod *v1.Pod +func (_e *MockPodContainerManager_Expecter) Exists(pod interface{}) *MockPodContainerManager_Exists_Call { + return &MockPodContainerManager_Exists_Call{Call: _e.mock.On("Exists", pod)} +} + +func (_c *MockPodContainerManager_Exists_Call) Run(run func(pod *v1.Pod)) *MockPodContainerManager_Exists_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_Exists_Call) Return(b bool) *MockPodContainerManager_Exists_Call { + _c.Call.Return(b) + return _c +} + +func (_c *MockPodContainerManager_Exists_Call) RunAndReturn(run func(pod *v1.Pod) bool) *MockPodContainerManager_Exists_Call { + _c.Call.Return(run) + return _c +} + +// GetAllPodsFromCgroups provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) GetAllPodsFromCgroups() (map[types.UID]cm.CgroupName, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAllPodsFromCgroups") + } + + var r0 map[types.UID]cm.CgroupName + var r1 error + if returnFunc, ok := ret.Get(0).(func() (map[types.UID]cm.CgroupName, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() map[types.UID]cm.CgroupName); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[types.UID]cm.CgroupName) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } 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(uIDToCgroupName map[types.UID]cm.CgroupName, err error) *MockPodContainerManager_GetAllPodsFromCgroups_Call { + _c.Call.Return(uIDToCgroupName, err) + 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 for the type MockPodContainerManager +func (_mock *MockPodContainerManager) GetPodCgroupConfig(pod *v1.Pod, resource v1.ResourceName) (*cm.ResourceConfig, error) { + ret := _mock.Called(pod, resource) + + if len(ret) == 0 { + panic("no return value specified for GetPodCgroupConfig") + } + + var r0 *cm.ResourceConfig + var r1 error + if returnFunc, ok := ret.Get(0).(func(*v1.Pod, v1.ResourceName) (*cm.ResourceConfig, error)); ok { + return returnFunc(pod, resource) + } + if returnFunc, ok := ret.Get(0).(func(*v1.Pod, v1.ResourceName) *cm.ResourceConfig); ok { + r0 = returnFunc(pod, resource) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cm.ResourceConfig) + } + } + if returnFunc, ok := ret.Get(1).(func(*v1.Pod, v1.ResourceName) error); ok { + r1 = returnFunc(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) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + var arg1 v1.ResourceName + if args[1] != nil { + arg1 = args[1].(v1.ResourceName) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_GetPodCgroupConfig_Call) Return(resourceConfig *cm.ResourceConfig, err error) *MockPodContainerManager_GetPodCgroupConfig_Call { + _c.Call.Return(resourceConfig, err) + return _c +} + +func (_c *MockPodContainerManager_GetPodCgroupConfig_Call) RunAndReturn(run func(pod *v1.Pod, resource v1.ResourceName) (*cm.ResourceConfig, error)) *MockPodContainerManager_GetPodCgroupConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetPodCgroupMemoryUsage provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) GetPodCgroupMemoryUsage(pod *v1.Pod) (uint64, error) { + ret := _mock.Called(pod) + + if len(ret) == 0 { + panic("no return value specified for GetPodCgroupMemoryUsage") + } + + var r0 uint64 + var r1 error + if returnFunc, ok := ret.Get(0).(func(*v1.Pod) (uint64, error)); ok { + return returnFunc(pod) + } + if returnFunc, ok := ret.Get(0).(func(*v1.Pod) uint64); ok { + r0 = returnFunc(pod) + } else { + r0 = ret.Get(0).(uint64) + } + if returnFunc, ok := ret.Get(1).(func(*v1.Pod) error); ok { + r1 = returnFunc(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) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_GetPodCgroupMemoryUsage_Call) Return(v uint64, err error) *MockPodContainerManager_GetPodCgroupMemoryUsage_Call { + _c.Call.Return(v, err) + return _c +} + +func (_c *MockPodContainerManager_GetPodCgroupMemoryUsage_Call) RunAndReturn(run func(pod *v1.Pod) (uint64, error)) *MockPodContainerManager_GetPodCgroupMemoryUsage_Call { + _c.Call.Return(run) + return _c +} + +// GetPodContainerName provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) GetPodContainerName(pod *v1.Pod) (cm.CgroupName, string) { + ret := _mock.Called(pod) + + if len(ret) == 0 { + panic("no return value specified for GetPodContainerName") + } + + var r0 cm.CgroupName + var r1 string + if returnFunc, ok := ret.Get(0).(func(*v1.Pod) (cm.CgroupName, string)); ok { + return returnFunc(pod) + } + if returnFunc, ok := ret.Get(0).(func(*v1.Pod) cm.CgroupName); ok { + r0 = returnFunc(pod) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(cm.CgroupName) + } + } + if returnFunc, ok := ret.Get(1).(func(*v1.Pod) string); ok { + r1 = returnFunc(pod) + } 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 +// - pod *v1.Pod +func (_e *MockPodContainerManager_Expecter) GetPodContainerName(pod interface{}) *MockPodContainerManager_GetPodContainerName_Call { + return &MockPodContainerManager_GetPodContainerName_Call{Call: _e.mock.On("GetPodContainerName", pod)} +} + +func (_c *MockPodContainerManager_GetPodContainerName_Call) Run(run func(pod *v1.Pod)) *MockPodContainerManager_GetPodContainerName_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_GetPodContainerName_Call) Return(cgroupName cm.CgroupName, s string) *MockPodContainerManager_GetPodContainerName_Call { + _c.Call.Return(cgroupName, s) + return _c +} + +func (_c *MockPodContainerManager_GetPodContainerName_Call) RunAndReturn(run func(pod *v1.Pod) (cm.CgroupName, string)) *MockPodContainerManager_GetPodContainerName_Call { + _c.Call.Return(run) + return _c +} + +// IsPodCgroup provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) IsPodCgroup(cgroupfs string) (bool, types.UID) { + ret := _mock.Called(cgroupfs) + + if len(ret) == 0 { + panic("no return value specified for IsPodCgroup") + } + + var r0 bool + var r1 types.UID + if returnFunc, ok := ret.Get(0).(func(string) (bool, types.UID)); ok { + return returnFunc(cgroupfs) + } + if returnFunc, ok := ret.Get(0).(func(string) bool); ok { + r0 = returnFunc(cgroupfs) + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func(string) types.UID); ok { + r1 = returnFunc(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) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_IsPodCgroup_Call) Return(b bool, uID types.UID) *MockPodContainerManager_IsPodCgroup_Call { + _c.Call.Return(b, uID) + return _c +} + +func (_c *MockPodContainerManager_IsPodCgroup_Call) RunAndReturn(run func(cgroupfs string) (bool, types.UID)) *MockPodContainerManager_IsPodCgroup_Call { + _c.Call.Return(run) + return _c +} + +// ReduceCPULimits provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) ReduceCPULimits(name cm.CgroupName) error { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for ReduceCPULimits") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(cm.CgroupName) error); ok { + r0 = returnFunc(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) { + var arg0 cm.CgroupName + if args[0] != nil { + arg0 = args[0].(cm.CgroupName) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_ReduceCPULimits_Call) Return(err error) *MockPodContainerManager_ReduceCPULimits_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPodContainerManager_ReduceCPULimits_Call) RunAndReturn(run func(name cm.CgroupName) error) *MockPodContainerManager_ReduceCPULimits_Call { + _c.Call.Return(run) + return _c +} + +// SetPodCgroupConfig provides a mock function for the type MockPodContainerManager +func (_mock *MockPodContainerManager) SetPodCgroupConfig(pod *v1.Pod, resourceConfig *cm.ResourceConfig) error { + ret := _mock.Called(pod, resourceConfig) + + if len(ret) == 0 { + panic("no return value specified for SetPodCgroupConfig") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*v1.Pod, *cm.ResourceConfig) error); ok { + r0 = returnFunc(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) { + var arg0 *v1.Pod + if args[0] != nil { + arg0 = args[0].(*v1.Pod) + } + var arg1 *cm.ResourceConfig + if args[1] != nil { + arg1 = args[1].(*cm.ResourceConfig) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockPodContainerManager_SetPodCgroupConfig_Call) Return(err error) *MockPodContainerManager_SetPodCgroupConfig_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPodContainerManager_SetPodCgroupConfig_Call) RunAndReturn(run func(pod *v1.Pod, resourceConfig *cm.ResourceConfig) error) *MockPodContainerManager_SetPodCgroupConfig_Call { + _c.Call.Return(run) + return _c +} diff --git a/pkg/kubelet/container/.mockery.yaml b/pkg/kubelet/container/.mockery.yaml index 84489a0095f..b0209296dc4 100644 --- a/pkg/kubelet/container/.mockery.yaml +++ b/pkg/kubelet/container/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/container/testing/mock_runtime_cache.go b/pkg/kubelet/container/testing/mock_runtime_cache.go deleted file mode 100644 index fac6ffa3119..00000000000 --- a/pkg/kubelet/container/testing/mock_runtime_cache.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/container/testing/mockdirentry.go b/pkg/kubelet/container/testing/mockdirentry.go index 596f914614c..a467ae7880c 100644 --- a/pkg/kubelet/container/testing/mockdirentry.go +++ b/pkg/kubelet/container/testing/mockdirentry.go @@ -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 -} diff --git a/pkg/kubelet/container/testing/mocks.go b/pkg/kubelet/container/testing/mocks.go new file mode 100644 index 00000000000..bef999c660e --- /dev/null +++ b/pkg/kubelet/container/testing/mocks.go @@ -0,0 +1,1808 @@ +/* +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 ( + "context" + "io" + "time" + + mock "github.com/stretchr/testify/mock" + v10 "k8s.io/api/core/v1" + types0 "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/flowcontrol" + "k8s.io/cri-api/pkg/apis/runtime/v1" + "k8s.io/kubernetes/pkg/credentialprovider" + "k8s.io/kubernetes/pkg/kubelet/container" + "k8s.io/kubernetes/pkg/kubelet/types" +) + +// NewMockRuntime creates a new instance of MockRuntime. 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 NewMockRuntime(t interface { + mock.TestingT + Cleanup(func()) +}) *MockRuntime { + mock := &MockRuntime{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockRuntime is an autogenerated mock type for the Runtime type +type MockRuntime struct { + mock.Mock +} + +type MockRuntime_Expecter struct { + mock *mock.Mock +} + +func (_m *MockRuntime) EXPECT() *MockRuntime_Expecter { + return &MockRuntime_Expecter{mock: &_m.Mock} +} + +// APIVersion provides a mock function for the type MockRuntime +func (_mock *MockRuntime) APIVersion() (container.Version, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for APIVersion") + } + + var r0 container.Version + var r1 error + if returnFunc, ok := ret.Get(0).(func() (container.Version, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() container.Version); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(container.Version) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_APIVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'APIVersion' +type MockRuntime_APIVersion_Call struct { + *mock.Call +} + +// APIVersion is a helper method to define mock.On call +func (_e *MockRuntime_Expecter) APIVersion() *MockRuntime_APIVersion_Call { + return &MockRuntime_APIVersion_Call{Call: _e.mock.On("APIVersion")} +} + +func (_c *MockRuntime_APIVersion_Call) Run(run func()) *MockRuntime_APIVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockRuntime_APIVersion_Call) Return(version container.Version, err error) *MockRuntime_APIVersion_Call { + _c.Call.Return(version, err) + return _c +} + +func (_c *MockRuntime_APIVersion_Call) RunAndReturn(run func() (container.Version, error)) *MockRuntime_APIVersion_Call { + _c.Call.Return(run) + return _c +} + +// CheckpointContainer provides a mock function for the type MockRuntime +func (_mock *MockRuntime) CheckpointContainer(ctx context.Context, options *v1.CheckpointContainerRequest) error { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for CheckpointContainer") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.CheckpointContainerRequest) error); ok { + r0 = returnFunc(ctx, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockRuntime_CheckpointContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckpointContainer' +type MockRuntime_CheckpointContainer_Call struct { + *mock.Call +} + +// CheckpointContainer is a helper method to define mock.On call +// - ctx context.Context +// - options *v1.CheckpointContainerRequest +func (_e *MockRuntime_Expecter) CheckpointContainer(ctx interface{}, options interface{}) *MockRuntime_CheckpointContainer_Call { + return &MockRuntime_CheckpointContainer_Call{Call: _e.mock.On("CheckpointContainer", ctx, options)} +} + +func (_c *MockRuntime_CheckpointContainer_Call) Run(run func(ctx context.Context, options *v1.CheckpointContainerRequest)) *MockRuntime_CheckpointContainer_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v1.CheckpointContainerRequest + if args[1] != nil { + arg1 = args[1].(*v1.CheckpointContainerRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_CheckpointContainer_Call) Return(err error) *MockRuntime_CheckpointContainer_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntime_CheckpointContainer_Call) RunAndReturn(run func(ctx context.Context, options *v1.CheckpointContainerRequest) error) *MockRuntime_CheckpointContainer_Call { + _c.Call.Return(run) + return _c +} + +// DeleteContainer provides a mock function for the type MockRuntime +func (_mock *MockRuntime) DeleteContainer(ctx context.Context, containerID container.ContainerID) error { + ret := _mock.Called(ctx, containerID) + + if len(ret) == 0 { + panic("no return value specified for DeleteContainer") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ContainerID) error); ok { + r0 = returnFunc(ctx, containerID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockRuntime_DeleteContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteContainer' +type MockRuntime_DeleteContainer_Call struct { + *mock.Call +} + +// DeleteContainer is a helper method to define mock.On call +// - ctx context.Context +// - containerID container.ContainerID +func (_e *MockRuntime_Expecter) DeleteContainer(ctx interface{}, containerID interface{}) *MockRuntime_DeleteContainer_Call { + return &MockRuntime_DeleteContainer_Call{Call: _e.mock.On("DeleteContainer", ctx, containerID)} +} + +func (_c *MockRuntime_DeleteContainer_Call) Run(run func(ctx context.Context, containerID container.ContainerID)) *MockRuntime_DeleteContainer_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.ContainerID + if args[1] != nil { + arg1 = args[1].(container.ContainerID) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_DeleteContainer_Call) Return(err error) *MockRuntime_DeleteContainer_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntime_DeleteContainer_Call) RunAndReturn(run func(ctx context.Context, containerID container.ContainerID) error) *MockRuntime_DeleteContainer_Call { + _c.Call.Return(run) + return _c +} + +// GarbageCollect provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GarbageCollect(ctx context.Context, gcPolicy container.GCPolicy, allSourcesReady bool, evictNonDeletedPods bool) error { + ret := _mock.Called(ctx, gcPolicy, allSourcesReady, evictNonDeletedPods) + + if len(ret) == 0 { + panic("no return value specified for GarbageCollect") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.GCPolicy, bool, bool) error); ok { + r0 = returnFunc(ctx, gcPolicy, allSourcesReady, evictNonDeletedPods) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockRuntime_GarbageCollect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GarbageCollect' +type MockRuntime_GarbageCollect_Call struct { + *mock.Call +} + +// GarbageCollect is a helper method to define mock.On call +// - ctx context.Context +// - gcPolicy container.GCPolicy +// - allSourcesReady bool +// - evictNonDeletedPods bool +func (_e *MockRuntime_Expecter) GarbageCollect(ctx interface{}, gcPolicy interface{}, allSourcesReady interface{}, evictNonDeletedPods interface{}) *MockRuntime_GarbageCollect_Call { + return &MockRuntime_GarbageCollect_Call{Call: _e.mock.On("GarbageCollect", ctx, gcPolicy, allSourcesReady, evictNonDeletedPods)} +} + +func (_c *MockRuntime_GarbageCollect_Call) Run(run func(ctx context.Context, gcPolicy container.GCPolicy, allSourcesReady bool, evictNonDeletedPods bool)) *MockRuntime_GarbageCollect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.GCPolicy + if args[1] != nil { + arg1 = args[1].(container.GCPolicy) + } + var arg2 bool + if args[2] != nil { + arg2 = args[2].(bool) + } + var arg3 bool + if args[3] != nil { + arg3 = args[3].(bool) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockRuntime_GarbageCollect_Call) Return(err error) *MockRuntime_GarbageCollect_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntime_GarbageCollect_Call) RunAndReturn(run func(ctx context.Context, gcPolicy container.GCPolicy, allSourcesReady bool, evictNonDeletedPods bool) error) *MockRuntime_GarbageCollect_Call { + _c.Call.Return(run) + return _c +} + +// GeneratePodStatus provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GeneratePodStatus(event *v1.ContainerEventResponse) *container.PodStatus { + ret := _mock.Called(event) + + if len(ret) == 0 { + panic("no return value specified for GeneratePodStatus") + } + + var r0 *container.PodStatus + if returnFunc, ok := ret.Get(0).(func(*v1.ContainerEventResponse) *container.PodStatus); ok { + r0 = returnFunc(event) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*container.PodStatus) + } + } + return r0 +} + +// MockRuntime_GeneratePodStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GeneratePodStatus' +type MockRuntime_GeneratePodStatus_Call struct { + *mock.Call +} + +// GeneratePodStatus is a helper method to define mock.On call +// - event *v1.ContainerEventResponse +func (_e *MockRuntime_Expecter) GeneratePodStatus(event interface{}) *MockRuntime_GeneratePodStatus_Call { + return &MockRuntime_GeneratePodStatus_Call{Call: _e.mock.On("GeneratePodStatus", event)} +} + +func (_c *MockRuntime_GeneratePodStatus_Call) Run(run func(event *v1.ContainerEventResponse)) *MockRuntime_GeneratePodStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *v1.ContainerEventResponse + if args[0] != nil { + arg0 = args[0].(*v1.ContainerEventResponse) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_GeneratePodStatus_Call) Return(podStatus *container.PodStatus) *MockRuntime_GeneratePodStatus_Call { + _c.Call.Return(podStatus) + return _c +} + +func (_c *MockRuntime_GeneratePodStatus_Call) RunAndReturn(run func(event *v1.ContainerEventResponse) *container.PodStatus) *MockRuntime_GeneratePodStatus_Call { + _c.Call.Return(run) + return _c +} + +// GetContainerLogs provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GetContainerLogs(ctx context.Context, pod *v10.Pod, containerID container.ContainerID, logOptions *v10.PodLogOptions, stdout io.Writer, stderr io.Writer) error { + ret := _mock.Called(ctx, pod, containerID, logOptions, stdout, stderr) + + if len(ret) == 0 { + panic("no return value specified for GetContainerLogs") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v10.Pod, container.ContainerID, *v10.PodLogOptions, io.Writer, io.Writer) error); ok { + r0 = returnFunc(ctx, pod, containerID, logOptions, stdout, stderr) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockRuntime_GetContainerLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContainerLogs' +type MockRuntime_GetContainerLogs_Call struct { + *mock.Call +} + +// GetContainerLogs is a helper method to define mock.On call +// - ctx context.Context +// - pod *v10.Pod +// - containerID container.ContainerID +// - logOptions *v10.PodLogOptions +// - stdout io.Writer +// - stderr io.Writer +func (_e *MockRuntime_Expecter) GetContainerLogs(ctx interface{}, pod interface{}, containerID interface{}, logOptions interface{}, stdout interface{}, stderr interface{}) *MockRuntime_GetContainerLogs_Call { + return &MockRuntime_GetContainerLogs_Call{Call: _e.mock.On("GetContainerLogs", ctx, pod, containerID, logOptions, stdout, stderr)} +} + +func (_c *MockRuntime_GetContainerLogs_Call) Run(run func(ctx context.Context, pod *v10.Pod, containerID container.ContainerID, logOptions *v10.PodLogOptions, stdout io.Writer, stderr io.Writer)) *MockRuntime_GetContainerLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v10.Pod + if args[1] != nil { + arg1 = args[1].(*v10.Pod) + } + var arg2 container.ContainerID + if args[2] != nil { + arg2 = args[2].(container.ContainerID) + } + var arg3 *v10.PodLogOptions + if args[3] != nil { + arg3 = args[3].(*v10.PodLogOptions) + } + var arg4 io.Writer + if args[4] != nil { + arg4 = args[4].(io.Writer) + } + var arg5 io.Writer + if args[5] != nil { + arg5 = args[5].(io.Writer) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + ) + }) + return _c +} + +func (_c *MockRuntime_GetContainerLogs_Call) Return(err error) *MockRuntime_GetContainerLogs_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntime_GetContainerLogs_Call) RunAndReturn(run func(ctx context.Context, pod *v10.Pod, containerID container.ContainerID, logOptions *v10.PodLogOptions, stdout io.Writer, stderr io.Writer) error) *MockRuntime_GetContainerLogs_Call { + _c.Call.Return(run) + return _c +} + +// GetContainerStatus provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GetContainerStatus(ctx context.Context, id container.ContainerID) (*container.Status, error) { + ret := _mock.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for GetContainerStatus") + } + + var r0 *container.Status + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ContainerID) (*container.Status, error)); ok { + return returnFunc(ctx, id) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ContainerID) *container.Status); ok { + r0 = returnFunc(ctx, id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*container.Status) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, container.ContainerID) error); ok { + r1 = returnFunc(ctx, id) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_GetContainerStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContainerStatus' +type MockRuntime_GetContainerStatus_Call struct { + *mock.Call +} + +// GetContainerStatus is a helper method to define mock.On call +// - ctx context.Context +// - id container.ContainerID +func (_e *MockRuntime_Expecter) GetContainerStatus(ctx interface{}, id interface{}) *MockRuntime_GetContainerStatus_Call { + return &MockRuntime_GetContainerStatus_Call{Call: _e.mock.On("GetContainerStatus", ctx, id)} +} + +func (_c *MockRuntime_GetContainerStatus_Call) Run(run func(ctx context.Context, id container.ContainerID)) *MockRuntime_GetContainerStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.ContainerID + if args[1] != nil { + arg1 = args[1].(container.ContainerID) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_GetContainerStatus_Call) Return(status *container.Status, err error) *MockRuntime_GetContainerStatus_Call { + _c.Call.Return(status, err) + return _c +} + +func (_c *MockRuntime_GetContainerStatus_Call) RunAndReturn(run func(ctx context.Context, id container.ContainerID) (*container.Status, error)) *MockRuntime_GetContainerStatus_Call { + _c.Call.Return(run) + return _c +} + +// GetContainerSwapBehavior provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GetContainerSwapBehavior(pod *v10.Pod, container1 *v10.Container) types.SwapBehavior { + ret := _mock.Called(pod, container1) + + if len(ret) == 0 { + panic("no return value specified for GetContainerSwapBehavior") + } + + var r0 types.SwapBehavior + if returnFunc, ok := ret.Get(0).(func(*v10.Pod, *v10.Container) types.SwapBehavior); ok { + r0 = returnFunc(pod, container1) + } else { + r0 = ret.Get(0).(types.SwapBehavior) + } + return r0 +} + +// MockRuntime_GetContainerSwapBehavior_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContainerSwapBehavior' +type MockRuntime_GetContainerSwapBehavior_Call struct { + *mock.Call +} + +// GetContainerSwapBehavior is a helper method to define mock.On call +// - pod *v10.Pod +// - container1 *v10.Container +func (_e *MockRuntime_Expecter) GetContainerSwapBehavior(pod interface{}, container1 interface{}) *MockRuntime_GetContainerSwapBehavior_Call { + return &MockRuntime_GetContainerSwapBehavior_Call{Call: _e.mock.On("GetContainerSwapBehavior", pod, container1)} +} + +func (_c *MockRuntime_GetContainerSwapBehavior_Call) Run(run func(pod *v10.Pod, container1 *v10.Container)) *MockRuntime_GetContainerSwapBehavior_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 *MockRuntime_GetContainerSwapBehavior_Call) Return(swapBehavior types.SwapBehavior) *MockRuntime_GetContainerSwapBehavior_Call { + _c.Call.Return(swapBehavior) + return _c +} + +func (_c *MockRuntime_GetContainerSwapBehavior_Call) RunAndReturn(run func(pod *v10.Pod, container1 *v10.Container) types.SwapBehavior) *MockRuntime_GetContainerSwapBehavior_Call { + _c.Call.Return(run) + return _c +} + +// GetImageRef provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GetImageRef(ctx context.Context, image container.ImageSpec) (string, error) { + ret := _mock.Called(ctx, image) + + if len(ret) == 0 { + panic("no return value specified for GetImageRef") + } + + var r0 string + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ImageSpec) (string, error)); ok { + return returnFunc(ctx, image) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ImageSpec) string); ok { + r0 = returnFunc(ctx, image) + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, container.ImageSpec) error); ok { + r1 = returnFunc(ctx, image) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_GetImageRef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetImageRef' +type MockRuntime_GetImageRef_Call struct { + *mock.Call +} + +// GetImageRef is a helper method to define mock.On call +// - ctx context.Context +// - image container.ImageSpec +func (_e *MockRuntime_Expecter) GetImageRef(ctx interface{}, image interface{}) *MockRuntime_GetImageRef_Call { + return &MockRuntime_GetImageRef_Call{Call: _e.mock.On("GetImageRef", ctx, image)} +} + +func (_c *MockRuntime_GetImageRef_Call) Run(run func(ctx context.Context, image container.ImageSpec)) *MockRuntime_GetImageRef_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.ImageSpec + if args[1] != nil { + arg1 = args[1].(container.ImageSpec) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_GetImageRef_Call) Return(s string, err error) *MockRuntime_GetImageRef_Call { + _c.Call.Return(s, err) + return _c +} + +func (_c *MockRuntime_GetImageRef_Call) RunAndReturn(run func(ctx context.Context, image container.ImageSpec) (string, error)) *MockRuntime_GetImageRef_Call { + _c.Call.Return(run) + return _c +} + +// GetImageSize provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GetImageSize(ctx context.Context, image container.ImageSpec) (uint64, error) { + ret := _mock.Called(ctx, image) + + if len(ret) == 0 { + panic("no return value specified for GetImageSize") + } + + var r0 uint64 + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ImageSpec) (uint64, error)); ok { + return returnFunc(ctx, image) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ImageSpec) uint64); ok { + r0 = returnFunc(ctx, image) + } else { + r0 = ret.Get(0).(uint64) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, container.ImageSpec) error); ok { + r1 = returnFunc(ctx, image) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_GetImageSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetImageSize' +type MockRuntime_GetImageSize_Call struct { + *mock.Call +} + +// GetImageSize is a helper method to define mock.On call +// - ctx context.Context +// - image container.ImageSpec +func (_e *MockRuntime_Expecter) GetImageSize(ctx interface{}, image interface{}) *MockRuntime_GetImageSize_Call { + return &MockRuntime_GetImageSize_Call{Call: _e.mock.On("GetImageSize", ctx, image)} +} + +func (_c *MockRuntime_GetImageSize_Call) Run(run func(ctx context.Context, image container.ImageSpec)) *MockRuntime_GetImageSize_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.ImageSpec + if args[1] != nil { + arg1 = args[1].(container.ImageSpec) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_GetImageSize_Call) Return(v uint64, err error) *MockRuntime_GetImageSize_Call { + _c.Call.Return(v, err) + return _c +} + +func (_c *MockRuntime_GetImageSize_Call) RunAndReturn(run func(ctx context.Context, image container.ImageSpec) (uint64, error)) *MockRuntime_GetImageSize_Call { + _c.Call.Return(run) + return _c +} + +// GetPodStatus provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GetPodStatus(ctx context.Context, uid types0.UID, name string, namespace string) (*container.PodStatus, error) { + ret := _mock.Called(ctx, uid, name, namespace) + + if len(ret) == 0 { + panic("no return value specified for GetPodStatus") + } + + var r0 *container.PodStatus + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, types0.UID, string, string) (*container.PodStatus, error)); ok { + return returnFunc(ctx, uid, name, namespace) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, types0.UID, string, string) *container.PodStatus); ok { + r0 = returnFunc(ctx, uid, name, namespace) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*container.PodStatus) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, types0.UID, string, string) error); ok { + r1 = returnFunc(ctx, uid, name, namespace) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_GetPodStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodStatus' +type MockRuntime_GetPodStatus_Call struct { + *mock.Call +} + +// GetPodStatus is a helper method to define mock.On call +// - ctx context.Context +// - uid types0.UID +// - name string +// - namespace string +func (_e *MockRuntime_Expecter) GetPodStatus(ctx interface{}, uid interface{}, name interface{}, namespace interface{}) *MockRuntime_GetPodStatus_Call { + return &MockRuntime_GetPodStatus_Call{Call: _e.mock.On("GetPodStatus", ctx, uid, name, namespace)} +} + +func (_c *MockRuntime_GetPodStatus_Call) Run(run func(ctx context.Context, uid types0.UID, name string, namespace string)) *MockRuntime_GetPodStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 types0.UID + if args[1] != nil { + arg1 = args[1].(types0.UID) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockRuntime_GetPodStatus_Call) Return(podStatus *container.PodStatus, err error) *MockRuntime_GetPodStatus_Call { + _c.Call.Return(podStatus, err) + return _c +} + +func (_c *MockRuntime_GetPodStatus_Call) RunAndReturn(run func(ctx context.Context, uid types0.UID, name string, namespace string) (*container.PodStatus, error)) *MockRuntime_GetPodStatus_Call { + _c.Call.Return(run) + return _c +} + +// GetPods provides a mock function for the type MockRuntime +func (_mock *MockRuntime) GetPods(ctx context.Context, all bool) ([]*container.Pod, error) { + ret := _mock.Called(ctx, all) + + if len(ret) == 0 { + panic("no return value specified for GetPods") + } + + var r0 []*container.Pod + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, bool) ([]*container.Pod, error)); ok { + return returnFunc(ctx, all) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, bool) []*container.Pod); ok { + r0 = returnFunc(ctx, all) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*container.Pod) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, bool) error); ok { + r1 = returnFunc(ctx, all) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_GetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPods' +type MockRuntime_GetPods_Call struct { + *mock.Call +} + +// GetPods is a helper method to define mock.On call +// - ctx context.Context +// - all bool +func (_e *MockRuntime_Expecter) GetPods(ctx interface{}, all interface{}) *MockRuntime_GetPods_Call { + return &MockRuntime_GetPods_Call{Call: _e.mock.On("GetPods", ctx, all)} +} + +func (_c *MockRuntime_GetPods_Call) Run(run func(ctx context.Context, all bool)) *MockRuntime_GetPods_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_GetPods_Call) Return(pods []*container.Pod, err error) *MockRuntime_GetPods_Call { + _c.Call.Return(pods, err) + return _c +} + +func (_c *MockRuntime_GetPods_Call) RunAndReturn(run func(ctx context.Context, all bool) ([]*container.Pod, error)) *MockRuntime_GetPods_Call { + _c.Call.Return(run) + return _c +} + +// ImageFsInfo provides a mock function for the type MockRuntime +func (_mock *MockRuntime) ImageFsInfo(ctx context.Context) (*v1.ImageFsInfoResponse, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ImageFsInfo") + } + + var r0 *v1.ImageFsInfoResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (*v1.ImageFsInfoResponse, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) *v1.ImageFsInfoResponse); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ImageFsInfoResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_ImageFsInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageFsInfo' +type MockRuntime_ImageFsInfo_Call struct { + *mock.Call +} + +// ImageFsInfo is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockRuntime_Expecter) ImageFsInfo(ctx interface{}) *MockRuntime_ImageFsInfo_Call { + return &MockRuntime_ImageFsInfo_Call{Call: _e.mock.On("ImageFsInfo", ctx)} +} + +func (_c *MockRuntime_ImageFsInfo_Call) Run(run func(ctx context.Context)) *MockRuntime_ImageFsInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_ImageFsInfo_Call) Return(imageFsInfoResponse *v1.ImageFsInfoResponse, err error) *MockRuntime_ImageFsInfo_Call { + _c.Call.Return(imageFsInfoResponse, err) + return _c +} + +func (_c *MockRuntime_ImageFsInfo_Call) RunAndReturn(run func(ctx context.Context) (*v1.ImageFsInfoResponse, error)) *MockRuntime_ImageFsInfo_Call { + _c.Call.Return(run) + return _c +} + +// ImageStats provides a mock function for the type MockRuntime +func (_mock *MockRuntime) ImageStats(ctx context.Context) (*container.ImageStats, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ImageStats") + } + + var r0 *container.ImageStats + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (*container.ImageStats, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) *container.ImageStats); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*container.ImageStats) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_ImageStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageStats' +type MockRuntime_ImageStats_Call struct { + *mock.Call +} + +// ImageStats is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockRuntime_Expecter) ImageStats(ctx interface{}) *MockRuntime_ImageStats_Call { + return &MockRuntime_ImageStats_Call{Call: _e.mock.On("ImageStats", ctx)} +} + +func (_c *MockRuntime_ImageStats_Call) Run(run func(ctx context.Context)) *MockRuntime_ImageStats_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_ImageStats_Call) Return(imageStats *container.ImageStats, err error) *MockRuntime_ImageStats_Call { + _c.Call.Return(imageStats, err) + return _c +} + +func (_c *MockRuntime_ImageStats_Call) RunAndReturn(run func(ctx context.Context) (*container.ImageStats, error)) *MockRuntime_ImageStats_Call { + _c.Call.Return(run) + return _c +} + +// KillPod provides a mock function for the type MockRuntime +func (_mock *MockRuntime) KillPod(ctx context.Context, pod *v10.Pod, runningPod container.Pod, gracePeriodOverride *int64) error { + ret := _mock.Called(ctx, pod, runningPod, gracePeriodOverride) + + if len(ret) == 0 { + panic("no return value specified for KillPod") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *v10.Pod, container.Pod, *int64) error); ok { + r0 = returnFunc(ctx, pod, runningPod, gracePeriodOverride) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockRuntime_KillPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KillPod' +type MockRuntime_KillPod_Call struct { + *mock.Call +} + +// KillPod is a helper method to define mock.On call +// - ctx context.Context +// - pod *v10.Pod +// - runningPod container.Pod +// - gracePeriodOverride *int64 +func (_e *MockRuntime_Expecter) KillPod(ctx interface{}, pod interface{}, runningPod interface{}, gracePeriodOverride interface{}) *MockRuntime_KillPod_Call { + return &MockRuntime_KillPod_Call{Call: _e.mock.On("KillPod", ctx, pod, runningPod, gracePeriodOverride)} +} + +func (_c *MockRuntime_KillPod_Call) Run(run func(ctx context.Context, pod *v10.Pod, runningPod container.Pod, gracePeriodOverride *int64)) *MockRuntime_KillPod_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v10.Pod + if args[1] != nil { + arg1 = args[1].(*v10.Pod) + } + var arg2 container.Pod + if args[2] != nil { + arg2 = args[2].(container.Pod) + } + var arg3 *int64 + if args[3] != nil { + arg3 = args[3].(*int64) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockRuntime_KillPod_Call) Return(err error) *MockRuntime_KillPod_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntime_KillPod_Call) RunAndReturn(run func(ctx context.Context, pod *v10.Pod, runningPod container.Pod, gracePeriodOverride *int64) error) *MockRuntime_KillPod_Call { + _c.Call.Return(run) + return _c +} + +// ListImages provides a mock function for the type MockRuntime +func (_mock *MockRuntime) ListImages(ctx context.Context) ([]container.Image, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ListImages") + } + + var r0 []container.Image + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]container.Image, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) []container.Image); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]container.Image) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_ListImages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListImages' +type MockRuntime_ListImages_Call struct { + *mock.Call +} + +// ListImages is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockRuntime_Expecter) ListImages(ctx interface{}) *MockRuntime_ListImages_Call { + return &MockRuntime_ListImages_Call{Call: _e.mock.On("ListImages", ctx)} +} + +func (_c *MockRuntime_ListImages_Call) Run(run func(ctx context.Context)) *MockRuntime_ListImages_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_ListImages_Call) Return(images []container.Image, err error) *MockRuntime_ListImages_Call { + _c.Call.Return(images, err) + return _c +} + +func (_c *MockRuntime_ListImages_Call) RunAndReturn(run func(ctx context.Context) ([]container.Image, error)) *MockRuntime_ListImages_Call { + _c.Call.Return(run) + return _c +} + +// ListMetricDescriptors provides a mock function for the type MockRuntime +func (_mock *MockRuntime) ListMetricDescriptors(ctx context.Context) ([]*v1.MetricDescriptor, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ListMetricDescriptors") + } + + var r0 []*v1.MetricDescriptor + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*v1.MetricDescriptor, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) []*v1.MetricDescriptor); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v1.MetricDescriptor) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_ListMetricDescriptors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListMetricDescriptors' +type MockRuntime_ListMetricDescriptors_Call struct { + *mock.Call +} + +// ListMetricDescriptors is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockRuntime_Expecter) ListMetricDescriptors(ctx interface{}) *MockRuntime_ListMetricDescriptors_Call { + return &MockRuntime_ListMetricDescriptors_Call{Call: _e.mock.On("ListMetricDescriptors", ctx)} +} + +func (_c *MockRuntime_ListMetricDescriptors_Call) Run(run func(ctx context.Context)) *MockRuntime_ListMetricDescriptors_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_ListMetricDescriptors_Call) Return(metricDescriptors []*v1.MetricDescriptor, err error) *MockRuntime_ListMetricDescriptors_Call { + _c.Call.Return(metricDescriptors, err) + return _c +} + +func (_c *MockRuntime_ListMetricDescriptors_Call) RunAndReturn(run func(ctx context.Context) ([]*v1.MetricDescriptor, error)) *MockRuntime_ListMetricDescriptors_Call { + _c.Call.Return(run) + return _c +} + +// ListPodSandboxMetrics provides a mock function for the type MockRuntime +func (_mock *MockRuntime) ListPodSandboxMetrics(ctx context.Context) ([]*v1.PodSandboxMetrics, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ListPodSandboxMetrics") + } + + var r0 []*v1.PodSandboxMetrics + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*v1.PodSandboxMetrics, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) []*v1.PodSandboxMetrics); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v1.PodSandboxMetrics) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_ListPodSandboxMetrics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPodSandboxMetrics' +type MockRuntime_ListPodSandboxMetrics_Call struct { + *mock.Call +} + +// ListPodSandboxMetrics is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockRuntime_Expecter) ListPodSandboxMetrics(ctx interface{}) *MockRuntime_ListPodSandboxMetrics_Call { + return &MockRuntime_ListPodSandboxMetrics_Call{Call: _e.mock.On("ListPodSandboxMetrics", ctx)} +} + +func (_c *MockRuntime_ListPodSandboxMetrics_Call) Run(run func(ctx context.Context)) *MockRuntime_ListPodSandboxMetrics_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_ListPodSandboxMetrics_Call) Return(podSandboxMetricss []*v1.PodSandboxMetrics, err error) *MockRuntime_ListPodSandboxMetrics_Call { + _c.Call.Return(podSandboxMetricss, err) + return _c +} + +func (_c *MockRuntime_ListPodSandboxMetrics_Call) RunAndReturn(run func(ctx context.Context) ([]*v1.PodSandboxMetrics, error)) *MockRuntime_ListPodSandboxMetrics_Call { + _c.Call.Return(run) + return _c +} + +// PullImage provides a mock function for the type MockRuntime +func (_mock *MockRuntime) PullImage(ctx context.Context, image container.ImageSpec, credentials []credentialprovider.TrackedAuthConfig, podSandboxConfig *v1.PodSandboxConfig) (string, *credentialprovider.TrackedAuthConfig, error) { + ret := _mock.Called(ctx, image, credentials, podSandboxConfig) + + if len(ret) == 0 { + panic("no return value specified for PullImage") + } + + var r0 string + var r1 *credentialprovider.TrackedAuthConfig + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) (string, *credentialprovider.TrackedAuthConfig, error)); ok { + return returnFunc(ctx, image, credentials, podSandboxConfig) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) string); ok { + r0 = returnFunc(ctx, image, credentials, podSandboxConfig) + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) *credentialprovider.TrackedAuthConfig); ok { + r1 = returnFunc(ctx, image, credentials, podSandboxConfig) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*credentialprovider.TrackedAuthConfig) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) error); ok { + r2 = returnFunc(ctx, image, credentials, podSandboxConfig) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockRuntime_PullImage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PullImage' +type MockRuntime_PullImage_Call struct { + *mock.Call +} + +// PullImage is a helper method to define mock.On call +// - ctx context.Context +// - image container.ImageSpec +// - credentials []credentialprovider.TrackedAuthConfig +// - podSandboxConfig *v1.PodSandboxConfig +func (_e *MockRuntime_Expecter) PullImage(ctx interface{}, image interface{}, credentials interface{}, podSandboxConfig interface{}) *MockRuntime_PullImage_Call { + return &MockRuntime_PullImage_Call{Call: _e.mock.On("PullImage", ctx, image, credentials, podSandboxConfig)} +} + +func (_c *MockRuntime_PullImage_Call) Run(run func(ctx context.Context, image container.ImageSpec, credentials []credentialprovider.TrackedAuthConfig, podSandboxConfig *v1.PodSandboxConfig)) *MockRuntime_PullImage_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.ImageSpec + if args[1] != nil { + arg1 = args[1].(container.ImageSpec) + } + var arg2 []credentialprovider.TrackedAuthConfig + if args[2] != nil { + arg2 = args[2].([]credentialprovider.TrackedAuthConfig) + } + var arg3 *v1.PodSandboxConfig + if args[3] != nil { + arg3 = args[3].(*v1.PodSandboxConfig) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockRuntime_PullImage_Call) Return(s string, trackedAuthConfig *credentialprovider.TrackedAuthConfig, err error) *MockRuntime_PullImage_Call { + _c.Call.Return(s, trackedAuthConfig, err) + return _c +} + +func (_c *MockRuntime_PullImage_Call) RunAndReturn(run func(ctx context.Context, image container.ImageSpec, credentials []credentialprovider.TrackedAuthConfig, podSandboxConfig *v1.PodSandboxConfig) (string, *credentialprovider.TrackedAuthConfig, error)) *MockRuntime_PullImage_Call { + _c.Call.Return(run) + return _c +} + +// RemoveImage provides a mock function for the type MockRuntime +func (_mock *MockRuntime) RemoveImage(ctx context.Context, image container.ImageSpec) error { + ret := _mock.Called(ctx, image) + + if len(ret) == 0 { + panic("no return value specified for RemoveImage") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ImageSpec) error); ok { + r0 = returnFunc(ctx, image) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockRuntime_RemoveImage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveImage' +type MockRuntime_RemoveImage_Call struct { + *mock.Call +} + +// RemoveImage is a helper method to define mock.On call +// - ctx context.Context +// - image container.ImageSpec +func (_e *MockRuntime_Expecter) RemoveImage(ctx interface{}, image interface{}) *MockRuntime_RemoveImage_Call { + return &MockRuntime_RemoveImage_Call{Call: _e.mock.On("RemoveImage", ctx, image)} +} + +func (_c *MockRuntime_RemoveImage_Call) Run(run func(ctx context.Context, image container.ImageSpec)) *MockRuntime_RemoveImage_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.ImageSpec + if args[1] != nil { + arg1 = args[1].(container.ImageSpec) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_RemoveImage_Call) Return(err error) *MockRuntime_RemoveImage_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntime_RemoveImage_Call) RunAndReturn(run func(ctx context.Context, image container.ImageSpec) error) *MockRuntime_RemoveImage_Call { + _c.Call.Return(run) + return _c +} + +// Status provides a mock function for the type MockRuntime +func (_mock *MockRuntime) Status(ctx context.Context) (*container.RuntimeStatus, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Status") + } + + var r0 *container.RuntimeStatus + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (*container.RuntimeStatus, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) *container.RuntimeStatus); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*container.RuntimeStatus) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type MockRuntime_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockRuntime_Expecter) Status(ctx interface{}) *MockRuntime_Status_Call { + return &MockRuntime_Status_Call{Call: _e.mock.On("Status", ctx)} +} + +func (_c *MockRuntime_Status_Call) Run(run func(ctx context.Context)) *MockRuntime_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_Status_Call) Return(runtimeStatus *container.RuntimeStatus, err error) *MockRuntime_Status_Call { + _c.Call.Return(runtimeStatus, err) + return _c +} + +func (_c *MockRuntime_Status_Call) RunAndReturn(run func(ctx context.Context) (*container.RuntimeStatus, error)) *MockRuntime_Status_Call { + _c.Call.Return(run) + return _c +} + +// SyncPod provides a mock function for the type MockRuntime +func (_mock *MockRuntime) SyncPod(ctx context.Context, pod *v10.Pod, podStatus *container.PodStatus, pullSecrets []v10.Secret, backOff *flowcontrol.Backoff) container.PodSyncResult { + ret := _mock.Called(ctx, pod, podStatus, pullSecrets, backOff) + + if len(ret) == 0 { + panic("no return value specified for SyncPod") + } + + var r0 container.PodSyncResult + if returnFunc, ok := ret.Get(0).(func(context.Context, *v10.Pod, *container.PodStatus, []v10.Secret, *flowcontrol.Backoff) container.PodSyncResult); ok { + r0 = returnFunc(ctx, pod, podStatus, pullSecrets, backOff) + } else { + r0 = ret.Get(0).(container.PodSyncResult) + } + return r0 +} + +// MockRuntime_SyncPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncPod' +type MockRuntime_SyncPod_Call struct { + *mock.Call +} + +// SyncPod is a helper method to define mock.On call +// - ctx context.Context +// - pod *v10.Pod +// - podStatus *container.PodStatus +// - pullSecrets []v10.Secret +// - backOff *flowcontrol.Backoff +func (_e *MockRuntime_Expecter) SyncPod(ctx interface{}, pod interface{}, podStatus interface{}, pullSecrets interface{}, backOff interface{}) *MockRuntime_SyncPod_Call { + return &MockRuntime_SyncPod_Call{Call: _e.mock.On("SyncPod", ctx, pod, podStatus, pullSecrets, backOff)} +} + +func (_c *MockRuntime_SyncPod_Call) Run(run func(ctx context.Context, pod *v10.Pod, podStatus *container.PodStatus, pullSecrets []v10.Secret, backOff *flowcontrol.Backoff)) *MockRuntime_SyncPod_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *v10.Pod + if args[1] != nil { + arg1 = args[1].(*v10.Pod) + } + var arg2 *container.PodStatus + if args[2] != nil { + arg2 = args[2].(*container.PodStatus) + } + var arg3 []v10.Secret + if args[3] != nil { + arg3 = args[3].([]v10.Secret) + } + var arg4 *flowcontrol.Backoff + if args[4] != nil { + arg4 = args[4].(*flowcontrol.Backoff) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *MockRuntime_SyncPod_Call) Return(podSyncResult container.PodSyncResult) *MockRuntime_SyncPod_Call { + _c.Call.Return(podSyncResult) + return _c +} + +func (_c *MockRuntime_SyncPod_Call) RunAndReturn(run func(ctx context.Context, pod *v10.Pod, podStatus *container.PodStatus, pullSecrets []v10.Secret, backOff *flowcontrol.Backoff) container.PodSyncResult) *MockRuntime_SyncPod_Call { + _c.Call.Return(run) + return _c +} + +// Type provides a mock function for the type MockRuntime +func (_mock *MockRuntime) Type() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MockRuntime_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type MockRuntime_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *MockRuntime_Expecter) Type() *MockRuntime_Type_Call { + return &MockRuntime_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *MockRuntime_Type_Call) Run(run func()) *MockRuntime_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockRuntime_Type_Call) Return(s string) *MockRuntime_Type_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MockRuntime_Type_Call) RunAndReturn(run func() string) *MockRuntime_Type_Call { + _c.Call.Return(run) + return _c +} + +// UpdatePodCIDR provides a mock function for the type MockRuntime +func (_mock *MockRuntime) UpdatePodCIDR(ctx context.Context, podCIDR string) error { + ret := _mock.Called(ctx, podCIDR) + + if len(ret) == 0 { + panic("no return value specified for UpdatePodCIDR") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, podCIDR) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockRuntime_UpdatePodCIDR_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePodCIDR' +type MockRuntime_UpdatePodCIDR_Call struct { + *mock.Call +} + +// UpdatePodCIDR is a helper method to define mock.On call +// - ctx context.Context +// - podCIDR string +func (_e *MockRuntime_Expecter) UpdatePodCIDR(ctx interface{}, podCIDR interface{}) *MockRuntime_UpdatePodCIDR_Call { + return &MockRuntime_UpdatePodCIDR_Call{Call: _e.mock.On("UpdatePodCIDR", ctx, podCIDR)} +} + +func (_c *MockRuntime_UpdatePodCIDR_Call) Run(run func(ctx context.Context, podCIDR string)) *MockRuntime_UpdatePodCIDR_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntime_UpdatePodCIDR_Call) Return(err error) *MockRuntime_UpdatePodCIDR_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntime_UpdatePodCIDR_Call) RunAndReturn(run func(ctx context.Context, podCIDR string) error) *MockRuntime_UpdatePodCIDR_Call { + _c.Call.Return(run) + return _c +} + +// Version provides a mock function for the type MockRuntime +func (_mock *MockRuntime) Version(ctx context.Context) (container.Version, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Version") + } + + var r0 container.Version + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (container.Version, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) container.Version); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(container.Version) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRuntime_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type MockRuntime_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockRuntime_Expecter) Version(ctx interface{}) *MockRuntime_Version_Call { + return &MockRuntime_Version_Call{Call: _e.mock.On("Version", ctx)} +} + +func (_c *MockRuntime_Version_Call) Run(run func(ctx context.Context)) *MockRuntime_Version_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntime_Version_Call) Return(version container.Version, err error) *MockRuntime_Version_Call { + _c.Call.Return(version, err) + return _c +} + +func (_c *MockRuntime_Version_Call) RunAndReturn(run func(ctx context.Context) (container.Version, error)) *MockRuntime_Version_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 +} + +// 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 for the type MockRuntimeCache +func (_mock *MockRuntimeCache) ForceUpdateIfOlder(context1 context.Context, time1 time.Time) error { + ret := _mock.Called(context1, time1) + + if len(ret) == 0 { + panic("no return value specified for ForceUpdateIfOlder") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) error); ok { + r0 = returnFunc(context1, time1) + } 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 +// - context1 context.Context +// - time1 time.Time +func (_e *MockRuntimeCache_Expecter) ForceUpdateIfOlder(context1 interface{}, time1 interface{}) *MockRuntimeCache_ForceUpdateIfOlder_Call { + return &MockRuntimeCache_ForceUpdateIfOlder_Call{Call: _e.mock.On("ForceUpdateIfOlder", context1, time1)} +} + +func (_c *MockRuntimeCache_ForceUpdateIfOlder_Call) Run(run func(context1 context.Context, time1 time.Time)) *MockRuntimeCache_ForceUpdateIfOlder_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 time.Time + if args[1] != nil { + arg1 = args[1].(time.Time) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRuntimeCache_ForceUpdateIfOlder_Call) Return(err error) *MockRuntimeCache_ForceUpdateIfOlder_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockRuntimeCache_ForceUpdateIfOlder_Call) RunAndReturn(run func(context1 context.Context, time1 time.Time) error) *MockRuntimeCache_ForceUpdateIfOlder_Call { + _c.Call.Return(run) + return _c +} + +// GetPods provides a mock function for the type MockRuntimeCache +func (_mock *MockRuntimeCache) GetPods(context1 context.Context) ([]*container.Pod, error) { + ret := _mock.Called(context1) + + if len(ret) == 0 { + panic("no return value specified for GetPods") + } + + var r0 []*container.Pod + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*container.Pod, error)); ok { + return returnFunc(context1) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) []*container.Pod); ok { + r0 = returnFunc(context1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*container.Pod) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) + } 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 +// - context1 context.Context +func (_e *MockRuntimeCache_Expecter) GetPods(context1 interface{}) *MockRuntimeCache_GetPods_Call { + return &MockRuntimeCache_GetPods_Call{Call: _e.mock.On("GetPods", context1)} +} + +func (_c *MockRuntimeCache_GetPods_Call) Run(run func(context1 context.Context)) *MockRuntimeCache_GetPods_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockRuntimeCache_GetPods_Call) Return(pods []*container.Pod, err error) *MockRuntimeCache_GetPods_Call { + _c.Call.Return(pods, err) + return _c +} + +func (_c *MockRuntimeCache_GetPods_Call) RunAndReturn(run func(context1 context.Context) ([]*container.Pod, error)) *MockRuntimeCache_GetPods_Call { + _c.Call.Return(run) + return _c +} diff --git a/pkg/kubelet/container/testing/runtime_mock.go b/pkg/kubelet/container/testing/runtime_mock.go deleted file mode 100644 index dd5dceb6f4c..00000000000 --- a/pkg/kubelet/container/testing/runtime_mock.go +++ /dev/null @@ -1,1419 +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" - - corev1 "k8s.io/api/core/v1" - - credentialprovider "k8s.io/kubernetes/pkg/credentialprovider" - - flowcontrol "k8s.io/client-go/util/flowcontrol" - - io "io" - - mock "github.com/stretchr/testify/mock" - - pkgtypes "k8s.io/apimachinery/pkg/types" - - types "k8s.io/kubernetes/pkg/kubelet/types" - - v1 "k8s.io/cri-api/pkg/apis/runtime/v1" -) - -// MockRuntime is an autogenerated mock type for the Runtime type -type MockRuntime struct { - mock.Mock -} - -type MockRuntime_Expecter struct { - mock *mock.Mock -} - -func (_m *MockRuntime) EXPECT() *MockRuntime_Expecter { - return &MockRuntime_Expecter{mock: &_m.Mock} -} - -// APIVersion provides a mock function with no fields -func (_m *MockRuntime) APIVersion() (container.Version, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for APIVersion") - } - - var r0 container.Version - var r1 error - if rf, ok := ret.Get(0).(func() (container.Version, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() container.Version); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(container.Version) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_APIVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'APIVersion' -type MockRuntime_APIVersion_Call struct { - *mock.Call -} - -// APIVersion is a helper method to define mock.On call -func (_e *MockRuntime_Expecter) APIVersion() *MockRuntime_APIVersion_Call { - return &MockRuntime_APIVersion_Call{Call: _e.mock.On("APIVersion")} -} - -func (_c *MockRuntime_APIVersion_Call) Run(run func()) *MockRuntime_APIVersion_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRuntime_APIVersion_Call) Return(_a0 container.Version, _a1 error) *MockRuntime_APIVersion_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_APIVersion_Call) RunAndReturn(run func() (container.Version, error)) *MockRuntime_APIVersion_Call { - _c.Call.Return(run) - return _c -} - -// CheckpointContainer provides a mock function with given fields: ctx, options -func (_m *MockRuntime) CheckpointContainer(ctx context.Context, options *v1.CheckpointContainerRequest) error { - ret := _m.Called(ctx, options) - - if len(ret) == 0 { - panic("no return value specified for CheckpointContainer") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.CheckpointContainerRequest) error); ok { - r0 = rf(ctx, options) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRuntime_CheckpointContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckpointContainer' -type MockRuntime_CheckpointContainer_Call struct { - *mock.Call -} - -// CheckpointContainer is a helper method to define mock.On call -// - ctx context.Context -// - options *v1.CheckpointContainerRequest -func (_e *MockRuntime_Expecter) CheckpointContainer(ctx interface{}, options interface{}) *MockRuntime_CheckpointContainer_Call { - return &MockRuntime_CheckpointContainer_Call{Call: _e.mock.On("CheckpointContainer", ctx, options)} -} - -func (_c *MockRuntime_CheckpointContainer_Call) Run(run func(ctx context.Context, options *v1.CheckpointContainerRequest)) *MockRuntime_CheckpointContainer_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.CheckpointContainerRequest)) - }) - return _c -} - -func (_c *MockRuntime_CheckpointContainer_Call) Return(_a0 error) *MockRuntime_CheckpointContainer_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_CheckpointContainer_Call) RunAndReturn(run func(context.Context, *v1.CheckpointContainerRequest) error) *MockRuntime_CheckpointContainer_Call { - _c.Call.Return(run) - return _c -} - -// DeleteContainer provides a mock function with given fields: ctx, containerID -func (_m *MockRuntime) DeleteContainer(ctx context.Context, containerID container.ContainerID) error { - ret := _m.Called(ctx, containerID) - - if len(ret) == 0 { - panic("no return value specified for DeleteContainer") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, container.ContainerID) error); ok { - r0 = rf(ctx, containerID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRuntime_DeleteContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteContainer' -type MockRuntime_DeleteContainer_Call struct { - *mock.Call -} - -// DeleteContainer is a helper method to define mock.On call -// - ctx context.Context -// - containerID container.ContainerID -func (_e *MockRuntime_Expecter) DeleteContainer(ctx interface{}, containerID interface{}) *MockRuntime_DeleteContainer_Call { - return &MockRuntime_DeleteContainer_Call{Call: _e.mock.On("DeleteContainer", ctx, containerID)} -} - -func (_c *MockRuntime_DeleteContainer_Call) Run(run func(ctx context.Context, containerID container.ContainerID)) *MockRuntime_DeleteContainer_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(container.ContainerID)) - }) - return _c -} - -func (_c *MockRuntime_DeleteContainer_Call) Return(_a0 error) *MockRuntime_DeleteContainer_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_DeleteContainer_Call) RunAndReturn(run func(context.Context, container.ContainerID) error) *MockRuntime_DeleteContainer_Call { - _c.Call.Return(run) - return _c -} - -// GarbageCollect provides a mock function with given fields: ctx, gcPolicy, allSourcesReady, evictNonDeletedPods -func (_m *MockRuntime) GarbageCollect(ctx context.Context, gcPolicy container.GCPolicy, allSourcesReady bool, evictNonDeletedPods bool) error { - ret := _m.Called(ctx, gcPolicy, allSourcesReady, evictNonDeletedPods) - - if len(ret) == 0 { - panic("no return value specified for GarbageCollect") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, container.GCPolicy, bool, bool) error); ok { - r0 = rf(ctx, gcPolicy, allSourcesReady, evictNonDeletedPods) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRuntime_GarbageCollect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GarbageCollect' -type MockRuntime_GarbageCollect_Call struct { - *mock.Call -} - -// GarbageCollect is a helper method to define mock.On call -// - ctx context.Context -// - gcPolicy container.GCPolicy -// - allSourcesReady bool -// - evictNonDeletedPods bool -func (_e *MockRuntime_Expecter) GarbageCollect(ctx interface{}, gcPolicy interface{}, allSourcesReady interface{}, evictNonDeletedPods interface{}) *MockRuntime_GarbageCollect_Call { - return &MockRuntime_GarbageCollect_Call{Call: _e.mock.On("GarbageCollect", ctx, gcPolicy, allSourcesReady, evictNonDeletedPods)} -} - -func (_c *MockRuntime_GarbageCollect_Call) Run(run func(ctx context.Context, gcPolicy container.GCPolicy, allSourcesReady bool, evictNonDeletedPods bool)) *MockRuntime_GarbageCollect_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(container.GCPolicy), args[2].(bool), args[3].(bool)) - }) - return _c -} - -func (_c *MockRuntime_GarbageCollect_Call) Return(_a0 error) *MockRuntime_GarbageCollect_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_GarbageCollect_Call) RunAndReturn(run func(context.Context, container.GCPolicy, bool, bool) error) *MockRuntime_GarbageCollect_Call { - _c.Call.Return(run) - return _c -} - -// GeneratePodStatus provides a mock function with given fields: event -func (_m *MockRuntime) GeneratePodStatus(event *v1.ContainerEventResponse) *container.PodStatus { - ret := _m.Called(event) - - if len(ret) == 0 { - panic("no return value specified for GeneratePodStatus") - } - - var r0 *container.PodStatus - if rf, ok := ret.Get(0).(func(*v1.ContainerEventResponse) *container.PodStatus); ok { - r0 = rf(event) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*container.PodStatus) - } - } - - return r0 -} - -// MockRuntime_GeneratePodStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GeneratePodStatus' -type MockRuntime_GeneratePodStatus_Call struct { - *mock.Call -} - -// GeneratePodStatus is a helper method to define mock.On call -// - event *v1.ContainerEventResponse -func (_e *MockRuntime_Expecter) GeneratePodStatus(event interface{}) *MockRuntime_GeneratePodStatus_Call { - return &MockRuntime_GeneratePodStatus_Call{Call: _e.mock.On("GeneratePodStatus", event)} -} - -func (_c *MockRuntime_GeneratePodStatus_Call) Run(run func(event *v1.ContainerEventResponse)) *MockRuntime_GeneratePodStatus_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*v1.ContainerEventResponse)) - }) - return _c -} - -func (_c *MockRuntime_GeneratePodStatus_Call) Return(_a0 *container.PodStatus) *MockRuntime_GeneratePodStatus_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_GeneratePodStatus_Call) RunAndReturn(run func(*v1.ContainerEventResponse) *container.PodStatus) *MockRuntime_GeneratePodStatus_Call { - _c.Call.Return(run) - return _c -} - -// GetContainerLogs provides a mock function with given fields: ctx, pod, containerID, logOptions, stdout, stderr -func (_m *MockRuntime) GetContainerLogs(ctx context.Context, pod *corev1.Pod, containerID container.ContainerID, logOptions *corev1.PodLogOptions, stdout io.Writer, stderr io.Writer) error { - ret := _m.Called(ctx, pod, containerID, logOptions, stdout, stderr) - - if len(ret) == 0 { - panic("no return value specified for GetContainerLogs") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *corev1.Pod, container.ContainerID, *corev1.PodLogOptions, io.Writer, io.Writer) error); ok { - r0 = rf(ctx, pod, containerID, logOptions, stdout, stderr) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRuntime_GetContainerLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContainerLogs' -type MockRuntime_GetContainerLogs_Call struct { - *mock.Call -} - -// GetContainerLogs is a helper method to define mock.On call -// - ctx context.Context -// - pod *corev1.Pod -// - containerID container.ContainerID -// - logOptions *corev1.PodLogOptions -// - stdout io.Writer -// - stderr io.Writer -func (_e *MockRuntime_Expecter) GetContainerLogs(ctx interface{}, pod interface{}, containerID interface{}, logOptions interface{}, stdout interface{}, stderr interface{}) *MockRuntime_GetContainerLogs_Call { - return &MockRuntime_GetContainerLogs_Call{Call: _e.mock.On("GetContainerLogs", ctx, pod, containerID, logOptions, stdout, stderr)} -} - -func (_c *MockRuntime_GetContainerLogs_Call) Run(run func(ctx context.Context, pod *corev1.Pod, containerID container.ContainerID, logOptions *corev1.PodLogOptions, stdout io.Writer, stderr io.Writer)) *MockRuntime_GetContainerLogs_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*corev1.Pod), args[2].(container.ContainerID), args[3].(*corev1.PodLogOptions), args[4].(io.Writer), args[5].(io.Writer)) - }) - return _c -} - -func (_c *MockRuntime_GetContainerLogs_Call) Return(err error) *MockRuntime_GetContainerLogs_Call { - _c.Call.Return(err) - return _c -} - -func (_c *MockRuntime_GetContainerLogs_Call) RunAndReturn(run func(context.Context, *corev1.Pod, container.ContainerID, *corev1.PodLogOptions, io.Writer, io.Writer) error) *MockRuntime_GetContainerLogs_Call { - _c.Call.Return(run) - return _c -} - -// GetContainerStatus provides a mock function with given fields: ctx, id -func (_m *MockRuntime) GetContainerStatus(ctx context.Context, id container.ContainerID) (*container.Status, error) { - ret := _m.Called(ctx, id) - - if len(ret) == 0 { - panic("no return value specified for GetContainerStatus") - } - - var r0 *container.Status - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, container.ContainerID) (*container.Status, error)); ok { - return rf(ctx, id) - } - if rf, ok := ret.Get(0).(func(context.Context, container.ContainerID) *container.Status); ok { - r0 = rf(ctx, id) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*container.Status) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, container.ContainerID) error); ok { - r1 = rf(ctx, id) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_GetContainerStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContainerStatus' -type MockRuntime_GetContainerStatus_Call struct { - *mock.Call -} - -// GetContainerStatus is a helper method to define mock.On call -// - ctx context.Context -// - id container.ContainerID -func (_e *MockRuntime_Expecter) GetContainerStatus(ctx interface{}, id interface{}) *MockRuntime_GetContainerStatus_Call { - return &MockRuntime_GetContainerStatus_Call{Call: _e.mock.On("GetContainerStatus", ctx, id)} -} - -func (_c *MockRuntime_GetContainerStatus_Call) Run(run func(ctx context.Context, id container.ContainerID)) *MockRuntime_GetContainerStatus_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(container.ContainerID)) - }) - return _c -} - -func (_c *MockRuntime_GetContainerStatus_Call) Return(_a0 *container.Status, _a1 error) *MockRuntime_GetContainerStatus_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_GetContainerStatus_Call) RunAndReturn(run func(context.Context, container.ContainerID) (*container.Status, error)) *MockRuntime_GetContainerStatus_Call { - _c.Call.Return(run) - return _c -} - -// GetContainerSwapBehavior provides a mock function with given fields: pod, _a1 -func (_m *MockRuntime) GetContainerSwapBehavior(pod *corev1.Pod, _a1 *corev1.Container) types.SwapBehavior { - ret := _m.Called(pod, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetContainerSwapBehavior") - } - - var r0 types.SwapBehavior - if rf, ok := ret.Get(0).(func(*corev1.Pod, *corev1.Container) types.SwapBehavior); ok { - r0 = rf(pod, _a1) - } else { - r0 = ret.Get(0).(types.SwapBehavior) - } - - return r0 -} - -// MockRuntime_GetContainerSwapBehavior_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContainerSwapBehavior' -type MockRuntime_GetContainerSwapBehavior_Call struct { - *mock.Call -} - -// GetContainerSwapBehavior is a helper method to define mock.On call -// - pod *corev1.Pod -// - _a1 *corev1.Container -func (_e *MockRuntime_Expecter) GetContainerSwapBehavior(pod interface{}, _a1 interface{}) *MockRuntime_GetContainerSwapBehavior_Call { - return &MockRuntime_GetContainerSwapBehavior_Call{Call: _e.mock.On("GetContainerSwapBehavior", pod, _a1)} -} - -func (_c *MockRuntime_GetContainerSwapBehavior_Call) Run(run func(pod *corev1.Pod, _a1 *corev1.Container)) *MockRuntime_GetContainerSwapBehavior_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*corev1.Pod), args[1].(*corev1.Container)) - }) - return _c -} - -func (_c *MockRuntime_GetContainerSwapBehavior_Call) Return(_a0 types.SwapBehavior) *MockRuntime_GetContainerSwapBehavior_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_GetContainerSwapBehavior_Call) RunAndReturn(run func(*corev1.Pod, *corev1.Container) types.SwapBehavior) *MockRuntime_GetContainerSwapBehavior_Call { - _c.Call.Return(run) - return _c -} - -// GetImageRef provides a mock function with given fields: ctx, image -func (_m *MockRuntime) GetImageRef(ctx context.Context, image container.ImageSpec) (string, error) { - ret := _m.Called(ctx, image) - - if len(ret) == 0 { - panic("no return value specified for GetImageRef") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, container.ImageSpec) (string, error)); ok { - return rf(ctx, image) - } - if rf, ok := ret.Get(0).(func(context.Context, container.ImageSpec) string); ok { - r0 = rf(ctx, image) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, container.ImageSpec) error); ok { - r1 = rf(ctx, image) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_GetImageRef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetImageRef' -type MockRuntime_GetImageRef_Call struct { - *mock.Call -} - -// GetImageRef is a helper method to define mock.On call -// - ctx context.Context -// - image container.ImageSpec -func (_e *MockRuntime_Expecter) GetImageRef(ctx interface{}, image interface{}) *MockRuntime_GetImageRef_Call { - return &MockRuntime_GetImageRef_Call{Call: _e.mock.On("GetImageRef", ctx, image)} -} - -func (_c *MockRuntime_GetImageRef_Call) Run(run func(ctx context.Context, image container.ImageSpec)) *MockRuntime_GetImageRef_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(container.ImageSpec)) - }) - return _c -} - -func (_c *MockRuntime_GetImageRef_Call) Return(_a0 string, _a1 error) *MockRuntime_GetImageRef_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_GetImageRef_Call) RunAndReturn(run func(context.Context, container.ImageSpec) (string, error)) *MockRuntime_GetImageRef_Call { - _c.Call.Return(run) - return _c -} - -// GetImageSize provides a mock function with given fields: ctx, image -func (_m *MockRuntime) GetImageSize(ctx context.Context, image container.ImageSpec) (uint64, error) { - ret := _m.Called(ctx, image) - - if len(ret) == 0 { - panic("no return value specified for GetImageSize") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, container.ImageSpec) (uint64, error)); ok { - return rf(ctx, image) - } - if rf, ok := ret.Get(0).(func(context.Context, container.ImageSpec) uint64); ok { - r0 = rf(ctx, image) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context, container.ImageSpec) error); ok { - r1 = rf(ctx, image) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_GetImageSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetImageSize' -type MockRuntime_GetImageSize_Call struct { - *mock.Call -} - -// GetImageSize is a helper method to define mock.On call -// - ctx context.Context -// - image container.ImageSpec -func (_e *MockRuntime_Expecter) GetImageSize(ctx interface{}, image interface{}) *MockRuntime_GetImageSize_Call { - return &MockRuntime_GetImageSize_Call{Call: _e.mock.On("GetImageSize", ctx, image)} -} - -func (_c *MockRuntime_GetImageSize_Call) Run(run func(ctx context.Context, image container.ImageSpec)) *MockRuntime_GetImageSize_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(container.ImageSpec)) - }) - return _c -} - -func (_c *MockRuntime_GetImageSize_Call) Return(_a0 uint64, _a1 error) *MockRuntime_GetImageSize_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_GetImageSize_Call) RunAndReturn(run func(context.Context, container.ImageSpec) (uint64, error)) *MockRuntime_GetImageSize_Call { - _c.Call.Return(run) - return _c -} - -// GetPodStatus provides a mock function with given fields: ctx, uid, name, namespace -func (_m *MockRuntime) GetPodStatus(ctx context.Context, uid pkgtypes.UID, name string, namespace string) (*container.PodStatus, error) { - ret := _m.Called(ctx, uid, name, namespace) - - if len(ret) == 0 { - panic("no return value specified for GetPodStatus") - } - - var r0 *container.PodStatus - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, pkgtypes.UID, string, string) (*container.PodStatus, error)); ok { - return rf(ctx, uid, name, namespace) - } - if rf, ok := ret.Get(0).(func(context.Context, pkgtypes.UID, string, string) *container.PodStatus); ok { - r0 = rf(ctx, uid, name, namespace) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*container.PodStatus) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, pkgtypes.UID, string, string) error); ok { - r1 = rf(ctx, uid, name, namespace) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_GetPodStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodStatus' -type MockRuntime_GetPodStatus_Call struct { - *mock.Call -} - -// GetPodStatus is a helper method to define mock.On call -// - ctx context.Context -// - uid pkgtypes.UID -// - name string -// - namespace string -func (_e *MockRuntime_Expecter) GetPodStatus(ctx interface{}, uid interface{}, name interface{}, namespace interface{}) *MockRuntime_GetPodStatus_Call { - return &MockRuntime_GetPodStatus_Call{Call: _e.mock.On("GetPodStatus", ctx, uid, name, namespace)} -} - -func (_c *MockRuntime_GetPodStatus_Call) Run(run func(ctx context.Context, uid pkgtypes.UID, name string, namespace string)) *MockRuntime_GetPodStatus_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(pkgtypes.UID), args[2].(string), args[3].(string)) - }) - return _c -} - -func (_c *MockRuntime_GetPodStatus_Call) Return(_a0 *container.PodStatus, _a1 error) *MockRuntime_GetPodStatus_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_GetPodStatus_Call) RunAndReturn(run func(context.Context, pkgtypes.UID, string, string) (*container.PodStatus, error)) *MockRuntime_GetPodStatus_Call { - _c.Call.Return(run) - return _c -} - -// GetPods provides a mock function with given fields: ctx, all -func (_m *MockRuntime) GetPods(ctx context.Context, all bool) ([]*container.Pod, error) { - ret := _m.Called(ctx, all) - - 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, bool) ([]*container.Pod, error)); ok { - return rf(ctx, all) - } - if rf, ok := ret.Get(0).(func(context.Context, bool) []*container.Pod); ok { - r0 = rf(ctx, all) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*container.Pod) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, bool) error); ok { - r1 = rf(ctx, all) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_GetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPods' -type MockRuntime_GetPods_Call struct { - *mock.Call -} - -// GetPods is a helper method to define mock.On call -// - ctx context.Context -// - all bool -func (_e *MockRuntime_Expecter) GetPods(ctx interface{}, all interface{}) *MockRuntime_GetPods_Call { - return &MockRuntime_GetPods_Call{Call: _e.mock.On("GetPods", ctx, all)} -} - -func (_c *MockRuntime_GetPods_Call) Run(run func(ctx context.Context, all bool)) *MockRuntime_GetPods_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(bool)) - }) - return _c -} - -func (_c *MockRuntime_GetPods_Call) Return(_a0 []*container.Pod, _a1 error) *MockRuntime_GetPods_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_GetPods_Call) RunAndReturn(run func(context.Context, bool) ([]*container.Pod, error)) *MockRuntime_GetPods_Call { - _c.Call.Return(run) - return _c -} - -// ImageFsInfo provides a mock function with given fields: ctx -func (_m *MockRuntime) ImageFsInfo(ctx context.Context) (*v1.ImageFsInfoResponse, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ImageFsInfo") - } - - var r0 *v1.ImageFsInfoResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*v1.ImageFsInfoResponse, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *v1.ImageFsInfoResponse); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ImageFsInfoResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_ImageFsInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageFsInfo' -type MockRuntime_ImageFsInfo_Call struct { - *mock.Call -} - -// ImageFsInfo is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockRuntime_Expecter) ImageFsInfo(ctx interface{}) *MockRuntime_ImageFsInfo_Call { - return &MockRuntime_ImageFsInfo_Call{Call: _e.mock.On("ImageFsInfo", ctx)} -} - -func (_c *MockRuntime_ImageFsInfo_Call) Run(run func(ctx context.Context)) *MockRuntime_ImageFsInfo_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockRuntime_ImageFsInfo_Call) Return(_a0 *v1.ImageFsInfoResponse, _a1 error) *MockRuntime_ImageFsInfo_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_ImageFsInfo_Call) RunAndReturn(run func(context.Context) (*v1.ImageFsInfoResponse, error)) *MockRuntime_ImageFsInfo_Call { - _c.Call.Return(run) - return _c -} - -// ImageStats provides a mock function with given fields: ctx -func (_m *MockRuntime) ImageStats(ctx context.Context) (*container.ImageStats, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ImageStats") - } - - var r0 *container.ImageStats - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*container.ImageStats, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *container.ImageStats); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*container.ImageStats) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_ImageStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageStats' -type MockRuntime_ImageStats_Call struct { - *mock.Call -} - -// ImageStats is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockRuntime_Expecter) ImageStats(ctx interface{}) *MockRuntime_ImageStats_Call { - return &MockRuntime_ImageStats_Call{Call: _e.mock.On("ImageStats", ctx)} -} - -func (_c *MockRuntime_ImageStats_Call) Run(run func(ctx context.Context)) *MockRuntime_ImageStats_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockRuntime_ImageStats_Call) Return(_a0 *container.ImageStats, _a1 error) *MockRuntime_ImageStats_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_ImageStats_Call) RunAndReturn(run func(context.Context) (*container.ImageStats, error)) *MockRuntime_ImageStats_Call { - _c.Call.Return(run) - return _c -} - -// KillPod provides a mock function with given fields: ctx, pod, runningPod, gracePeriodOverride -func (_m *MockRuntime) KillPod(ctx context.Context, pod *corev1.Pod, runningPod container.Pod, gracePeriodOverride *int64) error { - ret := _m.Called(ctx, pod, runningPod, gracePeriodOverride) - - if len(ret) == 0 { - panic("no return value specified for KillPod") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *corev1.Pod, container.Pod, *int64) error); ok { - r0 = rf(ctx, pod, runningPod, gracePeriodOverride) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRuntime_KillPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KillPod' -type MockRuntime_KillPod_Call struct { - *mock.Call -} - -// KillPod is a helper method to define mock.On call -// - ctx context.Context -// - pod *corev1.Pod -// - runningPod container.Pod -// - gracePeriodOverride *int64 -func (_e *MockRuntime_Expecter) KillPod(ctx interface{}, pod interface{}, runningPod interface{}, gracePeriodOverride interface{}) *MockRuntime_KillPod_Call { - return &MockRuntime_KillPod_Call{Call: _e.mock.On("KillPod", ctx, pod, runningPod, gracePeriodOverride)} -} - -func (_c *MockRuntime_KillPod_Call) Run(run func(ctx context.Context, pod *corev1.Pod, runningPod container.Pod, gracePeriodOverride *int64)) *MockRuntime_KillPod_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*corev1.Pod), args[2].(container.Pod), args[3].(*int64)) - }) - return _c -} - -func (_c *MockRuntime_KillPod_Call) Return(_a0 error) *MockRuntime_KillPod_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_KillPod_Call) RunAndReturn(run func(context.Context, *corev1.Pod, container.Pod, *int64) error) *MockRuntime_KillPod_Call { - _c.Call.Return(run) - return _c -} - -// ListImages provides a mock function with given fields: ctx -func (_m *MockRuntime) ListImages(ctx context.Context) ([]container.Image, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ListImages") - } - - var r0 []container.Image - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]container.Image, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []container.Image); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]container.Image) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_ListImages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListImages' -type MockRuntime_ListImages_Call struct { - *mock.Call -} - -// ListImages is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockRuntime_Expecter) ListImages(ctx interface{}) *MockRuntime_ListImages_Call { - return &MockRuntime_ListImages_Call{Call: _e.mock.On("ListImages", ctx)} -} - -func (_c *MockRuntime_ListImages_Call) Run(run func(ctx context.Context)) *MockRuntime_ListImages_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockRuntime_ListImages_Call) Return(_a0 []container.Image, _a1 error) *MockRuntime_ListImages_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_ListImages_Call) RunAndReturn(run func(context.Context) ([]container.Image, error)) *MockRuntime_ListImages_Call { - _c.Call.Return(run) - return _c -} - -// ListMetricDescriptors provides a mock function with given fields: ctx -func (_m *MockRuntime) ListMetricDescriptors(ctx context.Context) ([]*v1.MetricDescriptor, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ListMetricDescriptors") - } - - var r0 []*v1.MetricDescriptor - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]*v1.MetricDescriptor, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []*v1.MetricDescriptor); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*v1.MetricDescriptor) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_ListMetricDescriptors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListMetricDescriptors' -type MockRuntime_ListMetricDescriptors_Call struct { - *mock.Call -} - -// ListMetricDescriptors is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockRuntime_Expecter) ListMetricDescriptors(ctx interface{}) *MockRuntime_ListMetricDescriptors_Call { - return &MockRuntime_ListMetricDescriptors_Call{Call: _e.mock.On("ListMetricDescriptors", ctx)} -} - -func (_c *MockRuntime_ListMetricDescriptors_Call) Run(run func(ctx context.Context)) *MockRuntime_ListMetricDescriptors_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockRuntime_ListMetricDescriptors_Call) Return(_a0 []*v1.MetricDescriptor, _a1 error) *MockRuntime_ListMetricDescriptors_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_ListMetricDescriptors_Call) RunAndReturn(run func(context.Context) ([]*v1.MetricDescriptor, error)) *MockRuntime_ListMetricDescriptors_Call { - _c.Call.Return(run) - return _c -} - -// ListPodSandboxMetrics provides a mock function with given fields: ctx -func (_m *MockRuntime) ListPodSandboxMetrics(ctx context.Context) ([]*v1.PodSandboxMetrics, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ListPodSandboxMetrics") - } - - var r0 []*v1.PodSandboxMetrics - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]*v1.PodSandboxMetrics, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []*v1.PodSandboxMetrics); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*v1.PodSandboxMetrics) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_ListPodSandboxMetrics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPodSandboxMetrics' -type MockRuntime_ListPodSandboxMetrics_Call struct { - *mock.Call -} - -// ListPodSandboxMetrics is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockRuntime_Expecter) ListPodSandboxMetrics(ctx interface{}) *MockRuntime_ListPodSandboxMetrics_Call { - return &MockRuntime_ListPodSandboxMetrics_Call{Call: _e.mock.On("ListPodSandboxMetrics", ctx)} -} - -func (_c *MockRuntime_ListPodSandboxMetrics_Call) Run(run func(ctx context.Context)) *MockRuntime_ListPodSandboxMetrics_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockRuntime_ListPodSandboxMetrics_Call) Return(_a0 []*v1.PodSandboxMetrics, _a1 error) *MockRuntime_ListPodSandboxMetrics_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_ListPodSandboxMetrics_Call) RunAndReturn(run func(context.Context) ([]*v1.PodSandboxMetrics, error)) *MockRuntime_ListPodSandboxMetrics_Call { - _c.Call.Return(run) - return _c -} - -// PullImage provides a mock function with given fields: ctx, image, credentials, podSandboxConfig -func (_m *MockRuntime) PullImage(ctx context.Context, image container.ImageSpec, credentials []credentialprovider.TrackedAuthConfig, podSandboxConfig *v1.PodSandboxConfig) (string, *credentialprovider.TrackedAuthConfig, error) { - ret := _m.Called(ctx, image, credentials, podSandboxConfig) - - if len(ret) == 0 { - panic("no return value specified for PullImage") - } - - var r0 string - var r1 *credentialprovider.TrackedAuthConfig - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) (string, *credentialprovider.TrackedAuthConfig, error)); ok { - return rf(ctx, image, credentials, podSandboxConfig) - } - if rf, ok := ret.Get(0).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) string); ok { - r0 = rf(ctx, image, credentials, podSandboxConfig) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) *credentialprovider.TrackedAuthConfig); ok { - r1 = rf(ctx, image, credentials, podSandboxConfig) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*credentialprovider.TrackedAuthConfig) - } - } - - if rf, ok := ret.Get(2).(func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) error); ok { - r2 = rf(ctx, image, credentials, podSandboxConfig) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// MockRuntime_PullImage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PullImage' -type MockRuntime_PullImage_Call struct { - *mock.Call -} - -// PullImage is a helper method to define mock.On call -// - ctx context.Context -// - image container.ImageSpec -// - credentials []credentialprovider.TrackedAuthConfig -// - podSandboxConfig *v1.PodSandboxConfig -func (_e *MockRuntime_Expecter) PullImage(ctx interface{}, image interface{}, credentials interface{}, podSandboxConfig interface{}) *MockRuntime_PullImage_Call { - return &MockRuntime_PullImage_Call{Call: _e.mock.On("PullImage", ctx, image, credentials, podSandboxConfig)} -} - -func (_c *MockRuntime_PullImage_Call) Run(run func(ctx context.Context, image container.ImageSpec, credentials []credentialprovider.TrackedAuthConfig, podSandboxConfig *v1.PodSandboxConfig)) *MockRuntime_PullImage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(container.ImageSpec), args[2].([]credentialprovider.TrackedAuthConfig), args[3].(*v1.PodSandboxConfig)) - }) - return _c -} - -func (_c *MockRuntime_PullImage_Call) Return(_a0 string, _a1 *credentialprovider.TrackedAuthConfig, _a2 error) *MockRuntime_PullImage_Call { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *MockRuntime_PullImage_Call) RunAndReturn(run func(context.Context, container.ImageSpec, []credentialprovider.TrackedAuthConfig, *v1.PodSandboxConfig) (string, *credentialprovider.TrackedAuthConfig, error)) *MockRuntime_PullImage_Call { - _c.Call.Return(run) - return _c -} - -// RemoveImage provides a mock function with given fields: ctx, image -func (_m *MockRuntime) RemoveImage(ctx context.Context, image container.ImageSpec) error { - ret := _m.Called(ctx, image) - - if len(ret) == 0 { - panic("no return value specified for RemoveImage") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, container.ImageSpec) error); ok { - r0 = rf(ctx, image) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRuntime_RemoveImage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveImage' -type MockRuntime_RemoveImage_Call struct { - *mock.Call -} - -// RemoveImage is a helper method to define mock.On call -// - ctx context.Context -// - image container.ImageSpec -func (_e *MockRuntime_Expecter) RemoveImage(ctx interface{}, image interface{}) *MockRuntime_RemoveImage_Call { - return &MockRuntime_RemoveImage_Call{Call: _e.mock.On("RemoveImage", ctx, image)} -} - -func (_c *MockRuntime_RemoveImage_Call) Run(run func(ctx context.Context, image container.ImageSpec)) *MockRuntime_RemoveImage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(container.ImageSpec)) - }) - return _c -} - -func (_c *MockRuntime_RemoveImage_Call) Return(_a0 error) *MockRuntime_RemoveImage_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_RemoveImage_Call) RunAndReturn(run func(context.Context, container.ImageSpec) error) *MockRuntime_RemoveImage_Call { - _c.Call.Return(run) - return _c -} - -// Status provides a mock function with given fields: ctx -func (_m *MockRuntime) Status(ctx context.Context) (*container.RuntimeStatus, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for Status") - } - - var r0 *container.RuntimeStatus - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*container.RuntimeStatus, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *container.RuntimeStatus); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*container.RuntimeStatus) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' -type MockRuntime_Status_Call struct { - *mock.Call -} - -// Status is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockRuntime_Expecter) Status(ctx interface{}) *MockRuntime_Status_Call { - return &MockRuntime_Status_Call{Call: _e.mock.On("Status", ctx)} -} - -func (_c *MockRuntime_Status_Call) Run(run func(ctx context.Context)) *MockRuntime_Status_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockRuntime_Status_Call) Return(_a0 *container.RuntimeStatus, _a1 error) *MockRuntime_Status_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_Status_Call) RunAndReturn(run func(context.Context) (*container.RuntimeStatus, error)) *MockRuntime_Status_Call { - _c.Call.Return(run) - return _c -} - -// SyncPod provides a mock function with given fields: ctx, pod, podStatus, pullSecrets, backOff -func (_m *MockRuntime) SyncPod(ctx context.Context, pod *corev1.Pod, podStatus *container.PodStatus, pullSecrets []corev1.Secret, backOff *flowcontrol.Backoff) container.PodSyncResult { - ret := _m.Called(ctx, pod, podStatus, pullSecrets, backOff) - - if len(ret) == 0 { - panic("no return value specified for SyncPod") - } - - var r0 container.PodSyncResult - if rf, ok := ret.Get(0).(func(context.Context, *corev1.Pod, *container.PodStatus, []corev1.Secret, *flowcontrol.Backoff) container.PodSyncResult); ok { - r0 = rf(ctx, pod, podStatus, pullSecrets, backOff) - } else { - r0 = ret.Get(0).(container.PodSyncResult) - } - - return r0 -} - -// MockRuntime_SyncPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncPod' -type MockRuntime_SyncPod_Call struct { - *mock.Call -} - -// SyncPod is a helper method to define mock.On call -// - ctx context.Context -// - pod *corev1.Pod -// - podStatus *container.PodStatus -// - pullSecrets []corev1.Secret -// - backOff *flowcontrol.Backoff -func (_e *MockRuntime_Expecter) SyncPod(ctx interface{}, pod interface{}, podStatus interface{}, pullSecrets interface{}, backOff interface{}) *MockRuntime_SyncPod_Call { - return &MockRuntime_SyncPod_Call{Call: _e.mock.On("SyncPod", ctx, pod, podStatus, pullSecrets, backOff)} -} - -func (_c *MockRuntime_SyncPod_Call) Run(run func(ctx context.Context, pod *corev1.Pod, podStatus *container.PodStatus, pullSecrets []corev1.Secret, backOff *flowcontrol.Backoff)) *MockRuntime_SyncPod_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*corev1.Pod), args[2].(*container.PodStatus), args[3].([]corev1.Secret), args[4].(*flowcontrol.Backoff)) - }) - return _c -} - -func (_c *MockRuntime_SyncPod_Call) Return(_a0 container.PodSyncResult) *MockRuntime_SyncPod_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_SyncPod_Call) RunAndReturn(run func(context.Context, *corev1.Pod, *container.PodStatus, []corev1.Secret, *flowcontrol.Backoff) container.PodSyncResult) *MockRuntime_SyncPod_Call { - _c.Call.Return(run) - return _c -} - -// Type provides a mock function with no fields -func (_m *MockRuntime) Type() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Type") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// MockRuntime_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' -type MockRuntime_Type_Call struct { - *mock.Call -} - -// Type is a helper method to define mock.On call -func (_e *MockRuntime_Expecter) Type() *MockRuntime_Type_Call { - return &MockRuntime_Type_Call{Call: _e.mock.On("Type")} -} - -func (_c *MockRuntime_Type_Call) Run(run func()) *MockRuntime_Type_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockRuntime_Type_Call) Return(_a0 string) *MockRuntime_Type_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_Type_Call) RunAndReturn(run func() string) *MockRuntime_Type_Call { - _c.Call.Return(run) - return _c -} - -// UpdatePodCIDR provides a mock function with given fields: ctx, podCIDR -func (_m *MockRuntime) UpdatePodCIDR(ctx context.Context, podCIDR string) error { - ret := _m.Called(ctx, podCIDR) - - if len(ret) == 0 { - panic("no return value specified for UpdatePodCIDR") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, podCIDR) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockRuntime_UpdatePodCIDR_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePodCIDR' -type MockRuntime_UpdatePodCIDR_Call struct { - *mock.Call -} - -// UpdatePodCIDR is a helper method to define mock.On call -// - ctx context.Context -// - podCIDR string -func (_e *MockRuntime_Expecter) UpdatePodCIDR(ctx interface{}, podCIDR interface{}) *MockRuntime_UpdatePodCIDR_Call { - return &MockRuntime_UpdatePodCIDR_Call{Call: _e.mock.On("UpdatePodCIDR", ctx, podCIDR)} -} - -func (_c *MockRuntime_UpdatePodCIDR_Call) Run(run func(ctx context.Context, podCIDR string)) *MockRuntime_UpdatePodCIDR_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockRuntime_UpdatePodCIDR_Call) Return(_a0 error) *MockRuntime_UpdatePodCIDR_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockRuntime_UpdatePodCIDR_Call) RunAndReturn(run func(context.Context, string) error) *MockRuntime_UpdatePodCIDR_Call { - _c.Call.Return(run) - return _c -} - -// Version provides a mock function with given fields: ctx -func (_m *MockRuntime) Version(ctx context.Context) (container.Version, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for Version") - } - - var r0 container.Version - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (container.Version, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) container.Version); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(container.Version) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockRuntime_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' -type MockRuntime_Version_Call struct { - *mock.Call -} - -// Version is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockRuntime_Expecter) Version(ctx interface{}) *MockRuntime_Version_Call { - return &MockRuntime_Version_Call{Call: _e.mock.On("Version", ctx)} -} - -func (_c *MockRuntime_Version_Call) Run(run func(ctx context.Context)) *MockRuntime_Version_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockRuntime_Version_Call) Return(_a0 container.Version, _a1 error) *MockRuntime_Version_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockRuntime_Version_Call) RunAndReturn(run func(context.Context) (container.Version, error)) *MockRuntime_Version_Call { - _c.Call.Return(run) - return _c -} - -// NewMockRuntime creates a new instance of MockRuntime. 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 NewMockRuntime(t interface { - mock.TestingT - Cleanup(func()) -}) *MockRuntime { - mock := &MockRuntime{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/kubelet/eviction/.mockery.yaml b/pkg/kubelet/eviction/.mockery.yaml index e179b752c1d..2e8830bc17d 100644 --- a/pkg/kubelet/eviction/.mockery.yaml +++ b/pkg/kubelet/eviction/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/eviction/mock_cgroup_notifier_test.go b/pkg/kubelet/eviction/mock_cgroup_notifier_test.go deleted file mode 100644 index 618fff9951c..00000000000 --- a/pkg/kubelet/eviction/mock_cgroup_notifier_test.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/eviction/mock_notifier_factory_test.go b/pkg/kubelet/eviction/mock_notifier_factory_test.go deleted file mode 100644 index 4e27024ba2a..00000000000 --- a/pkg/kubelet/eviction/mock_notifier_factory_test.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/eviction/mock_threshold_notifier_test.go b/pkg/kubelet/eviction/mock_threshold_notifier_test.go deleted file mode 100644 index 0b2f13d5ed6..00000000000 --- a/pkg/kubelet/eviction/mock_threshold_notifier_test.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/eviction/mocks_test.go b/pkg/kubelet/eviction/mocks_test.go new file mode 100644 index 00000000000..3ef5383835b --- /dev/null +++ b/pkg/kubelet/eviction/mocks_test.go @@ -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 +} diff --git a/pkg/kubelet/pod/.mockery.yaml b/pkg/kubelet/pod/.mockery.yaml index 3a60e89a749..f450628a6c9 100644 --- a/pkg/kubelet/pod/.mockery.yaml +++ b/pkg/kubelet/pod/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/pod/testing/mock_manager.go b/pkg/kubelet/pod/testing/mocks.go similarity index 57% rename from pkg/kubelet/pod/testing/mock_manager.go rename to pkg/kubelet/pod/testing/mocks.go index a12a6eeff9a..b08370f5b9e 100644 --- a/pkg/kubelet/pod/testing/mock_manager.go +++ b/pkg/kubelet/pod/testing/mocks.go @@ -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 -} diff --git a/pkg/kubelet/server/stats/.mockery.yaml b/pkg/kubelet/server/stats/.mockery.yaml index f419d6d8c5c..48e361a7d47 100644 --- a/pkg/kubelet/server/stats/.mockery.yaml +++ b/pkg/kubelet/server/stats/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/server/stats/testing/mock_summary_provider.go b/pkg/kubelet/server/stats/testing/mock_summary_provider.go deleted file mode 100644 index 3a39a51e9ee..00000000000 --- a/pkg/kubelet/server/stats/testing/mock_summary_provider.go +++ /dev/null @@ -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 -} diff --git a/pkg/kubelet/server/stats/testing/mock_stats_provider.go b/pkg/kubelet/server/stats/testing/mocks.go similarity index 51% rename from pkg/kubelet/server/stats/testing/mock_stats_provider.go rename to pkg/kubelet/server/stats/testing/mocks.go index b3c94442f67..f1742d3ca6d 100644 --- a/pkg/kubelet/server/stats/testing/mock_stats_provider.go +++ b/pkg/kubelet/server/stats/testing/mocks.go @@ -14,30 +14,39 @@ 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" - - cm "k8s.io/kubernetes/pkg/kubelet/cm" - - infov1 "github.com/google/cadvisor/info/v1" + "context" + v10 "github.com/google/cadvisor/info/v1" + "github.com/google/cadvisor/info/v2" mock "github.com/stretchr/testify/mock" - - types "k8s.io/apimachinery/pkg/types" - - v1 "k8s.io/api/core/v1" - - v1alpha1 "k8s.io/kubelet/pkg/apis/stats/v1alpha1" - - v2 "github.com/google/cadvisor/info/v2" - - volume "k8s.io/kubernetes/pkg/volume" + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/kubelet/pkg/apis/stats/v1alpha1" + "k8s.io/kubernetes/pkg/kubelet/cm" + "k8s.io/kubernetes/pkg/volume" ) +// NewMockProvider creates a new instance of MockProvider. 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 NewMockProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProvider { + mock := &MockProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // MockProvider is an autogenerated mock type for the Provider type type MockProvider struct { mock.Mock @@ -51,9 +60,9 @@ func (_m *MockProvider) EXPECT() *MockProvider_Expecter { return &MockProvider_Expecter{mock: &_m.Mock} } -// GetCgroupCPUAndMemoryStats provides a mock function with given fields: cgroupName, updateStats -func (_m *MockProvider) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*v1alpha1.ContainerStats, error) { - ret := _m.Called(cgroupName, updateStats) +// GetCgroupCPUAndMemoryStats provides a mock function for the type MockProvider +func (_mock *MockProvider) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*v1alpha1.ContainerStats, error) { + ret := _mock.Called(cgroupName, updateStats) if len(ret) == 0 { panic("no return value specified for GetCgroupCPUAndMemoryStats") @@ -61,23 +70,21 @@ func (_m *MockProvider) GetCgroupCPUAndMemoryStats(cgroupName string, updateStat var r0 *v1alpha1.ContainerStats var r1 error - if rf, ok := ret.Get(0).(func(string, bool) (*v1alpha1.ContainerStats, error)); ok { - return rf(cgroupName, updateStats) + if returnFunc, ok := ret.Get(0).(func(string, bool) (*v1alpha1.ContainerStats, error)); ok { + return returnFunc(cgroupName, updateStats) } - if rf, ok := ret.Get(0).(func(string, bool) *v1alpha1.ContainerStats); ok { - r0 = rf(cgroupName, updateStats) + if returnFunc, ok := ret.Get(0).(func(string, bool) *v1alpha1.ContainerStats); ok { + r0 = returnFunc(cgroupName, updateStats) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.ContainerStats) } } - - if rf, ok := ret.Get(1).(func(string, bool) error); ok { - r1 = rf(cgroupName, updateStats) + if returnFunc, ok := ret.Get(1).(func(string, bool) error); ok { + r1 = returnFunc(cgroupName, updateStats) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -95,24 +102,35 @@ func (_e *MockProvider_Expecter) GetCgroupCPUAndMemoryStats(cgroupName interface func (_c *MockProvider_GetCgroupCPUAndMemoryStats_Call) Run(run func(cgroupName string, updateStats bool)) *MockProvider_GetCgroupCPUAndMemoryStats_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(bool)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *MockProvider_GetCgroupCPUAndMemoryStats_Call) Return(_a0 *v1alpha1.ContainerStats, _a1 error) *MockProvider_GetCgroupCPUAndMemoryStats_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_GetCgroupCPUAndMemoryStats_Call) Return(containerStats *v1alpha1.ContainerStats, err error) *MockProvider_GetCgroupCPUAndMemoryStats_Call { + _c.Call.Return(containerStats, err) return _c } -func (_c *MockProvider_GetCgroupCPUAndMemoryStats_Call) RunAndReturn(run func(string, bool) (*v1alpha1.ContainerStats, error)) *MockProvider_GetCgroupCPUAndMemoryStats_Call { +func (_c *MockProvider_GetCgroupCPUAndMemoryStats_Call) RunAndReturn(run func(cgroupName string, updateStats bool) (*v1alpha1.ContainerStats, error)) *MockProvider_GetCgroupCPUAndMemoryStats_Call { _c.Call.Return(run) return _c } -// GetCgroupStats provides a mock function with given fields: cgroupName, updateStats -func (_m *MockProvider) GetCgroupStats(cgroupName string, updateStats bool) (*v1alpha1.ContainerStats, *v1alpha1.NetworkStats, error) { - ret := _m.Called(cgroupName, updateStats) +// GetCgroupStats provides a mock function for the type MockProvider +func (_mock *MockProvider) GetCgroupStats(cgroupName string, updateStats bool) (*v1alpha1.ContainerStats, *v1alpha1.NetworkStats, error) { + ret := _mock.Called(cgroupName, updateStats) if len(ret) == 0 { panic("no return value specified for GetCgroupStats") @@ -121,31 +139,28 @@ func (_m *MockProvider) GetCgroupStats(cgroupName string, updateStats bool) (*v1 var r0 *v1alpha1.ContainerStats var r1 *v1alpha1.NetworkStats var r2 error - if rf, ok := ret.Get(0).(func(string, bool) (*v1alpha1.ContainerStats, *v1alpha1.NetworkStats, error)); ok { - return rf(cgroupName, updateStats) + if returnFunc, ok := ret.Get(0).(func(string, bool) (*v1alpha1.ContainerStats, *v1alpha1.NetworkStats, error)); ok { + return returnFunc(cgroupName, updateStats) } - if rf, ok := ret.Get(0).(func(string, bool) *v1alpha1.ContainerStats); ok { - r0 = rf(cgroupName, updateStats) + if returnFunc, ok := ret.Get(0).(func(string, bool) *v1alpha1.ContainerStats); ok { + r0 = returnFunc(cgroupName, updateStats) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.ContainerStats) } } - - if rf, ok := ret.Get(1).(func(string, bool) *v1alpha1.NetworkStats); ok { - r1 = rf(cgroupName, updateStats) + if returnFunc, ok := ret.Get(1).(func(string, bool) *v1alpha1.NetworkStats); ok { + r1 = returnFunc(cgroupName, updateStats) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(*v1alpha1.NetworkStats) } } - - if rf, ok := ret.Get(2).(func(string, bool) error); ok { - r2 = rf(cgroupName, updateStats) + if returnFunc, ok := ret.Get(2).(func(string, bool) error); ok { + r2 = returnFunc(cgroupName, updateStats) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -163,24 +178,35 @@ func (_e *MockProvider_Expecter) GetCgroupStats(cgroupName interface{}, updateSt func (_c *MockProvider_GetCgroupStats_Call) Run(run func(cgroupName string, updateStats bool)) *MockProvider_GetCgroupStats_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(bool)) + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *MockProvider_GetCgroupStats_Call) Return(_a0 *v1alpha1.ContainerStats, _a1 *v1alpha1.NetworkStats, _a2 error) *MockProvider_GetCgroupStats_Call { - _c.Call.Return(_a0, _a1, _a2) +func (_c *MockProvider_GetCgroupStats_Call) Return(containerStats *v1alpha1.ContainerStats, networkStats *v1alpha1.NetworkStats, err error) *MockProvider_GetCgroupStats_Call { + _c.Call.Return(containerStats, networkStats, err) return _c } -func (_c *MockProvider_GetCgroupStats_Call) RunAndReturn(run func(string, bool) (*v1alpha1.ContainerStats, *v1alpha1.NetworkStats, error)) *MockProvider_GetCgroupStats_Call { +func (_c *MockProvider_GetCgroupStats_Call) RunAndReturn(run func(cgroupName string, updateStats bool) (*v1alpha1.ContainerStats, *v1alpha1.NetworkStats, error)) *MockProvider_GetCgroupStats_Call { _c.Call.Return(run) return _c } -// GetNode provides a mock function with no fields -func (_m *MockProvider) GetNode() (*v1.Node, error) { - ret := _m.Called() +// GetNode provides a mock function for the type MockProvider +func (_mock *MockProvider) GetNode() (*v1.Node, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetNode") @@ -188,23 +214,21 @@ func (_m *MockProvider) GetNode() (*v1.Node, error) { var r0 *v1.Node var r1 error - if rf, ok := ret.Get(0).(func() (*v1.Node, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (*v1.Node, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() *v1.Node); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *v1.Node); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1.Node) } } - - 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 } @@ -225,8 +249,8 @@ func (_c *MockProvider_GetNode_Call) Run(run func()) *MockProvider_GetNode_Call return _c } -func (_c *MockProvider_GetNode_Call) Return(_a0 *v1.Node, _a1 error) *MockProvider_GetNode_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_GetNode_Call) Return(node *v1.Node, err error) *MockProvider_GetNode_Call { + _c.Call.Return(node, err) return _c } @@ -235,21 +259,20 @@ func (_c *MockProvider_GetNode_Call) RunAndReturn(run func() (*v1.Node, error)) return _c } -// GetNodeConfig provides a mock function with no fields -func (_m *MockProvider) GetNodeConfig() cm.NodeConfig { - ret := _m.Called() +// GetNodeConfig provides a mock function for the type MockProvider +func (_mock *MockProvider) GetNodeConfig() cm.NodeConfig { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetNodeConfig") } var r0 cm.NodeConfig - if rf, ok := ret.Get(0).(func() cm.NodeConfig); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() cm.NodeConfig); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(cm.NodeConfig) } - return r0 } @@ -270,8 +293,8 @@ func (_c *MockProvider_GetNodeConfig_Call) Run(run func()) *MockProvider_GetNode return _c } -func (_c *MockProvider_GetNodeConfig_Call) Return(_a0 cm.NodeConfig) *MockProvider_GetNodeConfig_Call { - _c.Call.Return(_a0) +func (_c *MockProvider_GetNodeConfig_Call) Return(nodeConfig cm.NodeConfig) *MockProvider_GetNodeConfig_Call { + _c.Call.Return(nodeConfig) return _c } @@ -280,9 +303,9 @@ func (_c *MockProvider_GetNodeConfig_Call) RunAndReturn(run func() cm.NodeConfig return _c } -// GetPodByCgroupfs provides a mock function with given fields: cgroupfs -func (_m *MockProvider) GetPodByCgroupfs(cgroupfs string) (*v1.Pod, bool) { - ret := _m.Called(cgroupfs) +// GetPodByCgroupfs provides a mock function for the type MockProvider +func (_mock *MockProvider) GetPodByCgroupfs(cgroupfs string) (*v1.Pod, bool) { + ret := _mock.Called(cgroupfs) if len(ret) == 0 { panic("no return value specified for GetPodByCgroupfs") @@ -290,23 +313,21 @@ func (_m *MockProvider) GetPodByCgroupfs(cgroupfs 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(cgroupfs) + if returnFunc, ok := ret.Get(0).(func(string) (*v1.Pod, bool)); ok { + return returnFunc(cgroupfs) } - if rf, ok := ret.Get(0).(func(string) *v1.Pod); ok { - r0 = rf(cgroupfs) + if returnFunc, ok := ret.Get(0).(func(string) *v1.Pod); ok { + r0 = returnFunc(cgroupfs) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1.Pod) } } - - if rf, ok := ret.Get(1).(func(string) bool); ok { - r1 = rf(cgroupfs) + if returnFunc, ok := ret.Get(1).(func(string) bool); ok { + r1 = returnFunc(cgroupfs) } else { r1 = ret.Get(1).(bool) } - return r0, r1 } @@ -323,24 +344,30 @@ func (_e *MockProvider_Expecter) GetPodByCgroupfs(cgroupfs interface{}) *MockPro func (_c *MockProvider_GetPodByCgroupfs_Call) Run(run func(cgroupfs string)) *MockProvider_GetPodByCgroupfs_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 *MockProvider_GetPodByCgroupfs_Call) Return(_a0 *v1.Pod, _a1 bool) *MockProvider_GetPodByCgroupfs_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_GetPodByCgroupfs_Call) Return(pod *v1.Pod, b bool) *MockProvider_GetPodByCgroupfs_Call { + _c.Call.Return(pod, b) return _c } -func (_c *MockProvider_GetPodByCgroupfs_Call) RunAndReturn(run func(string) (*v1.Pod, bool)) *MockProvider_GetPodByCgroupfs_Call { +func (_c *MockProvider_GetPodByCgroupfs_Call) RunAndReturn(run func(cgroupfs string) (*v1.Pod, bool)) *MockProvider_GetPodByCgroupfs_Call { _c.Call.Return(run) return _c } -// GetPodByName provides a mock function with given fields: namespace, name -func (_m *MockProvider) GetPodByName(namespace string, name string) (*v1.Pod, bool) { - ret := _m.Called(namespace, name) +// GetPodByName provides a mock function for the type MockProvider +func (_mock *MockProvider) GetPodByName(namespace string, name string) (*v1.Pod, bool) { + ret := _mock.Called(namespace, name) if len(ret) == 0 { panic("no return value specified for GetPodByName") @@ -348,23 +375,21 @@ func (_m *MockProvider) GetPodByName(namespace string, name string) (*v1.Pod, bo 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 } @@ -382,36 +407,46 @@ func (_e *MockProvider_Expecter) GetPodByName(namespace interface{}, name interf func (_c *MockProvider_GetPodByName_Call) Run(run func(namespace string, name string)) *MockProvider_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 *MockProvider_GetPodByName_Call) Return(_a0 *v1.Pod, _a1 bool) *MockProvider_GetPodByName_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_GetPodByName_Call) Return(pod *v1.Pod, b bool) *MockProvider_GetPodByName_Call { + _c.Call.Return(pod, b) return _c } -func (_c *MockProvider_GetPodByName_Call) RunAndReturn(run func(string, string) (*v1.Pod, bool)) *MockProvider_GetPodByName_Call { +func (_c *MockProvider_GetPodByName_Call) RunAndReturn(run func(namespace string, name string) (*v1.Pod, bool)) *MockProvider_GetPodByName_Call { _c.Call.Return(run) return _c } -// GetPodCgroupRoot provides a mock function with no fields -func (_m *MockProvider) GetPodCgroupRoot() string { - ret := _m.Called() +// GetPodCgroupRoot provides a mock function for the type MockProvider +func (_mock *MockProvider) GetPodCgroupRoot() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetPodCgroupRoot") } 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 } @@ -432,8 +467,8 @@ func (_c *MockProvider_GetPodCgroupRoot_Call) Run(run func()) *MockProvider_GetP return _c } -func (_c *MockProvider_GetPodCgroupRoot_Call) Return(_a0 string) *MockProvider_GetPodCgroupRoot_Call { - _c.Call.Return(_a0) +func (_c *MockProvider_GetPodCgroupRoot_Call) Return(s string) *MockProvider_GetPodCgroupRoot_Call { + _c.Call.Return(s) return _c } @@ -442,23 +477,22 @@ func (_c *MockProvider_GetPodCgroupRoot_Call) RunAndReturn(run func() string) *M return _c } -// GetPods provides a mock function with no fields -func (_m *MockProvider) GetPods() []*v1.Pod { - ret := _m.Called() +// GetPods provides a mock function for the type MockProvider +func (_mock *MockProvider) 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 } @@ -479,8 +513,8 @@ func (_c *MockProvider_GetPods_Call) Run(run func()) *MockProvider_GetPods_Call return _c } -func (_c *MockProvider_GetPods_Call) Return(_a0 []*v1.Pod) *MockProvider_GetPods_Call { - _c.Call.Return(_a0) +func (_c *MockProvider_GetPods_Call) Return(pods []*v1.Pod) *MockProvider_GetPods_Call { + _c.Call.Return(pods) return _c } @@ -489,33 +523,31 @@ func (_c *MockProvider_GetPods_Call) RunAndReturn(run func() []*v1.Pod) *MockPro return _c } -// GetRequestedContainersInfo provides a mock function with given fields: containerName, options -func (_m *MockProvider) GetRequestedContainersInfo(containerName string, options v2.RequestOptions) (map[string]*infov1.ContainerInfo, error) { - ret := _m.Called(containerName, options) +// GetRequestedContainersInfo provides a mock function for the type MockProvider +func (_mock *MockProvider) GetRequestedContainersInfo(containerName string, options v2.RequestOptions) (map[string]*v10.ContainerInfo, error) { + ret := _mock.Called(containerName, options) if len(ret) == 0 { panic("no return value specified for GetRequestedContainersInfo") } - var r0 map[string]*infov1.ContainerInfo + var r0 map[string]*v10.ContainerInfo var r1 error - if rf, ok := ret.Get(0).(func(string, v2.RequestOptions) (map[string]*infov1.ContainerInfo, error)); ok { - return rf(containerName, options) + if returnFunc, ok := ret.Get(0).(func(string, v2.RequestOptions) (map[string]*v10.ContainerInfo, error)); ok { + return returnFunc(containerName, options) } - if rf, ok := ret.Get(0).(func(string, v2.RequestOptions) map[string]*infov1.ContainerInfo); ok { - r0 = rf(containerName, options) + if returnFunc, ok := ret.Get(0).(func(string, v2.RequestOptions) map[string]*v10.ContainerInfo); ok { + r0 = returnFunc(containerName, options) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]*infov1.ContainerInfo) + r0 = ret.Get(0).(map[string]*v10.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 } @@ -533,24 +565,35 @@ func (_e *MockProvider_Expecter) GetRequestedContainersInfo(containerName interf func (_c *MockProvider_GetRequestedContainersInfo_Call) Run(run func(containerName string, options v2.RequestOptions)) *MockProvider_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 *MockProvider_GetRequestedContainersInfo_Call) Return(_a0 map[string]*infov1.ContainerInfo, _a1 error) *MockProvider_GetRequestedContainersInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_GetRequestedContainersInfo_Call) Return(stringToContainerInfo map[string]*v10.ContainerInfo, err error) *MockProvider_GetRequestedContainersInfo_Call { + _c.Call.Return(stringToContainerInfo, err) return _c } -func (_c *MockProvider_GetRequestedContainersInfo_Call) RunAndReturn(run func(string, v2.RequestOptions) (map[string]*infov1.ContainerInfo, error)) *MockProvider_GetRequestedContainersInfo_Call { +func (_c *MockProvider_GetRequestedContainersInfo_Call) RunAndReturn(run func(containerName string, options v2.RequestOptions) (map[string]*v10.ContainerInfo, error)) *MockProvider_GetRequestedContainersInfo_Call { _c.Call.Return(run) return _c } -// ImageFsStats provides a mock function with given fields: ctx -func (_m *MockProvider) ImageFsStats(ctx context.Context) (*v1alpha1.FsStats, *v1alpha1.FsStats, error) { - ret := _m.Called(ctx) +// ImageFsStats provides a mock function for the type MockProvider +func (_mock *MockProvider) ImageFsStats(ctx context.Context) (*v1alpha1.FsStats, *v1alpha1.FsStats, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ImageFsStats") @@ -559,31 +602,28 @@ func (_m *MockProvider) ImageFsStats(ctx context.Context) (*v1alpha1.FsStats, *v var r0 *v1alpha1.FsStats var r1 *v1alpha1.FsStats var r2 error - if rf, ok := ret.Get(0).(func(context.Context) (*v1alpha1.FsStats, *v1alpha1.FsStats, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*v1alpha1.FsStats, *v1alpha1.FsStats, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) *v1alpha1.FsStats); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) *v1alpha1.FsStats); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.FsStats) } } - - if rf, ok := ret.Get(1).(func(context.Context) *v1alpha1.FsStats); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) *v1alpha1.FsStats); ok { + r1 = returnFunc(ctx) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(*v1alpha1.FsStats) } } - - if rf, ok := ret.Get(2).(func(context.Context) error); ok { - r2 = rf(ctx) + if returnFunc, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = returnFunc(ctx) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -600,7 +640,13 @@ func (_e *MockProvider_Expecter) ImageFsStats(ctx interface{}) *MockProvider_Ima func (_c *MockProvider_ImageFsStats_Call) Run(run func(ctx context.Context)) *MockProvider_ImageFsStats_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 } @@ -610,14 +656,14 @@ func (_c *MockProvider_ImageFsStats_Call) Return(imageFs *v1alpha1.FsStats, cont return _c } -func (_c *MockProvider_ImageFsStats_Call) RunAndReturn(run func(context.Context) (*v1alpha1.FsStats, *v1alpha1.FsStats, error)) *MockProvider_ImageFsStats_Call { +func (_c *MockProvider_ImageFsStats_Call) RunAndReturn(run func(ctx context.Context) (*v1alpha1.FsStats, *v1alpha1.FsStats, error)) *MockProvider_ImageFsStats_Call { _c.Call.Return(run) return _c } -// ListBlockVolumesForPod provides a mock function with given fields: podUID -func (_m *MockProvider) ListBlockVolumesForPod(podUID types.UID) (map[string]volume.BlockVolume, bool) { - ret := _m.Called(podUID) +// ListBlockVolumesForPod provides a mock function for the type MockProvider +func (_mock *MockProvider) ListBlockVolumesForPod(podUID types.UID) (map[string]volume.BlockVolume, bool) { + ret := _mock.Called(podUID) if len(ret) == 0 { panic("no return value specified for ListBlockVolumesForPod") @@ -625,23 +671,21 @@ func (_m *MockProvider) ListBlockVolumesForPod(podUID types.UID) (map[string]vol var r0 map[string]volume.BlockVolume var r1 bool - if rf, ok := ret.Get(0).(func(types.UID) (map[string]volume.BlockVolume, bool)); ok { - return rf(podUID) + if returnFunc, ok := ret.Get(0).(func(types.UID) (map[string]volume.BlockVolume, bool)); ok { + return returnFunc(podUID) } - if rf, ok := ret.Get(0).(func(types.UID) map[string]volume.BlockVolume); ok { - r0 = rf(podUID) + if returnFunc, ok := ret.Get(0).(func(types.UID) map[string]volume.BlockVolume); ok { + r0 = returnFunc(podUID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(map[string]volume.BlockVolume) } } - - if rf, ok := ret.Get(1).(func(types.UID) bool); ok { - r1 = rf(podUID) + if returnFunc, ok := ret.Get(1).(func(types.UID) bool); ok { + r1 = returnFunc(podUID) } else { r1 = ret.Get(1).(bool) } - return r0, r1 } @@ -658,24 +702,30 @@ func (_e *MockProvider_Expecter) ListBlockVolumesForPod(podUID interface{}) *Moc func (_c *MockProvider_ListBlockVolumesForPod_Call) Run(run func(podUID types.UID)) *MockProvider_ListBlockVolumesForPod_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 *MockProvider_ListBlockVolumesForPod_Call) Return(_a0 map[string]volume.BlockVolume, _a1 bool) *MockProvider_ListBlockVolumesForPod_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_ListBlockVolumesForPod_Call) Return(stringToBlockVolume map[string]volume.BlockVolume, b bool) *MockProvider_ListBlockVolumesForPod_Call { + _c.Call.Return(stringToBlockVolume, b) return _c } -func (_c *MockProvider_ListBlockVolumesForPod_Call) RunAndReturn(run func(types.UID) (map[string]volume.BlockVolume, bool)) *MockProvider_ListBlockVolumesForPod_Call { +func (_c *MockProvider_ListBlockVolumesForPod_Call) RunAndReturn(run func(podUID types.UID) (map[string]volume.BlockVolume, bool)) *MockProvider_ListBlockVolumesForPod_Call { _c.Call.Return(run) return _c } -// ListPodCPUAndMemoryStats provides a mock function with given fields: ctx -func (_m *MockProvider) ListPodCPUAndMemoryStats(ctx context.Context) ([]v1alpha1.PodStats, error) { - ret := _m.Called(ctx) +// ListPodCPUAndMemoryStats provides a mock function for the type MockProvider +func (_mock *MockProvider) ListPodCPUAndMemoryStats(ctx context.Context) ([]v1alpha1.PodStats, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ListPodCPUAndMemoryStats") @@ -683,23 +733,21 @@ func (_m *MockProvider) ListPodCPUAndMemoryStats(ctx context.Context) ([]v1alpha var r0 []v1alpha1.PodStats var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]v1alpha1.PodStats, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]v1alpha1.PodStats, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) []v1alpha1.PodStats); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) []v1alpha1.PodStats); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]v1alpha1.PodStats) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -716,24 +764,30 @@ func (_e *MockProvider_Expecter) ListPodCPUAndMemoryStats(ctx interface{}) *Mock func (_c *MockProvider_ListPodCPUAndMemoryStats_Call) Run(run func(ctx context.Context)) *MockProvider_ListPodCPUAndMemoryStats_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 *MockProvider_ListPodCPUAndMemoryStats_Call) Return(_a0 []v1alpha1.PodStats, _a1 error) *MockProvider_ListPodCPUAndMemoryStats_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_ListPodCPUAndMemoryStats_Call) Return(podStatss []v1alpha1.PodStats, err error) *MockProvider_ListPodCPUAndMemoryStats_Call { + _c.Call.Return(podStatss, err) return _c } -func (_c *MockProvider_ListPodCPUAndMemoryStats_Call) RunAndReturn(run func(context.Context) ([]v1alpha1.PodStats, error)) *MockProvider_ListPodCPUAndMemoryStats_Call { +func (_c *MockProvider_ListPodCPUAndMemoryStats_Call) RunAndReturn(run func(ctx context.Context) ([]v1alpha1.PodStats, error)) *MockProvider_ListPodCPUAndMemoryStats_Call { _c.Call.Return(run) return _c } -// ListPodStats provides a mock function with given fields: ctx -func (_m *MockProvider) ListPodStats(ctx context.Context) ([]v1alpha1.PodStats, error) { - ret := _m.Called(ctx) +// ListPodStats provides a mock function for the type MockProvider +func (_mock *MockProvider) ListPodStats(ctx context.Context) ([]v1alpha1.PodStats, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ListPodStats") @@ -741,23 +795,21 @@ func (_m *MockProvider) ListPodStats(ctx context.Context) ([]v1alpha1.PodStats, var r0 []v1alpha1.PodStats var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]v1alpha1.PodStats, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]v1alpha1.PodStats, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) []v1alpha1.PodStats); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) []v1alpha1.PodStats); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]v1alpha1.PodStats) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -774,24 +826,30 @@ func (_e *MockProvider_Expecter) ListPodStats(ctx interface{}) *MockProvider_Lis func (_c *MockProvider_ListPodStats_Call) Run(run func(ctx context.Context)) *MockProvider_ListPodStats_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 *MockProvider_ListPodStats_Call) Return(_a0 []v1alpha1.PodStats, _a1 error) *MockProvider_ListPodStats_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_ListPodStats_Call) Return(podStatss []v1alpha1.PodStats, err error) *MockProvider_ListPodStats_Call { + _c.Call.Return(podStatss, err) return _c } -func (_c *MockProvider_ListPodStats_Call) RunAndReturn(run func(context.Context) ([]v1alpha1.PodStats, error)) *MockProvider_ListPodStats_Call { +func (_c *MockProvider_ListPodStats_Call) RunAndReturn(run func(ctx context.Context) ([]v1alpha1.PodStats, error)) *MockProvider_ListPodStats_Call { _c.Call.Return(run) return _c } -// ListPodStatsAndUpdateCPUNanoCoreUsage provides a mock function with given fields: ctx -func (_m *MockProvider) ListPodStatsAndUpdateCPUNanoCoreUsage(ctx context.Context) ([]v1alpha1.PodStats, error) { - ret := _m.Called(ctx) +// ListPodStatsAndUpdateCPUNanoCoreUsage provides a mock function for the type MockProvider +func (_mock *MockProvider) ListPodStatsAndUpdateCPUNanoCoreUsage(ctx context.Context) ([]v1alpha1.PodStats, error) { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ListPodStatsAndUpdateCPUNanoCoreUsage") @@ -799,23 +857,21 @@ func (_m *MockProvider) ListPodStatsAndUpdateCPUNanoCoreUsage(ctx context.Contex var r0 []v1alpha1.PodStats var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]v1alpha1.PodStats, error)); ok { - return rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) ([]v1alpha1.PodStats, error)); ok { + return returnFunc(ctx) } - if rf, ok := ret.Get(0).(func(context.Context) []v1alpha1.PodStats); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) []v1alpha1.PodStats); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]v1alpha1.PodStats) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -832,24 +888,30 @@ func (_e *MockProvider_Expecter) ListPodStatsAndUpdateCPUNanoCoreUsage(ctx inter func (_c *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call) Run(run func(ctx context.Context)) *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_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 *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call) Return(_a0 []v1alpha1.PodStats, _a1 error) *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call) Return(podStatss []v1alpha1.PodStats, err error) *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call { + _c.Call.Return(podStatss, err) return _c } -func (_c *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call) RunAndReturn(run func(context.Context) ([]v1alpha1.PodStats, error)) *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call { +func (_c *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call) RunAndReturn(run func(ctx context.Context) ([]v1alpha1.PodStats, error)) *MockProvider_ListPodStatsAndUpdateCPUNanoCoreUsage_Call { _c.Call.Return(run) return _c } -// ListVolumesForPod provides a mock function with given fields: podUID -func (_m *MockProvider) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) { - ret := _m.Called(podUID) +// ListVolumesForPod provides a mock function for the type MockProvider +func (_mock *MockProvider) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) { + ret := _mock.Called(podUID) if len(ret) == 0 { panic("no return value specified for ListVolumesForPod") @@ -857,23 +919,21 @@ func (_m *MockProvider) ListVolumesForPod(podUID types.UID) (map[string]volume.V var r0 map[string]volume.Volume var r1 bool - if rf, ok := ret.Get(0).(func(types.UID) (map[string]volume.Volume, bool)); ok { - return rf(podUID) + if returnFunc, ok := ret.Get(0).(func(types.UID) (map[string]volume.Volume, bool)); ok { + return returnFunc(podUID) } - if rf, ok := ret.Get(0).(func(types.UID) map[string]volume.Volume); ok { - r0 = rf(podUID) + if returnFunc, ok := ret.Get(0).(func(types.UID) map[string]volume.Volume); ok { + r0 = returnFunc(podUID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(map[string]volume.Volume) } } - - if rf, ok := ret.Get(1).(func(types.UID) bool); ok { - r1 = rf(podUID) + if returnFunc, ok := ret.Get(1).(func(types.UID) bool); ok { + r1 = returnFunc(podUID) } else { r1 = ret.Get(1).(bool) } - return r0, r1 } @@ -890,24 +950,30 @@ func (_e *MockProvider_Expecter) ListVolumesForPod(podUID interface{}) *MockProv func (_c *MockProvider_ListVolumesForPod_Call) Run(run func(podUID types.UID)) *MockProvider_ListVolumesForPod_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 *MockProvider_ListVolumesForPod_Call) Return(_a0 map[string]volume.Volume, _a1 bool) *MockProvider_ListVolumesForPod_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_ListVolumesForPod_Call) Return(stringToVolume map[string]volume.Volume, b bool) *MockProvider_ListVolumesForPod_Call { + _c.Call.Return(stringToVolume, b) return _c } -func (_c *MockProvider_ListVolumesForPod_Call) RunAndReturn(run func(types.UID) (map[string]volume.Volume, bool)) *MockProvider_ListVolumesForPod_Call { +func (_c *MockProvider_ListVolumesForPod_Call) RunAndReturn(run func(podUID types.UID) (map[string]volume.Volume, bool)) *MockProvider_ListVolumesForPod_Call { _c.Call.Return(run) return _c } -// RlimitStats provides a mock function with no fields -func (_m *MockProvider) RlimitStats() (*v1alpha1.RlimitStats, error) { - ret := _m.Called() +// RlimitStats provides a mock function for the type MockProvider +func (_mock *MockProvider) RlimitStats() (*v1alpha1.RlimitStats, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for RlimitStats") @@ -915,23 +981,21 @@ func (_m *MockProvider) RlimitStats() (*v1alpha1.RlimitStats, error) { var r0 *v1alpha1.RlimitStats var r1 error - if rf, ok := ret.Get(0).(func() (*v1alpha1.RlimitStats, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (*v1alpha1.RlimitStats, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() *v1alpha1.RlimitStats); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *v1alpha1.RlimitStats); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.RlimitStats) } } - - 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 } @@ -952,8 +1016,8 @@ func (_c *MockProvider_RlimitStats_Call) Run(run func()) *MockProvider_RlimitSta return _c } -func (_c *MockProvider_RlimitStats_Call) Return(_a0 *v1alpha1.RlimitStats, _a1 error) *MockProvider_RlimitStats_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_RlimitStats_Call) Return(rlimitStats *v1alpha1.RlimitStats, err error) *MockProvider_RlimitStats_Call { + _c.Call.Return(rlimitStats, err) return _c } @@ -962,9 +1026,9 @@ func (_c *MockProvider_RlimitStats_Call) RunAndReturn(run func() (*v1alpha1.Rlim return _c } -// RootFsStats provides a mock function with no fields -func (_m *MockProvider) RootFsStats() (*v1alpha1.FsStats, error) { - ret := _m.Called() +// RootFsStats provides a mock function for the type MockProvider +func (_mock *MockProvider) RootFsStats() (*v1alpha1.FsStats, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for RootFsStats") @@ -972,23 +1036,21 @@ func (_m *MockProvider) RootFsStats() (*v1alpha1.FsStats, error) { var r0 *v1alpha1.FsStats var r1 error - if rf, ok := ret.Get(0).(func() (*v1alpha1.FsStats, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (*v1alpha1.FsStats, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() *v1alpha1.FsStats); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *v1alpha1.FsStats); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.FsStats) } } - - 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 } @@ -1009,8 +1071,8 @@ func (_c *MockProvider_RootFsStats_Call) Run(run func()) *MockProvider_RootFsSta return _c } -func (_c *MockProvider_RootFsStats_Call) Return(_a0 *v1alpha1.FsStats, _a1 error) *MockProvider_RootFsStats_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockProvider_RootFsStats_Call) Return(fsStats *v1alpha1.FsStats, err error) *MockProvider_RootFsStats_Call { + _c.Call.Return(fsStats, err) return _c } @@ -1019,16 +1081,159 @@ func (_c *MockProvider_RootFsStats_Call) RunAndReturn(run func() (*v1alpha1.FsSt return _c } -// NewMockProvider creates a new instance of MockProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// 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 NewMockProvider(t interface { +func NewMockSummaryProvider(t interface { mock.TestingT Cleanup(func()) -}) *MockProvider { - mock := &MockProvider{} +}) *MockSummaryProvider { + mock := &MockSummaryProvider{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } + +// 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 for the type MockSummaryProvider +func (_mock *MockSummaryProvider) Get(ctx context.Context, updateStats bool) (*v1alpha1.Summary, error) { + ret := _mock.Called(ctx, updateStats) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *v1alpha1.Summary + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, bool) (*v1alpha1.Summary, error)); ok { + return returnFunc(ctx, updateStats) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, bool) *v1alpha1.Summary); ok { + r0 = returnFunc(ctx, updateStats) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1alpha1.Summary) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, bool) error); ok { + r1 = returnFunc(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) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockSummaryProvider_Get_Call) Return(summary *v1alpha1.Summary, err error) *MockSummaryProvider_Get_Call { + _c.Call.Return(summary, err) + return _c +} + +func (_c *MockSummaryProvider_Get_Call) RunAndReturn(run func(ctx context.Context, updateStats bool) (*v1alpha1.Summary, error)) *MockSummaryProvider_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetCPUAndMemoryStats provides a mock function for the type MockSummaryProvider +func (_mock *MockSummaryProvider) GetCPUAndMemoryStats(ctx context.Context) (*v1alpha1.Summary, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetCPUAndMemoryStats") + } + + var r0 *v1alpha1.Summary + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (*v1alpha1.Summary, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) *v1alpha1.Summary); ok { + r0 = returnFunc(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1alpha1.Summary) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(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) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockSummaryProvider_GetCPUAndMemoryStats_Call) Return(summary *v1alpha1.Summary, err error) *MockSummaryProvider_GetCPUAndMemoryStats_Call { + _c.Call.Return(summary, err) + return _c +} + +func (_c *MockSummaryProvider_GetCPUAndMemoryStats_Call) RunAndReturn(run func(ctx context.Context) (*v1alpha1.Summary, error)) *MockSummaryProvider_GetCPUAndMemoryStats_Call { + _c.Call.Return(run) + return _c +} diff --git a/pkg/kubelet/status/.mockery.yaml b/pkg/kubelet/status/.mockery.yaml index e57d22e2ee2..ead47cb8501 100644 --- a/pkg/kubelet/status/.mockery.yaml +++ b/pkg/kubelet/status/.mockery.yaml @@ -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: {} diff --git a/pkg/kubelet/status/testing/mock_pod_status_provider.go b/pkg/kubelet/status/testing/mocks.go similarity index 71% rename from pkg/kubelet/status/testing/mock_pod_status_provider.go rename to pkg/kubelet/status/testing/mocks.go index dcfe31b4dc1..f0415c9c788 100644 --- a/pkg/kubelet/status/testing/mock_pod_status_provider.go +++ b/pkg/kubelet/status/testing/mocks.go @@ -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 -} diff --git a/staging/src/k8s.io/client-go/rest/.mockery.yaml b/staging/src/k8s.io/client-go/rest/.mockery.yaml index e21d7b5be26..b4df9ca8c10 100644 --- a/staging/src/k8s.io/client-go/rest/.mockery.yaml +++ b/staging/src/k8s.io/client-go/rest/.mockery.yaml @@ -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: {} diff --git a/staging/src/k8s.io/client-go/rest/mock_backoff_manager_test.go b/staging/src/k8s.io/client-go/rest/mocks_test.go similarity index 71% rename from staging/src/k8s.io/client-go/rest/mock_backoff_manager_test.go rename to staging/src/k8s.io/client-go/rest/mocks_test.go index 938bc82d4f4..996e857f486 100644 --- a/staging/src/k8s.io/client-go/rest/mock_backoff_manager_test.go +++ b/staging/src/k8s.io/client-go/rest/mocks_test.go @@ -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 -} diff --git a/test/e2e/storage/drivers/csi-test/driver/.mockery.yaml b/test/e2e/storage/drivers/csi-test/driver/.mockery.yaml index 2ccaee23392..b9f34dd43e9 100644 --- a/test/e2e/storage/drivers/csi-test/driver/.mockery.yaml +++ b/test/e2e/storage/drivers/csi-test/driver/.mockery.yaml @@ -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: {} diff --git a/test/e2e/storage/drivers/csi-test/driver/mock_controller_server.go b/test/e2e/storage/drivers/csi-test/driver/mock_controller_server.go deleted file mode 100644 index 3aef0fd37ee..00000000000 --- a/test/e2e/storage/drivers/csi-test/driver/mock_controller_server.go +++ /dev/null @@ -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 -} diff --git a/test/e2e/storage/drivers/csi-test/driver/mock_identity_server.go b/test/e2e/storage/drivers/csi-test/driver/mock_identity_server.go deleted file mode 100644 index 3e02f50ad57..00000000000 --- a/test/e2e/storage/drivers/csi-test/driver/mock_identity_server.go +++ /dev/null @@ -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 -} diff --git a/test/e2e/storage/drivers/csi-test/driver/mock_node_server.go b/test/e2e/storage/drivers/csi-test/driver/mock_node_server.go deleted file mode 100644 index 4b3f1069142..00000000000 --- a/test/e2e/storage/drivers/csi-test/driver/mock_node_server.go +++ /dev/null @@ -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 -} diff --git a/test/e2e/storage/drivers/csi-test/driver/mocks.go b/test/e2e/storage/drivers/csi-test/driver/mocks.go new file mode 100644 index 00000000000..7590edc327d --- /dev/null +++ b/test/e2e/storage/drivers/csi-test/driver/mocks.go @@ -0,0 +1,1809 @@ +/* +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 driver + +import ( + "context" + + "github.com/container-storage-interface/spec/lib/go/csi" + mock "github.com/stretchr/testify/mock" +) + +// 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 +} + +// 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 for the type MockIdentityServer +func (_mock *MockIdentityServer) GetPluginCapabilities(context1 context.Context, getPluginCapabilitiesRequest *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) { + ret := _mock.Called(context1, getPluginCapabilitiesRequest) + + if len(ret) == 0 { + panic("no return value specified for GetPluginCapabilities") + } + + var r0 *csi.GetPluginCapabilitiesResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)); ok { + return returnFunc(context1, getPluginCapabilitiesRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.GetPluginCapabilitiesRequest) *csi.GetPluginCapabilitiesResponse); ok { + r0 = returnFunc(context1, getPluginCapabilitiesRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.GetPluginCapabilitiesResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.GetPluginCapabilitiesRequest) error); ok { + r1 = returnFunc(context1, getPluginCapabilitiesRequest) + } 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 +// - context1 context.Context +// - getPluginCapabilitiesRequest *csi.GetPluginCapabilitiesRequest +func (_e *MockIdentityServer_Expecter) GetPluginCapabilities(context1 interface{}, getPluginCapabilitiesRequest interface{}) *MockIdentityServer_GetPluginCapabilities_Call { + return &MockIdentityServer_GetPluginCapabilities_Call{Call: _e.mock.On("GetPluginCapabilities", context1, getPluginCapabilitiesRequest)} +} + +func (_c *MockIdentityServer_GetPluginCapabilities_Call) Run(run func(context1 context.Context, getPluginCapabilitiesRequest *csi.GetPluginCapabilitiesRequest)) *MockIdentityServer_GetPluginCapabilities_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.GetPluginCapabilitiesRequest + if args[1] != nil { + arg1 = args[1].(*csi.GetPluginCapabilitiesRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockIdentityServer_GetPluginCapabilities_Call) Return(getPluginCapabilitiesResponse *csi.GetPluginCapabilitiesResponse, err error) *MockIdentityServer_GetPluginCapabilities_Call { + _c.Call.Return(getPluginCapabilitiesResponse, err) + return _c +} + +func (_c *MockIdentityServer_GetPluginCapabilities_Call) RunAndReturn(run func(context1 context.Context, getPluginCapabilitiesRequest *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)) *MockIdentityServer_GetPluginCapabilities_Call { + _c.Call.Return(run) + return _c +} + +// GetPluginInfo provides a mock function for the type MockIdentityServer +func (_mock *MockIdentityServer) GetPluginInfo(context1 context.Context, getPluginInfoRequest *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) { + ret := _mock.Called(context1, getPluginInfoRequest) + + if len(ret) == 0 { + panic("no return value specified for GetPluginInfo") + } + + var r0 *csi.GetPluginInfoResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)); ok { + return returnFunc(context1, getPluginInfoRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.GetPluginInfoRequest) *csi.GetPluginInfoResponse); ok { + r0 = returnFunc(context1, getPluginInfoRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.GetPluginInfoResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.GetPluginInfoRequest) error); ok { + r1 = returnFunc(context1, getPluginInfoRequest) + } 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 +// - context1 context.Context +// - getPluginInfoRequest *csi.GetPluginInfoRequest +func (_e *MockIdentityServer_Expecter) GetPluginInfo(context1 interface{}, getPluginInfoRequest interface{}) *MockIdentityServer_GetPluginInfo_Call { + return &MockIdentityServer_GetPluginInfo_Call{Call: _e.mock.On("GetPluginInfo", context1, getPluginInfoRequest)} +} + +func (_c *MockIdentityServer_GetPluginInfo_Call) Run(run func(context1 context.Context, getPluginInfoRequest *csi.GetPluginInfoRequest)) *MockIdentityServer_GetPluginInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.GetPluginInfoRequest + if args[1] != nil { + arg1 = args[1].(*csi.GetPluginInfoRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockIdentityServer_GetPluginInfo_Call) Return(getPluginInfoResponse *csi.GetPluginInfoResponse, err error) *MockIdentityServer_GetPluginInfo_Call { + _c.Call.Return(getPluginInfoResponse, err) + return _c +} + +func (_c *MockIdentityServer_GetPluginInfo_Call) RunAndReturn(run func(context1 context.Context, getPluginInfoRequest *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)) *MockIdentityServer_GetPluginInfo_Call { + _c.Call.Return(run) + return _c +} + +// Probe provides a mock function for the type MockIdentityServer +func (_mock *MockIdentityServer) Probe(context1 context.Context, probeRequest *csi.ProbeRequest) (*csi.ProbeResponse, error) { + ret := _mock.Called(context1, probeRequest) + + if len(ret) == 0 { + panic("no return value specified for Probe") + } + + var r0 *csi.ProbeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error)); ok { + return returnFunc(context1, probeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ProbeRequest) *csi.ProbeResponse); ok { + r0 = returnFunc(context1, probeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ProbeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ProbeRequest) error); ok { + r1 = returnFunc(context1, probeRequest) + } 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 +// - context1 context.Context +// - probeRequest *csi.ProbeRequest +func (_e *MockIdentityServer_Expecter) Probe(context1 interface{}, probeRequest interface{}) *MockIdentityServer_Probe_Call { + return &MockIdentityServer_Probe_Call{Call: _e.mock.On("Probe", context1, probeRequest)} +} + +func (_c *MockIdentityServer_Probe_Call) Run(run func(context1 context.Context, probeRequest *csi.ProbeRequest)) *MockIdentityServer_Probe_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ProbeRequest + if args[1] != nil { + arg1 = args[1].(*csi.ProbeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockIdentityServer_Probe_Call) Return(probeResponse *csi.ProbeResponse, err error) *MockIdentityServer_Probe_Call { + _c.Call.Return(probeResponse, err) + return _c +} + +func (_c *MockIdentityServer_Probe_Call) RunAndReturn(run func(context1 context.Context, probeRequest *csi.ProbeRequest) (*csi.ProbeResponse, error)) *MockIdentityServer_Probe_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 +} + +// 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 for the type MockControllerServer +func (_mock *MockControllerServer) ControllerExpandVolume(context1 context.Context, controllerExpandVolumeRequest *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) { + ret := _mock.Called(context1, controllerExpandVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for ControllerExpandVolume") + } + + var r0 *csi.ControllerExpandVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)); ok { + return returnFunc(context1, controllerExpandVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerExpandVolumeRequest) *csi.ControllerExpandVolumeResponse); ok { + r0 = returnFunc(context1, controllerExpandVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ControllerExpandVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ControllerExpandVolumeRequest) error); ok { + r1 = returnFunc(context1, controllerExpandVolumeRequest) + } 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 +// - context1 context.Context +// - controllerExpandVolumeRequest *csi.ControllerExpandVolumeRequest +func (_e *MockControllerServer_Expecter) ControllerExpandVolume(context1 interface{}, controllerExpandVolumeRequest interface{}) *MockControllerServer_ControllerExpandVolume_Call { + return &MockControllerServer_ControllerExpandVolume_Call{Call: _e.mock.On("ControllerExpandVolume", context1, controllerExpandVolumeRequest)} +} + +func (_c *MockControllerServer_ControllerExpandVolume_Call) Run(run func(context1 context.Context, controllerExpandVolumeRequest *csi.ControllerExpandVolumeRequest)) *MockControllerServer_ControllerExpandVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ControllerExpandVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.ControllerExpandVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ControllerExpandVolume_Call) Return(controllerExpandVolumeResponse *csi.ControllerExpandVolumeResponse, err error) *MockControllerServer_ControllerExpandVolume_Call { + _c.Call.Return(controllerExpandVolumeResponse, err) + return _c +} + +func (_c *MockControllerServer_ControllerExpandVolume_Call) RunAndReturn(run func(context1 context.Context, controllerExpandVolumeRequest *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)) *MockControllerServer_ControllerExpandVolume_Call { + _c.Call.Return(run) + return _c +} + +// ControllerGetCapabilities provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ControllerGetCapabilities(context1 context.Context, controllerGetCapabilitiesRequest *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) { + ret := _mock.Called(context1, controllerGetCapabilitiesRequest) + + if len(ret) == 0 { + panic("no return value specified for ControllerGetCapabilities") + } + + var r0 *csi.ControllerGetCapabilitiesResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)); ok { + return returnFunc(context1, controllerGetCapabilitiesRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetCapabilitiesRequest) *csi.ControllerGetCapabilitiesResponse); ok { + r0 = returnFunc(context1, controllerGetCapabilitiesRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ControllerGetCapabilitiesResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ControllerGetCapabilitiesRequest) error); ok { + r1 = returnFunc(context1, controllerGetCapabilitiesRequest) + } 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 +// - context1 context.Context +// - controllerGetCapabilitiesRequest *csi.ControllerGetCapabilitiesRequest +func (_e *MockControllerServer_Expecter) ControllerGetCapabilities(context1 interface{}, controllerGetCapabilitiesRequest interface{}) *MockControllerServer_ControllerGetCapabilities_Call { + return &MockControllerServer_ControllerGetCapabilities_Call{Call: _e.mock.On("ControllerGetCapabilities", context1, controllerGetCapabilitiesRequest)} +} + +func (_c *MockControllerServer_ControllerGetCapabilities_Call) Run(run func(context1 context.Context, controllerGetCapabilitiesRequest *csi.ControllerGetCapabilitiesRequest)) *MockControllerServer_ControllerGetCapabilities_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ControllerGetCapabilitiesRequest + if args[1] != nil { + arg1 = args[1].(*csi.ControllerGetCapabilitiesRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ControllerGetCapabilities_Call) Return(controllerGetCapabilitiesResponse *csi.ControllerGetCapabilitiesResponse, err error) *MockControllerServer_ControllerGetCapabilities_Call { + _c.Call.Return(controllerGetCapabilitiesResponse, err) + return _c +} + +func (_c *MockControllerServer_ControllerGetCapabilities_Call) RunAndReturn(run func(context1 context.Context, controllerGetCapabilitiesRequest *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)) *MockControllerServer_ControllerGetCapabilities_Call { + _c.Call.Return(run) + return _c +} + +// ControllerGetVolume provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ControllerGetVolume(context1 context.Context, controllerGetVolumeRequest *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) { + ret := _mock.Called(context1, controllerGetVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for ControllerGetVolume") + } + + var r0 *csi.ControllerGetVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)); ok { + return returnFunc(context1, controllerGetVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerGetVolumeRequest) *csi.ControllerGetVolumeResponse); ok { + r0 = returnFunc(context1, controllerGetVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ControllerGetVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ControllerGetVolumeRequest) error); ok { + r1 = returnFunc(context1, controllerGetVolumeRequest) + } 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 +// - context1 context.Context +// - controllerGetVolumeRequest *csi.ControllerGetVolumeRequest +func (_e *MockControllerServer_Expecter) ControllerGetVolume(context1 interface{}, controllerGetVolumeRequest interface{}) *MockControllerServer_ControllerGetVolume_Call { + return &MockControllerServer_ControllerGetVolume_Call{Call: _e.mock.On("ControllerGetVolume", context1, controllerGetVolumeRequest)} +} + +func (_c *MockControllerServer_ControllerGetVolume_Call) Run(run func(context1 context.Context, controllerGetVolumeRequest *csi.ControllerGetVolumeRequest)) *MockControllerServer_ControllerGetVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ControllerGetVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.ControllerGetVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ControllerGetVolume_Call) Return(controllerGetVolumeResponse *csi.ControllerGetVolumeResponse, err error) *MockControllerServer_ControllerGetVolume_Call { + _c.Call.Return(controllerGetVolumeResponse, err) + return _c +} + +func (_c *MockControllerServer_ControllerGetVolume_Call) RunAndReturn(run func(context1 context.Context, controllerGetVolumeRequest *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)) *MockControllerServer_ControllerGetVolume_Call { + _c.Call.Return(run) + return _c +} + +// ControllerModifyVolume provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ControllerModifyVolume(context1 context.Context, controllerModifyVolumeRequest *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error) { + ret := _mock.Called(context1, controllerModifyVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for ControllerModifyVolume") + } + + var r0 *csi.ControllerModifyVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)); ok { + return returnFunc(context1, controllerModifyVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerModifyVolumeRequest) *csi.ControllerModifyVolumeResponse); ok { + r0 = returnFunc(context1, controllerModifyVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ControllerModifyVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ControllerModifyVolumeRequest) error); ok { + r1 = returnFunc(context1, controllerModifyVolumeRequest) + } 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 +// - context1 context.Context +// - controllerModifyVolumeRequest *csi.ControllerModifyVolumeRequest +func (_e *MockControllerServer_Expecter) ControllerModifyVolume(context1 interface{}, controllerModifyVolumeRequest interface{}) *MockControllerServer_ControllerModifyVolume_Call { + return &MockControllerServer_ControllerModifyVolume_Call{Call: _e.mock.On("ControllerModifyVolume", context1, controllerModifyVolumeRequest)} +} + +func (_c *MockControllerServer_ControllerModifyVolume_Call) Run(run func(context1 context.Context, controllerModifyVolumeRequest *csi.ControllerModifyVolumeRequest)) *MockControllerServer_ControllerModifyVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ControllerModifyVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.ControllerModifyVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ControllerModifyVolume_Call) Return(controllerModifyVolumeResponse *csi.ControllerModifyVolumeResponse, err error) *MockControllerServer_ControllerModifyVolume_Call { + _c.Call.Return(controllerModifyVolumeResponse, err) + return _c +} + +func (_c *MockControllerServer_ControllerModifyVolume_Call) RunAndReturn(run func(context1 context.Context, controllerModifyVolumeRequest *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)) *MockControllerServer_ControllerModifyVolume_Call { + _c.Call.Return(run) + return _c +} + +// ControllerPublishVolume provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ControllerPublishVolume(context1 context.Context, controllerPublishVolumeRequest *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) { + ret := _mock.Called(context1, controllerPublishVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for ControllerPublishVolume") + } + + var r0 *csi.ControllerPublishVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)); ok { + return returnFunc(context1, controllerPublishVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerPublishVolumeRequest) *csi.ControllerPublishVolumeResponse); ok { + r0 = returnFunc(context1, controllerPublishVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ControllerPublishVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ControllerPublishVolumeRequest) error); ok { + r1 = returnFunc(context1, controllerPublishVolumeRequest) + } 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 +// - context1 context.Context +// - controllerPublishVolumeRequest *csi.ControllerPublishVolumeRequest +func (_e *MockControllerServer_Expecter) ControllerPublishVolume(context1 interface{}, controllerPublishVolumeRequest interface{}) *MockControllerServer_ControllerPublishVolume_Call { + return &MockControllerServer_ControllerPublishVolume_Call{Call: _e.mock.On("ControllerPublishVolume", context1, controllerPublishVolumeRequest)} +} + +func (_c *MockControllerServer_ControllerPublishVolume_Call) Run(run func(context1 context.Context, controllerPublishVolumeRequest *csi.ControllerPublishVolumeRequest)) *MockControllerServer_ControllerPublishVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ControllerPublishVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.ControllerPublishVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ControllerPublishVolume_Call) Return(controllerPublishVolumeResponse *csi.ControllerPublishVolumeResponse, err error) *MockControllerServer_ControllerPublishVolume_Call { + _c.Call.Return(controllerPublishVolumeResponse, err) + return _c +} + +func (_c *MockControllerServer_ControllerPublishVolume_Call) RunAndReturn(run func(context1 context.Context, controllerPublishVolumeRequest *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)) *MockControllerServer_ControllerPublishVolume_Call { + _c.Call.Return(run) + return _c +} + +// ControllerUnpublishVolume provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ControllerUnpublishVolume(context1 context.Context, controllerUnpublishVolumeRequest *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) { + ret := _mock.Called(context1, controllerUnpublishVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for ControllerUnpublishVolume") + } + + var r0 *csi.ControllerUnpublishVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)); ok { + return returnFunc(context1, controllerUnpublishVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ControllerUnpublishVolumeRequest) *csi.ControllerUnpublishVolumeResponse); ok { + r0 = returnFunc(context1, controllerUnpublishVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ControllerUnpublishVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ControllerUnpublishVolumeRequest) error); ok { + r1 = returnFunc(context1, controllerUnpublishVolumeRequest) + } 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 +// - context1 context.Context +// - controllerUnpublishVolumeRequest *csi.ControllerUnpublishVolumeRequest +func (_e *MockControllerServer_Expecter) ControllerUnpublishVolume(context1 interface{}, controllerUnpublishVolumeRequest interface{}) *MockControllerServer_ControllerUnpublishVolume_Call { + return &MockControllerServer_ControllerUnpublishVolume_Call{Call: _e.mock.On("ControllerUnpublishVolume", context1, controllerUnpublishVolumeRequest)} +} + +func (_c *MockControllerServer_ControllerUnpublishVolume_Call) Run(run func(context1 context.Context, controllerUnpublishVolumeRequest *csi.ControllerUnpublishVolumeRequest)) *MockControllerServer_ControllerUnpublishVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ControllerUnpublishVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.ControllerUnpublishVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ControllerUnpublishVolume_Call) Return(controllerUnpublishVolumeResponse *csi.ControllerUnpublishVolumeResponse, err error) *MockControllerServer_ControllerUnpublishVolume_Call { + _c.Call.Return(controllerUnpublishVolumeResponse, err) + return _c +} + +func (_c *MockControllerServer_ControllerUnpublishVolume_Call) RunAndReturn(run func(context1 context.Context, controllerUnpublishVolumeRequest *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)) *MockControllerServer_ControllerUnpublishVolume_Call { + _c.Call.Return(run) + return _c +} + +// CreateSnapshot provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) CreateSnapshot(context1 context.Context, createSnapshotRequest *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) { + ret := _mock.Called(context1, createSnapshotRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateSnapshot") + } + + var r0 *csi.CreateSnapshotResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)); ok { + return returnFunc(context1, createSnapshotRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.CreateSnapshotRequest) *csi.CreateSnapshotResponse); ok { + r0 = returnFunc(context1, createSnapshotRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.CreateSnapshotResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.CreateSnapshotRequest) error); ok { + r1 = returnFunc(context1, createSnapshotRequest) + } 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 +// - context1 context.Context +// - createSnapshotRequest *csi.CreateSnapshotRequest +func (_e *MockControllerServer_Expecter) CreateSnapshot(context1 interface{}, createSnapshotRequest interface{}) *MockControllerServer_CreateSnapshot_Call { + return &MockControllerServer_CreateSnapshot_Call{Call: _e.mock.On("CreateSnapshot", context1, createSnapshotRequest)} +} + +func (_c *MockControllerServer_CreateSnapshot_Call) Run(run func(context1 context.Context, createSnapshotRequest *csi.CreateSnapshotRequest)) *MockControllerServer_CreateSnapshot_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.CreateSnapshotRequest + if args[1] != nil { + arg1 = args[1].(*csi.CreateSnapshotRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_CreateSnapshot_Call) Return(createSnapshotResponse *csi.CreateSnapshotResponse, err error) *MockControllerServer_CreateSnapshot_Call { + _c.Call.Return(createSnapshotResponse, err) + return _c +} + +func (_c *MockControllerServer_CreateSnapshot_Call) RunAndReturn(run func(context1 context.Context, createSnapshotRequest *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)) *MockControllerServer_CreateSnapshot_Call { + _c.Call.Return(run) + return _c +} + +// CreateVolume provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) CreateVolume(context1 context.Context, createVolumeRequest *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) { + ret := _mock.Called(context1, createVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateVolume") + } + + var r0 *csi.CreateVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)); ok { + return returnFunc(context1, createVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.CreateVolumeRequest) *csi.CreateVolumeResponse); ok { + r0 = returnFunc(context1, createVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.CreateVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.CreateVolumeRequest) error); ok { + r1 = returnFunc(context1, createVolumeRequest) + } 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 +// - context1 context.Context +// - createVolumeRequest *csi.CreateVolumeRequest +func (_e *MockControllerServer_Expecter) CreateVolume(context1 interface{}, createVolumeRequest interface{}) *MockControllerServer_CreateVolume_Call { + return &MockControllerServer_CreateVolume_Call{Call: _e.mock.On("CreateVolume", context1, createVolumeRequest)} +} + +func (_c *MockControllerServer_CreateVolume_Call) Run(run func(context1 context.Context, createVolumeRequest *csi.CreateVolumeRequest)) *MockControllerServer_CreateVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.CreateVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.CreateVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_CreateVolume_Call) Return(createVolumeResponse *csi.CreateVolumeResponse, err error) *MockControllerServer_CreateVolume_Call { + _c.Call.Return(createVolumeResponse, err) + return _c +} + +func (_c *MockControllerServer_CreateVolume_Call) RunAndReturn(run func(context1 context.Context, createVolumeRequest *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)) *MockControllerServer_CreateVolume_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSnapshot provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) DeleteSnapshot(context1 context.Context, deleteSnapshotRequest *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) { + ret := _mock.Called(context1, deleteSnapshotRequest) + + if len(ret) == 0 { + panic("no return value specified for DeleteSnapshot") + } + + var r0 *csi.DeleteSnapshotResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)); ok { + return returnFunc(context1, deleteSnapshotRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.DeleteSnapshotRequest) *csi.DeleteSnapshotResponse); ok { + r0 = returnFunc(context1, deleteSnapshotRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.DeleteSnapshotResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.DeleteSnapshotRequest) error); ok { + r1 = returnFunc(context1, deleteSnapshotRequest) + } 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 +// - context1 context.Context +// - deleteSnapshotRequest *csi.DeleteSnapshotRequest +func (_e *MockControllerServer_Expecter) DeleteSnapshot(context1 interface{}, deleteSnapshotRequest interface{}) *MockControllerServer_DeleteSnapshot_Call { + return &MockControllerServer_DeleteSnapshot_Call{Call: _e.mock.On("DeleteSnapshot", context1, deleteSnapshotRequest)} +} + +func (_c *MockControllerServer_DeleteSnapshot_Call) Run(run func(context1 context.Context, deleteSnapshotRequest *csi.DeleteSnapshotRequest)) *MockControllerServer_DeleteSnapshot_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.DeleteSnapshotRequest + if args[1] != nil { + arg1 = args[1].(*csi.DeleteSnapshotRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_DeleteSnapshot_Call) Return(deleteSnapshotResponse *csi.DeleteSnapshotResponse, err error) *MockControllerServer_DeleteSnapshot_Call { + _c.Call.Return(deleteSnapshotResponse, err) + return _c +} + +func (_c *MockControllerServer_DeleteSnapshot_Call) RunAndReturn(run func(context1 context.Context, deleteSnapshotRequest *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)) *MockControllerServer_DeleteSnapshot_Call { + _c.Call.Return(run) + return _c +} + +// DeleteVolume provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) DeleteVolume(context1 context.Context, deleteVolumeRequest *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) { + ret := _mock.Called(context1, deleteVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for DeleteVolume") + } + + var r0 *csi.DeleteVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)); ok { + return returnFunc(context1, deleteVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.DeleteVolumeRequest) *csi.DeleteVolumeResponse); ok { + r0 = returnFunc(context1, deleteVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.DeleteVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.DeleteVolumeRequest) error); ok { + r1 = returnFunc(context1, deleteVolumeRequest) + } 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 +// - context1 context.Context +// - deleteVolumeRequest *csi.DeleteVolumeRequest +func (_e *MockControllerServer_Expecter) DeleteVolume(context1 interface{}, deleteVolumeRequest interface{}) *MockControllerServer_DeleteVolume_Call { + return &MockControllerServer_DeleteVolume_Call{Call: _e.mock.On("DeleteVolume", context1, deleteVolumeRequest)} +} + +func (_c *MockControllerServer_DeleteVolume_Call) Run(run func(context1 context.Context, deleteVolumeRequest *csi.DeleteVolumeRequest)) *MockControllerServer_DeleteVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.DeleteVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.DeleteVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_DeleteVolume_Call) Return(deleteVolumeResponse *csi.DeleteVolumeResponse, err error) *MockControllerServer_DeleteVolume_Call { + _c.Call.Return(deleteVolumeResponse, err) + return _c +} + +func (_c *MockControllerServer_DeleteVolume_Call) RunAndReturn(run func(context1 context.Context, deleteVolumeRequest *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)) *MockControllerServer_DeleteVolume_Call { + _c.Call.Return(run) + return _c +} + +// GetCapacity provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) GetCapacity(context1 context.Context, getCapacityRequest *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) { + ret := _mock.Called(context1, getCapacityRequest) + + if len(ret) == 0 { + panic("no return value specified for GetCapacity") + } + + var r0 *csi.GetCapacityResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)); ok { + return returnFunc(context1, getCapacityRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.GetCapacityRequest) *csi.GetCapacityResponse); ok { + r0 = returnFunc(context1, getCapacityRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.GetCapacityResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.GetCapacityRequest) error); ok { + r1 = returnFunc(context1, getCapacityRequest) + } 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 +// - context1 context.Context +// - getCapacityRequest *csi.GetCapacityRequest +func (_e *MockControllerServer_Expecter) GetCapacity(context1 interface{}, getCapacityRequest interface{}) *MockControllerServer_GetCapacity_Call { + return &MockControllerServer_GetCapacity_Call{Call: _e.mock.On("GetCapacity", context1, getCapacityRequest)} +} + +func (_c *MockControllerServer_GetCapacity_Call) Run(run func(context1 context.Context, getCapacityRequest *csi.GetCapacityRequest)) *MockControllerServer_GetCapacity_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.GetCapacityRequest + if args[1] != nil { + arg1 = args[1].(*csi.GetCapacityRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_GetCapacity_Call) Return(getCapacityResponse *csi.GetCapacityResponse, err error) *MockControllerServer_GetCapacity_Call { + _c.Call.Return(getCapacityResponse, err) + return _c +} + +func (_c *MockControllerServer_GetCapacity_Call) RunAndReturn(run func(context1 context.Context, getCapacityRequest *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)) *MockControllerServer_GetCapacity_Call { + _c.Call.Return(run) + return _c +} + +// ListSnapshots provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ListSnapshots(context1 context.Context, listSnapshotsRequest *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) { + ret := _mock.Called(context1, listSnapshotsRequest) + + if len(ret) == 0 { + panic("no return value specified for ListSnapshots") + } + + var r0 *csi.ListSnapshotsResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)); ok { + return returnFunc(context1, listSnapshotsRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ListSnapshotsRequest) *csi.ListSnapshotsResponse); ok { + r0 = returnFunc(context1, listSnapshotsRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ListSnapshotsResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ListSnapshotsRequest) error); ok { + r1 = returnFunc(context1, listSnapshotsRequest) + } 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 +// - context1 context.Context +// - listSnapshotsRequest *csi.ListSnapshotsRequest +func (_e *MockControllerServer_Expecter) ListSnapshots(context1 interface{}, listSnapshotsRequest interface{}) *MockControllerServer_ListSnapshots_Call { + return &MockControllerServer_ListSnapshots_Call{Call: _e.mock.On("ListSnapshots", context1, listSnapshotsRequest)} +} + +func (_c *MockControllerServer_ListSnapshots_Call) Run(run func(context1 context.Context, listSnapshotsRequest *csi.ListSnapshotsRequest)) *MockControllerServer_ListSnapshots_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ListSnapshotsRequest + if args[1] != nil { + arg1 = args[1].(*csi.ListSnapshotsRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ListSnapshots_Call) Return(listSnapshotsResponse *csi.ListSnapshotsResponse, err error) *MockControllerServer_ListSnapshots_Call { + _c.Call.Return(listSnapshotsResponse, err) + return _c +} + +func (_c *MockControllerServer_ListSnapshots_Call) RunAndReturn(run func(context1 context.Context, listSnapshotsRequest *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)) *MockControllerServer_ListSnapshots_Call { + _c.Call.Return(run) + return _c +} + +// ListVolumes provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ListVolumes(context1 context.Context, listVolumesRequest *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) { + ret := _mock.Called(context1, listVolumesRequest) + + if len(ret) == 0 { + panic("no return value specified for ListVolumes") + } + + var r0 *csi.ListVolumesResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)); ok { + return returnFunc(context1, listVolumesRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ListVolumesRequest) *csi.ListVolumesResponse); ok { + r0 = returnFunc(context1, listVolumesRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ListVolumesResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ListVolumesRequest) error); ok { + r1 = returnFunc(context1, listVolumesRequest) + } 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 +// - context1 context.Context +// - listVolumesRequest *csi.ListVolumesRequest +func (_e *MockControllerServer_Expecter) ListVolumes(context1 interface{}, listVolumesRequest interface{}) *MockControllerServer_ListVolumes_Call { + return &MockControllerServer_ListVolumes_Call{Call: _e.mock.On("ListVolumes", context1, listVolumesRequest)} +} + +func (_c *MockControllerServer_ListVolumes_Call) Run(run func(context1 context.Context, listVolumesRequest *csi.ListVolumesRequest)) *MockControllerServer_ListVolumes_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ListVolumesRequest + if args[1] != nil { + arg1 = args[1].(*csi.ListVolumesRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ListVolumes_Call) Return(listVolumesResponse *csi.ListVolumesResponse, err error) *MockControllerServer_ListVolumes_Call { + _c.Call.Return(listVolumesResponse, err) + return _c +} + +func (_c *MockControllerServer_ListVolumes_Call) RunAndReturn(run func(context1 context.Context, listVolumesRequest *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)) *MockControllerServer_ListVolumes_Call { + _c.Call.Return(run) + return _c +} + +// ValidateVolumeCapabilities provides a mock function for the type MockControllerServer +func (_mock *MockControllerServer) ValidateVolumeCapabilities(context1 context.Context, validateVolumeCapabilitiesRequest *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) { + ret := _mock.Called(context1, validateVolumeCapabilitiesRequest) + + if len(ret) == 0 { + panic("no return value specified for ValidateVolumeCapabilities") + } + + var r0 *csi.ValidateVolumeCapabilitiesResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)); ok { + return returnFunc(context1, validateVolumeCapabilitiesRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.ValidateVolumeCapabilitiesRequest) *csi.ValidateVolumeCapabilitiesResponse); ok { + r0 = returnFunc(context1, validateVolumeCapabilitiesRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.ValidateVolumeCapabilitiesResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.ValidateVolumeCapabilitiesRequest) error); ok { + r1 = returnFunc(context1, validateVolumeCapabilitiesRequest) + } 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 +// - context1 context.Context +// - validateVolumeCapabilitiesRequest *csi.ValidateVolumeCapabilitiesRequest +func (_e *MockControllerServer_Expecter) ValidateVolumeCapabilities(context1 interface{}, validateVolumeCapabilitiesRequest interface{}) *MockControllerServer_ValidateVolumeCapabilities_Call { + return &MockControllerServer_ValidateVolumeCapabilities_Call{Call: _e.mock.On("ValidateVolumeCapabilities", context1, validateVolumeCapabilitiesRequest)} +} + +func (_c *MockControllerServer_ValidateVolumeCapabilities_Call) Run(run func(context1 context.Context, validateVolumeCapabilitiesRequest *csi.ValidateVolumeCapabilitiesRequest)) *MockControllerServer_ValidateVolumeCapabilities_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.ValidateVolumeCapabilitiesRequest + if args[1] != nil { + arg1 = args[1].(*csi.ValidateVolumeCapabilitiesRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockControllerServer_ValidateVolumeCapabilities_Call) Return(validateVolumeCapabilitiesResponse *csi.ValidateVolumeCapabilitiesResponse, err error) *MockControllerServer_ValidateVolumeCapabilities_Call { + _c.Call.Return(validateVolumeCapabilitiesResponse, err) + return _c +} + +func (_c *MockControllerServer_ValidateVolumeCapabilities_Call) RunAndReturn(run func(context1 context.Context, validateVolumeCapabilitiesRequest *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)) *MockControllerServer_ValidateVolumeCapabilities_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 +} + +// 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 for the type MockNodeServer +func (_mock *MockNodeServer) NodeExpandVolume(context1 context.Context, nodeExpandVolumeRequest *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) { + ret := _mock.Called(context1, nodeExpandVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for NodeExpandVolume") + } + + var r0 *csi.NodeExpandVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)); ok { + return returnFunc(context1, nodeExpandVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeExpandVolumeRequest) *csi.NodeExpandVolumeResponse); ok { + r0 = returnFunc(context1, nodeExpandVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodeExpandVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodeExpandVolumeRequest) error); ok { + r1 = returnFunc(context1, nodeExpandVolumeRequest) + } 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 +// - context1 context.Context +// - nodeExpandVolumeRequest *csi.NodeExpandVolumeRequest +func (_e *MockNodeServer_Expecter) NodeExpandVolume(context1 interface{}, nodeExpandVolumeRequest interface{}) *MockNodeServer_NodeExpandVolume_Call { + return &MockNodeServer_NodeExpandVolume_Call{Call: _e.mock.On("NodeExpandVolume", context1, nodeExpandVolumeRequest)} +} + +func (_c *MockNodeServer_NodeExpandVolume_Call) Run(run func(context1 context.Context, nodeExpandVolumeRequest *csi.NodeExpandVolumeRequest)) *MockNodeServer_NodeExpandVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodeExpandVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodeExpandVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodeExpandVolume_Call) Return(nodeExpandVolumeResponse *csi.NodeExpandVolumeResponse, err error) *MockNodeServer_NodeExpandVolume_Call { + _c.Call.Return(nodeExpandVolumeResponse, err) + return _c +} + +func (_c *MockNodeServer_NodeExpandVolume_Call) RunAndReturn(run func(context1 context.Context, nodeExpandVolumeRequest *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)) *MockNodeServer_NodeExpandVolume_Call { + _c.Call.Return(run) + return _c +} + +// NodeGetCapabilities provides a mock function for the type MockNodeServer +func (_mock *MockNodeServer) NodeGetCapabilities(context1 context.Context, nodeGetCapabilitiesRequest *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) { + ret := _mock.Called(context1, nodeGetCapabilitiesRequest) + + if len(ret) == 0 { + panic("no return value specified for NodeGetCapabilities") + } + + var r0 *csi.NodeGetCapabilitiesResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)); ok { + return returnFunc(context1, nodeGetCapabilitiesRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeGetCapabilitiesRequest) *csi.NodeGetCapabilitiesResponse); ok { + r0 = returnFunc(context1, nodeGetCapabilitiesRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodeGetCapabilitiesResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodeGetCapabilitiesRequest) error); ok { + r1 = returnFunc(context1, nodeGetCapabilitiesRequest) + } 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 +// - context1 context.Context +// - nodeGetCapabilitiesRequest *csi.NodeGetCapabilitiesRequest +func (_e *MockNodeServer_Expecter) NodeGetCapabilities(context1 interface{}, nodeGetCapabilitiesRequest interface{}) *MockNodeServer_NodeGetCapabilities_Call { + return &MockNodeServer_NodeGetCapabilities_Call{Call: _e.mock.On("NodeGetCapabilities", context1, nodeGetCapabilitiesRequest)} +} + +func (_c *MockNodeServer_NodeGetCapabilities_Call) Run(run func(context1 context.Context, nodeGetCapabilitiesRequest *csi.NodeGetCapabilitiesRequest)) *MockNodeServer_NodeGetCapabilities_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodeGetCapabilitiesRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodeGetCapabilitiesRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodeGetCapabilities_Call) Return(nodeGetCapabilitiesResponse *csi.NodeGetCapabilitiesResponse, err error) *MockNodeServer_NodeGetCapabilities_Call { + _c.Call.Return(nodeGetCapabilitiesResponse, err) + return _c +} + +func (_c *MockNodeServer_NodeGetCapabilities_Call) RunAndReturn(run func(context1 context.Context, nodeGetCapabilitiesRequest *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)) *MockNodeServer_NodeGetCapabilities_Call { + _c.Call.Return(run) + return _c +} + +// NodeGetInfo provides a mock function for the type MockNodeServer +func (_mock *MockNodeServer) NodeGetInfo(context1 context.Context, nodeGetInfoRequest *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) { + ret := _mock.Called(context1, nodeGetInfoRequest) + + if len(ret) == 0 { + panic("no return value specified for NodeGetInfo") + } + + var r0 *csi.NodeGetInfoResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)); ok { + return returnFunc(context1, nodeGetInfoRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeGetInfoRequest) *csi.NodeGetInfoResponse); ok { + r0 = returnFunc(context1, nodeGetInfoRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodeGetInfoResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodeGetInfoRequest) error); ok { + r1 = returnFunc(context1, nodeGetInfoRequest) + } 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 +// - context1 context.Context +// - nodeGetInfoRequest *csi.NodeGetInfoRequest +func (_e *MockNodeServer_Expecter) NodeGetInfo(context1 interface{}, nodeGetInfoRequest interface{}) *MockNodeServer_NodeGetInfo_Call { + return &MockNodeServer_NodeGetInfo_Call{Call: _e.mock.On("NodeGetInfo", context1, nodeGetInfoRequest)} +} + +func (_c *MockNodeServer_NodeGetInfo_Call) Run(run func(context1 context.Context, nodeGetInfoRequest *csi.NodeGetInfoRequest)) *MockNodeServer_NodeGetInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodeGetInfoRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodeGetInfoRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodeGetInfo_Call) Return(nodeGetInfoResponse *csi.NodeGetInfoResponse, err error) *MockNodeServer_NodeGetInfo_Call { + _c.Call.Return(nodeGetInfoResponse, err) + return _c +} + +func (_c *MockNodeServer_NodeGetInfo_Call) RunAndReturn(run func(context1 context.Context, nodeGetInfoRequest *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)) *MockNodeServer_NodeGetInfo_Call { + _c.Call.Return(run) + return _c +} + +// NodeGetVolumeStats provides a mock function for the type MockNodeServer +func (_mock *MockNodeServer) NodeGetVolumeStats(context1 context.Context, nodeGetVolumeStatsRequest *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) { + ret := _mock.Called(context1, nodeGetVolumeStatsRequest) + + if len(ret) == 0 { + panic("no return value specified for NodeGetVolumeStats") + } + + var r0 *csi.NodeGetVolumeStatsResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)); ok { + return returnFunc(context1, nodeGetVolumeStatsRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeGetVolumeStatsRequest) *csi.NodeGetVolumeStatsResponse); ok { + r0 = returnFunc(context1, nodeGetVolumeStatsRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodeGetVolumeStatsResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodeGetVolumeStatsRequest) error); ok { + r1 = returnFunc(context1, nodeGetVolumeStatsRequest) + } 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 +// - context1 context.Context +// - nodeGetVolumeStatsRequest *csi.NodeGetVolumeStatsRequest +func (_e *MockNodeServer_Expecter) NodeGetVolumeStats(context1 interface{}, nodeGetVolumeStatsRequest interface{}) *MockNodeServer_NodeGetVolumeStats_Call { + return &MockNodeServer_NodeGetVolumeStats_Call{Call: _e.mock.On("NodeGetVolumeStats", context1, nodeGetVolumeStatsRequest)} +} + +func (_c *MockNodeServer_NodeGetVolumeStats_Call) Run(run func(context1 context.Context, nodeGetVolumeStatsRequest *csi.NodeGetVolumeStatsRequest)) *MockNodeServer_NodeGetVolumeStats_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodeGetVolumeStatsRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodeGetVolumeStatsRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodeGetVolumeStats_Call) Return(nodeGetVolumeStatsResponse *csi.NodeGetVolumeStatsResponse, err error) *MockNodeServer_NodeGetVolumeStats_Call { + _c.Call.Return(nodeGetVolumeStatsResponse, err) + return _c +} + +func (_c *MockNodeServer_NodeGetVolumeStats_Call) RunAndReturn(run func(context1 context.Context, nodeGetVolumeStatsRequest *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)) *MockNodeServer_NodeGetVolumeStats_Call { + _c.Call.Return(run) + return _c +} + +// NodePublishVolume provides a mock function for the type MockNodeServer +func (_mock *MockNodeServer) NodePublishVolume(context1 context.Context, nodePublishVolumeRequest *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { + ret := _mock.Called(context1, nodePublishVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for NodePublishVolume") + } + + var r0 *csi.NodePublishVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)); ok { + return returnFunc(context1, nodePublishVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodePublishVolumeRequest) *csi.NodePublishVolumeResponse); ok { + r0 = returnFunc(context1, nodePublishVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodePublishVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodePublishVolumeRequest) error); ok { + r1 = returnFunc(context1, nodePublishVolumeRequest) + } 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 +// - context1 context.Context +// - nodePublishVolumeRequest *csi.NodePublishVolumeRequest +func (_e *MockNodeServer_Expecter) NodePublishVolume(context1 interface{}, nodePublishVolumeRequest interface{}) *MockNodeServer_NodePublishVolume_Call { + return &MockNodeServer_NodePublishVolume_Call{Call: _e.mock.On("NodePublishVolume", context1, nodePublishVolumeRequest)} +} + +func (_c *MockNodeServer_NodePublishVolume_Call) Run(run func(context1 context.Context, nodePublishVolumeRequest *csi.NodePublishVolumeRequest)) *MockNodeServer_NodePublishVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodePublishVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodePublishVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodePublishVolume_Call) Return(nodePublishVolumeResponse *csi.NodePublishVolumeResponse, err error) *MockNodeServer_NodePublishVolume_Call { + _c.Call.Return(nodePublishVolumeResponse, err) + return _c +} + +func (_c *MockNodeServer_NodePublishVolume_Call) RunAndReturn(run func(context1 context.Context, nodePublishVolumeRequest *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)) *MockNodeServer_NodePublishVolume_Call { + _c.Call.Return(run) + return _c +} + +// NodeStageVolume provides a mock function for the type MockNodeServer +func (_mock *MockNodeServer) NodeStageVolume(context1 context.Context, nodeStageVolumeRequest *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { + ret := _mock.Called(context1, nodeStageVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for NodeStageVolume") + } + + var r0 *csi.NodeStageVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)); ok { + return returnFunc(context1, nodeStageVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeStageVolumeRequest) *csi.NodeStageVolumeResponse); ok { + r0 = returnFunc(context1, nodeStageVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodeStageVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodeStageVolumeRequest) error); ok { + r1 = returnFunc(context1, nodeStageVolumeRequest) + } 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 +// - context1 context.Context +// - nodeStageVolumeRequest *csi.NodeStageVolumeRequest +func (_e *MockNodeServer_Expecter) NodeStageVolume(context1 interface{}, nodeStageVolumeRequest interface{}) *MockNodeServer_NodeStageVolume_Call { + return &MockNodeServer_NodeStageVolume_Call{Call: _e.mock.On("NodeStageVolume", context1, nodeStageVolumeRequest)} +} + +func (_c *MockNodeServer_NodeStageVolume_Call) Run(run func(context1 context.Context, nodeStageVolumeRequest *csi.NodeStageVolumeRequest)) *MockNodeServer_NodeStageVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodeStageVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodeStageVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodeStageVolume_Call) Return(nodeStageVolumeResponse *csi.NodeStageVolumeResponse, err error) *MockNodeServer_NodeStageVolume_Call { + _c.Call.Return(nodeStageVolumeResponse, err) + return _c +} + +func (_c *MockNodeServer_NodeStageVolume_Call) RunAndReturn(run func(context1 context.Context, nodeStageVolumeRequest *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)) *MockNodeServer_NodeStageVolume_Call { + _c.Call.Return(run) + return _c +} + +// NodeUnpublishVolume provides a mock function for the type MockNodeServer +func (_mock *MockNodeServer) NodeUnpublishVolume(context1 context.Context, nodeUnpublishVolumeRequest *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) { + ret := _mock.Called(context1, nodeUnpublishVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for NodeUnpublishVolume") + } + + var r0 *csi.NodeUnpublishVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)); ok { + return returnFunc(context1, nodeUnpublishVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeUnpublishVolumeRequest) *csi.NodeUnpublishVolumeResponse); ok { + r0 = returnFunc(context1, nodeUnpublishVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodeUnpublishVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodeUnpublishVolumeRequest) error); ok { + r1 = returnFunc(context1, nodeUnpublishVolumeRequest) + } 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 +// - context1 context.Context +// - nodeUnpublishVolumeRequest *csi.NodeUnpublishVolumeRequest +func (_e *MockNodeServer_Expecter) NodeUnpublishVolume(context1 interface{}, nodeUnpublishVolumeRequest interface{}) *MockNodeServer_NodeUnpublishVolume_Call { + return &MockNodeServer_NodeUnpublishVolume_Call{Call: _e.mock.On("NodeUnpublishVolume", context1, nodeUnpublishVolumeRequest)} +} + +func (_c *MockNodeServer_NodeUnpublishVolume_Call) Run(run func(context1 context.Context, nodeUnpublishVolumeRequest *csi.NodeUnpublishVolumeRequest)) *MockNodeServer_NodeUnpublishVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodeUnpublishVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodeUnpublishVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodeUnpublishVolume_Call) Return(nodeUnpublishVolumeResponse *csi.NodeUnpublishVolumeResponse, err error) *MockNodeServer_NodeUnpublishVolume_Call { + _c.Call.Return(nodeUnpublishVolumeResponse, err) + return _c +} + +func (_c *MockNodeServer_NodeUnpublishVolume_Call) RunAndReturn(run func(context1 context.Context, nodeUnpublishVolumeRequest *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)) *MockNodeServer_NodeUnpublishVolume_Call { + _c.Call.Return(run) + return _c +} + +// NodeUnstageVolume provides a mock function for the type MockNodeServer +func (_mock *MockNodeServer) NodeUnstageVolume(context1 context.Context, nodeUnstageVolumeRequest *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { + ret := _mock.Called(context1, nodeUnstageVolumeRequest) + + if len(ret) == 0 { + panic("no return value specified for NodeUnstageVolume") + } + + var r0 *csi.NodeUnstageVolumeResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)); ok { + return returnFunc(context1, nodeUnstageVolumeRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *csi.NodeUnstageVolumeRequest) *csi.NodeUnstageVolumeResponse); ok { + r0 = returnFunc(context1, nodeUnstageVolumeRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csi.NodeUnstageVolumeResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *csi.NodeUnstageVolumeRequest) error); ok { + r1 = returnFunc(context1, nodeUnstageVolumeRequest) + } 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 +// - context1 context.Context +// - nodeUnstageVolumeRequest *csi.NodeUnstageVolumeRequest +func (_e *MockNodeServer_Expecter) NodeUnstageVolume(context1 interface{}, nodeUnstageVolumeRequest interface{}) *MockNodeServer_NodeUnstageVolume_Call { + return &MockNodeServer_NodeUnstageVolume_Call{Call: _e.mock.On("NodeUnstageVolume", context1, nodeUnstageVolumeRequest)} +} + +func (_c *MockNodeServer_NodeUnstageVolume_Call) Run(run func(context1 context.Context, nodeUnstageVolumeRequest *csi.NodeUnstageVolumeRequest)) *MockNodeServer_NodeUnstageVolume_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *csi.NodeUnstageVolumeRequest + if args[1] != nil { + arg1 = args[1].(*csi.NodeUnstageVolumeRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockNodeServer_NodeUnstageVolume_Call) Return(nodeUnstageVolumeResponse *csi.NodeUnstageVolumeResponse, err error) *MockNodeServer_NodeUnstageVolume_Call { + _c.Call.Return(nodeUnstageVolumeResponse, err) + return _c +} + +func (_c *MockNodeServer_NodeUnstageVolume_Call) RunAndReturn(run func(context1 context.Context, nodeUnstageVolumeRequest *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)) *MockNodeServer_NodeUnstageVolume_Call { + _c.Call.Return(run) + return _c +} diff --git a/test/utils/oidc/handlers/.mockery.yaml b/test/utils/oidc/handlers/.mockery.yaml index 8895054d2b7..66925b365c0 100644 --- a/test/utils/oidc/handlers/.mockery.yaml +++ b/test/utils/oidc/handlers/.mockery.yaml @@ -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: {} diff --git a/test/utils/oidc/handlers/mock_jwks_handler.go b/test/utils/oidc/handlers/mock_jwks_handler.go deleted file mode 100644 index c1955493c73..00000000000 --- a/test/utils/oidc/handlers/mock_jwks_handler.go +++ /dev/null @@ -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 -} diff --git a/test/utils/oidc/handlers/mock_token_handler.go b/test/utils/oidc/handlers/mock_token_handler.go deleted file mode 100644 index 532408d77db..00000000000 --- a/test/utils/oidc/handlers/mock_token_handler.go +++ /dev/null @@ -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 -} diff --git a/test/utils/oidc/handlers/mocks.go b/test/utils/oidc/handlers/mocks.go new file mode 100644 index 00000000000..1e6ae20a62c --- /dev/null +++ b/test/utils/oidc/handlers/mocks.go @@ -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 +}