From 682996fd356d3aa24c62cb6da3d220b6a34d7bb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 15:40:30 +0000 Subject: [PATCH 1/5] Bump sigs.k8s.io/controller-runtime from 0.18.4 to 0.20.4 Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.18.4 to 0.20.4. - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.18.4...v0.20.4) --- updated-dependencies: - dependency-name: sigs.k8s.io/controller-runtime dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 36 +++++++++----------- go.sum | 104 ++++++++++++++++++++++++++------------------------------- 2 files changed, 63 insertions(+), 77 deletions(-) diff --git a/go.mod b/go.mod index cba2b03..d70dbf6 100644 --- a/go.mod +++ b/go.mod @@ -5,28 +5,24 @@ go 1.24.0 require ( github.com/google/go-cmp v0.7.0 github.com/stretchr/testify v1.10.0 - k8s.io/api v0.30.2 - k8s.io/apimachinery v0.31.3 - k8s.io/client-go v0.30.2 - k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.18.4 + k8s.io/api v0.33.0 + k8s.io/apimachinery v0.33.0 + k8s.io/client-go v0.33.0 + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 + sigs.k8s.io/controller-runtime v0.21.0 ) require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect - github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/google/gnostic-models v0.6.8 // indirect - github.com/google/gofuzz v1.2.0 // indirect + github.com/google/gnostic-models v0.6.9 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -38,19 +34,19 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/x448/float16 v0.8.4 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/oauth2 v0.27.0 // indirect golang.org/x/sys v0.31.0 // indirect golang.org/x/term v0.30.0 // indirect golang.org/x/text v0.23.0 // indirect - golang.org/x/time v0.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.34.2 // indirect + golang.org/x/time v0.9.0 // indirect + google.golang.org/protobuf v1.36.5 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 78575d9..08525cf 100644 --- a/go.sum +++ b/go.sum @@ -5,43 +5,34 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -64,22 +55,24 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= -github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= +github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw= +github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +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= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -92,22 +85,21 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= +golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -119,55 +111,53 @@ golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= 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.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= 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-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= -k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= -k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= -k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= -k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/api v0.33.0 h1:yTgZVn1XEe6opVpP1FylmNrIFWuDqe2H0V8CT5gxfIU= +k8s.io/api v0.33.0/go.mod h1:CTO61ECK/KU7haa3qq8sarQ0biLq2ju405IZAd9zsiM= +k8s.io/apimachinery v0.33.0 h1:1a6kHrJxb2hs4t8EE5wuR/WxKDwGN1FKH3JvDtA0CIQ= +k8s.io/apimachinery v0.33.0/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/client-go v0.33.0 h1:UASR0sAYVUzs2kYuKn/ZakZlcs2bEHaizrrHUZg0G98= +k8s.io/client-go v0.33.0/go.mod h1:kGkd+l/gNGg8GYWAPr0xF1rRKvVWvzh9vmZAMXtaKOg= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= -sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8= +sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From 0d76983904b7bed25609917dee48380034823db3 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Fri, 20 Jun 2025 11:51:14 -0400 Subject: [PATCH 2/5] use SearchWithContext --- pkg/preflight/validate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/preflight/validate.go b/pkg/preflight/validate.go index ee0ab88..8ed8096 100644 --- a/pkg/preflight/validate.go +++ b/pkg/preflight/validate.go @@ -270,7 +270,7 @@ func checkVolumeAccessModes(ctx context.Context, l *log.Logger, client k8sclient // but the pod has not been scheduled yet, nor have container images been pulled from the registry. if gotPod.Status.Phase == corev1.PodPending { // check pvc status and get error - pvcPendingError, err := getPVCError(client, tmpPVC) + pvcPendingError, err := getPVCError(ctx, client, tmpPVC) if err != nil { return nil, fmt.Errorf("failed to get pvc failure: %w", err) } @@ -356,13 +356,13 @@ func deletePVConsumerPod(client k8sclient.Interface, pod *corev1.Pod) error { } // getPVCError returns the failure event for why a PVC is in Pending status -func getPVCError(client k8sclient.Interface, pvc *corev1.PersistentVolumeClaim) (*pvcFailure, error) { +func getPVCError(ctx context.Context, client k8sclient.Interface, pvc *corev1.PersistentVolumeClaim) (*pvcFailure, error) { // no need to inspect pvc if it's NOT in Pending phase if pvc.Status.Phase != corev1.ClaimPending { return nil, fmt.Errorf("PVC %s is not in Pending status", pvc.Name) } - pvcEvents, err := client.CoreV1().Events(pvc.Namespace).Search(scheme.Scheme, pvc) + pvcEvents, err := client.CoreV1().Events(pvc.Namespace).SearchWithContext(ctx, scheme.Scheme, pvc) if err != nil { return nil, fmt.Errorf("failed to list events for PVC %s: %w", pvc.Name, err) } From 904cc8a75fd9b93a8c147def72ac24bd0f4c8e45 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Fri, 20 Jun 2025 11:55:19 -0400 Subject: [PATCH 3/5] use t.Context, pass context to search call --- pkg/migrate/migrate_test.go | 32 ++++++++++++++++---------------- pkg/preflight/validate_test.go | 16 ++++++++-------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pkg/migrate/migrate_test.go b/pkg/migrate/migrate_test.go index 149505b..56530ce 100644 --- a/pkg/migrate/migrate_test.go +++ b/pkg/migrate/migrate_test.go @@ -202,7 +202,7 @@ func TestScaleUpPods(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := scaleUpPods(context.Background(), testlog, clientset, test.namespaces) + err := scaleUpPods(t.Context(), testlog, clientset, test.namespaces) req.NoError(err) err = test.validate(clientset, t) @@ -261,7 +261,7 @@ func TestMutatePV(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := mutatePV(context.Background(), testlog, clientset, test.pvname, test.ttmutator, test.ttchecker) + err := mutatePV(t.Context(), testlog, clientset, test.pvname, test.ttmutator, test.ttchecker) req.NoError(err) err = test.validate(clientset, t) @@ -343,7 +343,7 @@ func TestValidateStorageClasses(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := validateStorageClasses(context.Background(), testlog, clientset, test.sourceSC, test.destSC, test.skipSourceValidation) + err := validateStorageClasses(t.Context(), testlog, clientset, test.sourceSC, test.destSC, test.skipSourceValidation) if !test.wantErr { req.NoError(err) } else { @@ -895,7 +895,7 @@ func TestGetPVCs(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - originalPVCs, nses, err := getPVCs(context.Background(), testlog, clientset, test.sourceScName, test.destScName, test.namespace) + originalPVCs, nses, err := getPVCs(t.Context(), testlog, clientset, test.sourceScName, test.destScName, test.namespace) if !test.wantErr { req.NoError(err) } else { @@ -1266,7 +1266,7 @@ func Test_createMigrationPod(t *testing.T) { tt.setGlobalFunc() } - got, err := createMigrationPod(context.Background(), clientset, tt.args.ns, tt.args.sourcePvcName, tt.args.destPvcName, tt.args.rsyncImage, tt.args.nodeName, tt.args.rsyncFlags) + got, err := createMigrationPod(t.Context(), clientset, tt.args.ns, tt.args.sourcePvcName, tt.args.destPvcName, tt.args.rsyncImage, tt.args.nodeName, tt.args.rsyncFlags) if tt.clearGlobalFunc != nil { tt.clearGlobalFunc() @@ -1816,21 +1816,21 @@ func Test_swapPVs(t *testing.T) { testlog := log.New(testWriter{t: t}, "", 0) if tt.backgroundFunc != nil { - go tt.backgroundFunc(context.Background(), testlog, clientset) + go tt.backgroundFunc(t.Context(), testlog, clientset) } - err := swapPVs(context.Background(), testlog, clientset, tt.ns, tt.pvcName) + err := swapPVs(t.Context(), testlog, clientset, tt.ns, tt.pvcName) if tt.wantErr { req.Error(err) return } req.NoError(err) - finalPVs, err := clientset.CoreV1().PersistentVolumes().List(context.Background(), metav1.ListOptions{}) + finalPVs, err := clientset.CoreV1().PersistentVolumes().List(t.Context(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantPVs, finalPVs.Items) - finalPVCs, err := clientset.CoreV1().PersistentVolumeClaims(tt.ns).List(context.Background(), metav1.ListOptions{}) + finalPVCs, err := clientset.CoreV1().PersistentVolumeClaims(tt.ns).List(t.Context(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantPVCs, finalPVCs.Items) }) @@ -2009,14 +2009,14 @@ func Test_resetReclaimPolicy(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := resetReclaimPolicy(context.Background(), testlog, clientset, tt.pv, tt.reclaim) + err := resetReclaimPolicy(t.Context(), testlog, clientset, tt.pv, tt.reclaim) if tt.wantErr { req.Error(err) return } req.NoError(err) - finalPVs, err := clientset.CoreV1().PersistentVolumes().List(context.Background(), metav1.ListOptions{}) + finalPVs, err := clientset.CoreV1().PersistentVolumes().List(t.Context(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantPVs, finalPVs.Items) }) @@ -2762,7 +2762,7 @@ func Test_scaleDownPods(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Minute) // if your test takes more than 1m, there are issues + testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Minute) // if your test takes more than 1m, there are issues defer cancelfunc() clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) @@ -3158,7 +3158,7 @@ func Test_swapDefaults(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := swapDefaultStorageClasses(context.Background(), testlog, clientset, tt.oldDefaultSC, tt.newDefaultSC) + err := swapDefaultStorageClasses(t.Context(), testlog, clientset, tt.oldDefaultSC, tt.newDefaultSC) if tt.wantErr { req.Error(err) testlog.Printf("Got expected error %s", err.Error()) @@ -3166,7 +3166,7 @@ func Test_swapDefaults(t *testing.T) { } req.NoError(err) - finalSCs, err := clientset.StorageV1().StorageClasses().List(context.Background(), metav1.ListOptions{}) + finalSCs, err := clientset.StorageV1().StorageClasses().List(t.Context(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantSCs, finalSCs.Items) }) @@ -3194,7 +3194,7 @@ func Test_waitForDeletion(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Minute) // if your test takes more than 1m, there are issues + testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Minute) // if your test takes more than 1m, there are issues defer cancelfunc() clientset := fake.NewSimpleClientset( []runtime.Object{ @@ -3442,7 +3442,7 @@ func Test_copyAllPVCs(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Second*10) // if your test takes more than 10s, there are issues + testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Second*10) // if your test takes more than 10s, there are issues defer cancelfunc() clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) diff --git a/pkg/preflight/validate_test.go b/pkg/preflight/validate_test.go index 2728fbb..c20c970 100644 --- a/pkg/preflight/validate_test.go +++ b/pkg/preflight/validate_test.go @@ -113,7 +113,7 @@ func Test_validateVolumeAccessModes(t *testing.T) { req := require.New(t) kcli := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) - result, err := validateVolumeAccessModes(context.Background(), logger, kcli, tt.dstSC, "eeacms/rsync:2.3", tt.podReadyTimeout, tt.deletePVTimeout, tt.input) + result, err := validateVolumeAccessModes(t.Context(), logger, kcli, tt.dstSC, "eeacms/rsync:2.3", tt.podReadyTimeout, tt.deletePVTimeout, tt.input) if err != nil { if tt.wantErr { req.Error(err) @@ -292,7 +292,7 @@ func Test_getPvcError(t *testing.T) { t.Run(tt.name, func(t *testing.T) { req := require.New(t) kcli := fake.NewSimpleClientset(tt.resources...) - result, err := getPVCError(kcli, tt.input) + result, err := getPVCError(t.Context(), kcli, tt.input) if err != nil { if tt.wantErr { req.Error(err) @@ -429,14 +429,14 @@ func Test_checkVolumeAccessModes(t *testing.T) { } { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Minute) // if your test takes more than 1m, there are issues + testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Minute) // if your test takes more than 1m, there are issues defer cancelfunc() kcli := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) if tt.backgroundFunc != nil { go tt.backgroundFunc(testCtx, logger, kcli, tt.tmpPodName, "default", "pv-for-pf-pvc-testpvc") } - result, err := checkVolumeAccessModes(context.Background(), logger, kcli, tt.dstStorageClass, *tt.input, tt.podTimeout, tt.deletePVTimeout, "eeacms/rsync:2.3") + result, err := checkVolumeAccessModes(t.Context(), logger, kcli, tt.dstStorageClass, *tt.input, tt.podTimeout, tt.deletePVTimeout, "eeacms/rsync:2.3") if err != nil { if tt.wantErr { req.Error(err) @@ -893,7 +893,7 @@ func Test_pvcsForStorageClass(t *testing.T) { req := require.New(t) kcli := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) - result, err := pvcsForStorageClass(context.Background(), logger, kcli, tt.scname, tt.namespace) + result, err := pvcsForStorageClass(t.Context(), logger, kcli, tt.scname, tt.namespace) if err != nil { if tt.wantErr { req.Error(err) @@ -987,7 +987,7 @@ func Test_validateStorageClasses(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) - result, err := validateStorageClasses(context.Background(), logger, clientset, tt.sourceSC, tt.destSC, tt.skipSourceSCValidation) + result, err := validateStorageClasses(t.Context(), logger, clientset, tt.sourceSC, tt.destSC, tt.skipSourceSCValidation) if !tt.wantErr { req.NoError(err) } else { @@ -1100,7 +1100,7 @@ func Test_deleteTmpPVCs(t *testing.T) { backgroundFunc: func(t *testing.T, kcli k8sclient.Interface) { time.Sleep(6 * time.Second) if err := kcli.CoreV1().PersistentVolumes().Delete( - context.Background(), "pv", metav1.DeleteOptions{}, + t.Context(), "pv", metav1.DeleteOptions{}, ); err != nil { t.Errorf("failed to delete test pv: %s", err) } @@ -1189,7 +1189,7 @@ func Test_deleteTmpPVCs(t *testing.T) { backgroundFunc: func(t *testing.T, kcli k8sclient.Interface) { time.Sleep(6 * time.Second) if err := kcli.CoreV1().PersistentVolumes().Delete( - context.Background(), "pv", metav1.DeleteOptions{}, + t.Context(), "pv", metav1.DeleteOptions{}, ); err != nil { t.Errorf("failed to delete test pv: %s", err) } From c18f8df94d7b48bf4d18b95c26a1739842001a62 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Fri, 20 Jun 2025 12:03:01 -0400 Subject: [PATCH 4/5] Revert "use t.Context, pass context to search call" This reverts commit 904cc8a75fd9b93a8c147def72ac24bd0f4c8e45. --- pkg/migrate/migrate_test.go | 32 ++++++++++++++++---------------- pkg/preflight/validate_test.go | 16 ++++++++-------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pkg/migrate/migrate_test.go b/pkg/migrate/migrate_test.go index 56530ce..149505b 100644 --- a/pkg/migrate/migrate_test.go +++ b/pkg/migrate/migrate_test.go @@ -202,7 +202,7 @@ func TestScaleUpPods(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := scaleUpPods(t.Context(), testlog, clientset, test.namespaces) + err := scaleUpPods(context.Background(), testlog, clientset, test.namespaces) req.NoError(err) err = test.validate(clientset, t) @@ -261,7 +261,7 @@ func TestMutatePV(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := mutatePV(t.Context(), testlog, clientset, test.pvname, test.ttmutator, test.ttchecker) + err := mutatePV(context.Background(), testlog, clientset, test.pvname, test.ttmutator, test.ttchecker) req.NoError(err) err = test.validate(clientset, t) @@ -343,7 +343,7 @@ func TestValidateStorageClasses(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := validateStorageClasses(t.Context(), testlog, clientset, test.sourceSC, test.destSC, test.skipSourceValidation) + err := validateStorageClasses(context.Background(), testlog, clientset, test.sourceSC, test.destSC, test.skipSourceValidation) if !test.wantErr { req.NoError(err) } else { @@ -895,7 +895,7 @@ func TestGetPVCs(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(test.resources...) testlog := log.New(testWriter{t: t}, "", 0) - originalPVCs, nses, err := getPVCs(t.Context(), testlog, clientset, test.sourceScName, test.destScName, test.namespace) + originalPVCs, nses, err := getPVCs(context.Background(), testlog, clientset, test.sourceScName, test.destScName, test.namespace) if !test.wantErr { req.NoError(err) } else { @@ -1266,7 +1266,7 @@ func Test_createMigrationPod(t *testing.T) { tt.setGlobalFunc() } - got, err := createMigrationPod(t.Context(), clientset, tt.args.ns, tt.args.sourcePvcName, tt.args.destPvcName, tt.args.rsyncImage, tt.args.nodeName, tt.args.rsyncFlags) + got, err := createMigrationPod(context.Background(), clientset, tt.args.ns, tt.args.sourcePvcName, tt.args.destPvcName, tt.args.rsyncImage, tt.args.nodeName, tt.args.rsyncFlags) if tt.clearGlobalFunc != nil { tt.clearGlobalFunc() @@ -1816,21 +1816,21 @@ func Test_swapPVs(t *testing.T) { testlog := log.New(testWriter{t: t}, "", 0) if tt.backgroundFunc != nil { - go tt.backgroundFunc(t.Context(), testlog, clientset) + go tt.backgroundFunc(context.Background(), testlog, clientset) } - err := swapPVs(t.Context(), testlog, clientset, tt.ns, tt.pvcName) + err := swapPVs(context.Background(), testlog, clientset, tt.ns, tt.pvcName) if tt.wantErr { req.Error(err) return } req.NoError(err) - finalPVs, err := clientset.CoreV1().PersistentVolumes().List(t.Context(), metav1.ListOptions{}) + finalPVs, err := clientset.CoreV1().PersistentVolumes().List(context.Background(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantPVs, finalPVs.Items) - finalPVCs, err := clientset.CoreV1().PersistentVolumeClaims(tt.ns).List(t.Context(), metav1.ListOptions{}) + finalPVCs, err := clientset.CoreV1().PersistentVolumeClaims(tt.ns).List(context.Background(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantPVCs, finalPVCs.Items) }) @@ -2009,14 +2009,14 @@ func Test_resetReclaimPolicy(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := resetReclaimPolicy(t.Context(), testlog, clientset, tt.pv, tt.reclaim) + err := resetReclaimPolicy(context.Background(), testlog, clientset, tt.pv, tt.reclaim) if tt.wantErr { req.Error(err) return } req.NoError(err) - finalPVs, err := clientset.CoreV1().PersistentVolumes().List(t.Context(), metav1.ListOptions{}) + finalPVs, err := clientset.CoreV1().PersistentVolumes().List(context.Background(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantPVs, finalPVs.Items) }) @@ -2762,7 +2762,7 @@ func Test_scaleDownPods(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Minute) // if your test takes more than 1m, there are issues + testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Minute) // if your test takes more than 1m, there are issues defer cancelfunc() clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) @@ -3158,7 +3158,7 @@ func Test_swapDefaults(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) - err := swapDefaultStorageClasses(t.Context(), testlog, clientset, tt.oldDefaultSC, tt.newDefaultSC) + err := swapDefaultStorageClasses(context.Background(), testlog, clientset, tt.oldDefaultSC, tt.newDefaultSC) if tt.wantErr { req.Error(err) testlog.Printf("Got expected error %s", err.Error()) @@ -3166,7 +3166,7 @@ func Test_swapDefaults(t *testing.T) { } req.NoError(err) - finalSCs, err := clientset.StorageV1().StorageClasses().List(t.Context(), metav1.ListOptions{}) + finalSCs, err := clientset.StorageV1().StorageClasses().List(context.Background(), metav1.ListOptions{}) req.NoError(err) req.Equal(tt.wantSCs, finalSCs.Items) }) @@ -3194,7 +3194,7 @@ func Test_waitForDeletion(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Minute) // if your test takes more than 1m, there are issues + testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Minute) // if your test takes more than 1m, there are issues defer cancelfunc() clientset := fake.NewSimpleClientset( []runtime.Object{ @@ -3442,7 +3442,7 @@ func Test_copyAllPVCs(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Second*10) // if your test takes more than 10s, there are issues + testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Second*10) // if your test takes more than 10s, there are issues defer cancelfunc() clientset := fake.NewSimpleClientset(tt.resources...) testlog := log.New(testWriter{t: t}, "", 0) diff --git a/pkg/preflight/validate_test.go b/pkg/preflight/validate_test.go index c20c970..2728fbb 100644 --- a/pkg/preflight/validate_test.go +++ b/pkg/preflight/validate_test.go @@ -113,7 +113,7 @@ func Test_validateVolumeAccessModes(t *testing.T) { req := require.New(t) kcli := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) - result, err := validateVolumeAccessModes(t.Context(), logger, kcli, tt.dstSC, "eeacms/rsync:2.3", tt.podReadyTimeout, tt.deletePVTimeout, tt.input) + result, err := validateVolumeAccessModes(context.Background(), logger, kcli, tt.dstSC, "eeacms/rsync:2.3", tt.podReadyTimeout, tt.deletePVTimeout, tt.input) if err != nil { if tt.wantErr { req.Error(err) @@ -292,7 +292,7 @@ func Test_getPvcError(t *testing.T) { t.Run(tt.name, func(t *testing.T) { req := require.New(t) kcli := fake.NewSimpleClientset(tt.resources...) - result, err := getPVCError(t.Context(), kcli, tt.input) + result, err := getPVCError(kcli, tt.input) if err != nil { if tt.wantErr { req.Error(err) @@ -429,14 +429,14 @@ func Test_checkVolumeAccessModes(t *testing.T) { } { t.Run(tt.name, func(t *testing.T) { req := require.New(t) - testCtx, cancelfunc := context.WithTimeout(t.Context(), time.Minute) // if your test takes more than 1m, there are issues + testCtx, cancelfunc := context.WithTimeout(context.Background(), time.Minute) // if your test takes more than 1m, there are issues defer cancelfunc() kcli := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) if tt.backgroundFunc != nil { go tt.backgroundFunc(testCtx, logger, kcli, tt.tmpPodName, "default", "pv-for-pf-pvc-testpvc") } - result, err := checkVolumeAccessModes(t.Context(), logger, kcli, tt.dstStorageClass, *tt.input, tt.podTimeout, tt.deletePVTimeout, "eeacms/rsync:2.3") + result, err := checkVolumeAccessModes(context.Background(), logger, kcli, tt.dstStorageClass, *tt.input, tt.podTimeout, tt.deletePVTimeout, "eeacms/rsync:2.3") if err != nil { if tt.wantErr { req.Error(err) @@ -893,7 +893,7 @@ func Test_pvcsForStorageClass(t *testing.T) { req := require.New(t) kcli := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) - result, err := pvcsForStorageClass(t.Context(), logger, kcli, tt.scname, tt.namespace) + result, err := pvcsForStorageClass(context.Background(), logger, kcli, tt.scname, tt.namespace) if err != nil { if tt.wantErr { req.Error(err) @@ -987,7 +987,7 @@ func Test_validateStorageClasses(t *testing.T) { req := require.New(t) clientset := fake.NewSimpleClientset(tt.resources...) logger := log.New(io.Discard, "", 0) - result, err := validateStorageClasses(t.Context(), logger, clientset, tt.sourceSC, tt.destSC, tt.skipSourceSCValidation) + result, err := validateStorageClasses(context.Background(), logger, clientset, tt.sourceSC, tt.destSC, tt.skipSourceSCValidation) if !tt.wantErr { req.NoError(err) } else { @@ -1100,7 +1100,7 @@ func Test_deleteTmpPVCs(t *testing.T) { backgroundFunc: func(t *testing.T, kcli k8sclient.Interface) { time.Sleep(6 * time.Second) if err := kcli.CoreV1().PersistentVolumes().Delete( - t.Context(), "pv", metav1.DeleteOptions{}, + context.Background(), "pv", metav1.DeleteOptions{}, ); err != nil { t.Errorf("failed to delete test pv: %s", err) } @@ -1189,7 +1189,7 @@ func Test_deleteTmpPVCs(t *testing.T) { backgroundFunc: func(t *testing.T, kcli k8sclient.Interface) { time.Sleep(6 * time.Second) if err := kcli.CoreV1().PersistentVolumes().Delete( - t.Context(), "pv", metav1.DeleteOptions{}, + context.Background(), "pv", metav1.DeleteOptions{}, ); err != nil { t.Errorf("failed to delete test pv: %s", err) } From a9370db96ee6707ef442bc798db0cf040c80d816 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Fri, 20 Jun 2025 12:03:30 -0400 Subject: [PATCH 5/5] ? --- pkg/preflight/validate_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/preflight/validate_test.go b/pkg/preflight/validate_test.go index 2728fbb..53e90c1 100644 --- a/pkg/preflight/validate_test.go +++ b/pkg/preflight/validate_test.go @@ -292,7 +292,7 @@ func Test_getPvcError(t *testing.T) { t.Run(tt.name, func(t *testing.T) { req := require.New(t) kcli := fake.NewSimpleClientset(tt.resources...) - result, err := getPVCError(kcli, tt.input) + result, err := getPVCError(context.Background(), kcli, tt.input) if err != nil { if tt.wantErr { req.Error(err)