diff --git a/go.mod b/go.mod index 7292e53fe..c424d9425 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubernetes-csi/external-provisioner/v5 -go 1.22.3 +go 1.22.5 require ( github.com/container-storage-interface/spec v1.9.0 @@ -8,7 +8,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect - github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0 + github.com/kubernetes-csi/csi-lib-utils v0.19.0 github.com/kubernetes-csi/csi-test/v5 v5.2.0 github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0 github.com/miekg/dns v1.1.59 // indirect @@ -17,15 +17,15 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.65.0 google.golang.org/protobuf v1.34.2 - k8s.io/api v0.32.0-alpha.0 - k8s.io/apimachinery v0.32.0-alpha.0 - k8s.io/apiserver v0.31.0-rc.0 - k8s.io/client-go v1.5.2 - k8s.io/component-base v0.31.0-rc.0 - k8s.io/component-helpers v0.31.0-rc.0 - k8s.io/csi-translation-lib v0.29.0 + k8s.io/api v0.31.0 + k8s.io/apimachinery v0.31.0 + k8s.io/apiserver v0.31.0 + k8s.io/client-go v0.31.0 + k8s.io/component-base v0.31.0 + k8s.io/component-helpers v0.31.0 + k8s.io/csi-translation-lib v0.31.0 k8s.io/klog/v2 v2.130.1 - sigs.k8s.io/controller-runtime v0.18.1-0.20240731191308-a39ace352f07 + sigs.k8s.io/controller-runtime v0.19.0 sigs.k8s.io/gateway-api v1.1.0 sigs.k8s.io/sig-storage-lib-external-provisioner/v10 v10.0.1 ) @@ -33,7 +33,7 @@ require ( require ( github.com/onsi/ginkgo/v2 v2.19.0 github.com/onsi/gomega v1.33.1 - k8s.io/kubernetes v1.31.0-rc.0 + k8s.io/kubernetes v1.31.0 ) require ( @@ -126,15 +126,15 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.32.0-alpha.0 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect k8s.io/cloud-provider v0.30.0 // indirect - k8s.io/controller-manager v0.31.0-rc.0 // indirect - k8s.io/kms v0.31.0-rc.0 // indirect + k8s.io/controller-manager v0.31.0 // indirect + k8s.io/kms v0.31.0 // indirect k8s.io/kube-openapi v0.0.0-20240730131305-7a9a4e85957e // indirect - k8s.io/kubectl v0.27.0 // indirect - k8s.io/kubelet v0.27.0 // indirect - k8s.io/mount-utils v0.27.0 // indirect - k8s.io/pod-security-admission v0.27.0 // indirect + k8s.io/kubectl v0.31.0 // indirect + k8s.io/kubelet v0.31.0 // indirect + k8s.io/mount-utils v0.31.0 // indirect + k8s.io/pod-security-admission v0.31.0 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect @@ -142,58 +142,60 @@ require ( sigs.k8s.io/yaml v1.4.0 // indirect ) -replace k8s.io/api => k8s.io/api v0.31.0-rc.0 +replace k8s.io/api => k8s.io/api v0.31.0 -replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.31.0-rc.0 +replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.31.0 -replace k8s.io/apimachinery => k8s.io/apimachinery v0.31.0-rc.0 +replace k8s.io/apimachinery => k8s.io/apimachinery v0.31.0 -replace k8s.io/apiserver => k8s.io/apiserver v0.31.0-rc.0 +replace k8s.io/apiserver => k8s.io/apiserver v0.31.0 -replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.31.0-rc.0 +replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.31.0 -replace k8s.io/client-go => k8s.io/client-go v0.31.0-rc.0 +replace k8s.io/client-go => k8s.io/client-go v0.31.0 -replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.31.0-rc.0 +replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.31.0 -replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.31.0-rc.0 +replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.31.0 -replace k8s.io/code-generator => k8s.io/code-generator v0.31.0-rc.0 +replace k8s.io/code-generator => k8s.io/code-generator v0.31.0 -replace k8s.io/component-base => k8s.io/component-base v0.31.0-rc.0 +replace k8s.io/component-base => k8s.io/component-base v0.31.0 -replace k8s.io/component-helpers => k8s.io/component-helpers v0.31.0-rc.0 +replace k8s.io/component-helpers => k8s.io/component-helpers v0.31.0 -replace k8s.io/controller-manager => k8s.io/controller-manager v0.31.0-rc.0 +replace k8s.io/controller-manager => k8s.io/controller-manager v0.31.0 -replace k8s.io/cri-api => k8s.io/cri-api v0.31.0-rc.0 +replace k8s.io/cri-api => k8s.io/cri-api v0.31.0 -replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.31.0-rc.0 +replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.31.0 -replace k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.31.0-rc.0 +replace k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.31.0 -replace k8s.io/endpointslice => k8s.io/endpointslice v0.31.0-rc.0 +replace k8s.io/endpointslice => k8s.io/endpointslice v0.31.0 -replace k8s.io/kms => k8s.io/kms v0.31.0-rc.0 +replace k8s.io/kms => k8s.io/kms v0.31.0 -replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.31.0-rc.0 +replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.31.0 -replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.31.0-rc.0 +replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.31.0 -replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.31.0-rc.0 +replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.31.0 -replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.31.0-rc.0 +replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.31.0 -replace k8s.io/kubectl => k8s.io/kubectl v0.31.0-rc.0 +replace k8s.io/kubectl => k8s.io/kubectl v0.31.0 -replace k8s.io/kubelet => k8s.io/kubelet v0.31.0-rc.0 +replace k8s.io/kubelet => k8s.io/kubelet v0.31.0 -replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.31.0-rc.0 +replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.31.0 -replace k8s.io/metrics => k8s.io/metrics v0.31.0-rc.0 +replace k8s.io/metrics => k8s.io/metrics v0.31.0 -replace k8s.io/mount-utils => k8s.io/mount-utils v0.31.0-rc.0 +replace k8s.io/mount-utils => k8s.io/mount-utils v0.31.0 -replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.31.0-rc.0 +replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.31.0 -replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.31.0-rc.0 +replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.31.0 + +replace k8s.io/cri-client => k8s.io/cri-client v0.31.0 diff --git a/go.sum b/go.sum index b354deb66..a40b58816 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0 h1:v06gHJT03w4GqSIHqY70fusyRP52c7mNGjwDP/rXlls= -github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0/go.mod h1:UeXs7eT5VF7FC1M8NiN/+c0D3QcSVSzqvRYudXVwtf8= +github.com/kubernetes-csi/csi-lib-utils v0.19.0 h1:3sT8mL9+St2acyrEtuR7CQ5L78GR4lgsb+sfon9tGfA= +github.com/kubernetes-csi/csi-lib-utils v0.19.0/go.mod h1:lBuMKvoyd8c3EG+itmnVWApLDHnLkU7ibxxZSPuOw0M= github.com/kubernetes-csi/csi-test/v5 v5.2.0 h1:Z+sdARWC6VrONrxB24clCLCmnqCnZF7dzXtzx8eM35o= github.com/kubernetes-csi/csi-test/v5 v5.2.0/go.mod h1:o/c5w+NU3RUNE+DbVRhEUTmkQVBGk+tFOB2yPXT8teo= github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0 h1:qS4r4ljINLWKJ9m9Ge3Q3sGZ/eIoDVDT2RhAdQFHb1k= @@ -313,48 +313,48 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.31.0-rc.0 h1:R+jdJGdcV5EQ9hpMR4BhrOmVrCk+fcU1b8tnwSS/DwE= -k8s.io/api v0.31.0-rc.0/go.mod h1:wb5Wz7B/Mz9Ri/aK+v7XFuePDh6OiZ0aCX6Yb9f/EAE= -k8s.io/apiextensions-apiserver v0.31.0-rc.0 h1:EJhqgU0Ue8W6m/kX0D9ozrrdxcMSBsXookDCGbE0Ueg= -k8s.io/apiextensions-apiserver v0.31.0-rc.0/go.mod h1:0YKjhnYYJUb3IwGZhy69qu2vtf6xYvfVOHV9wXE+q24= -k8s.io/apimachinery v0.31.0-rc.0 h1:8guKYtBUM/ZEvvQoWfm3hl/NEj+1eVhuSnSpDHheJmw= -k8s.io/apimachinery v0.31.0-rc.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/apiserver v0.31.0-rc.0 h1:iS9B0njKDeaV3vGekb/YNnAV4ML+anqigd4X8tgshcw= -k8s.io/apiserver v0.31.0-rc.0/go.mod h1:uA/E8++CAC/mYpEAoVFwF6Nm1MZrUy9CgKkyHFcc0fU= -k8s.io/client-go v0.31.0-rc.0 h1:9ShcEasfMftGPmxfB8lo2QE63SWT+IEVMrFR7IuWkuI= -k8s.io/client-go v0.31.0-rc.0/go.mod h1:dsCs0l4s2KrHxbbXcHviMhkMBd81uhRPZExRpN6ykgI= -k8s.io/cloud-provider v0.31.0-rc.0 h1:yx/VFCWINTvOqnIWlINpprW3Oxi5TIbTbLQcfF2wTuA= -k8s.io/cloud-provider v0.31.0-rc.0/go.mod h1:rSn3Y5ULe0yGJJpdQCN2DwCT4qf7FJH9F8y8k0rWV50= -k8s.io/component-base v0.31.0-rc.0 h1:dPS5Pm17748Ur+h5u6G2679qBT3Vq9xDlq2TNsQL1Sk= -k8s.io/component-base v0.31.0-rc.0/go.mod h1:LYJyURUhpbHK6ldqnTIPJdj9C83AqkgLhAazWv2k7Ec= -k8s.io/component-helpers v0.31.0-rc.0 h1:H8dMwIcyScTemNLlpwC3DNc+7piKfO17OLQWeZ3nBCQ= -k8s.io/component-helpers v0.31.0-rc.0/go.mod h1:1Wg8vV/OT1PzRmk1gmqMFbOvgp5n4Yj3HVxQVExfj6Y= -k8s.io/controller-manager v0.31.0-rc.0 h1:lD85Q3wxSYHCmDoJ3sRV2FM9/vbdAlc2cW2qowqNl3A= -k8s.io/controller-manager v0.31.0-rc.0/go.mod h1:K30ydXZXQ7r/XaJoQ0D233xBgfjKJtrkQ9ovS+8Y6mY= -k8s.io/csi-translation-lib v0.31.0-rc.0 h1:rYZ2cjtB1wyF4HrVBAJWROVR7Rwv75SLxw5VPLe5cIY= -k8s.io/csi-translation-lib v0.31.0-rc.0/go.mod h1:PClkjM5R9vAG+EMSx/uUN9O24eHQ81TeYqW9REzm8DE= +k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= +k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= +k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.0 h1:p+2dgJjy+bk+B1Csz+mc2wl5gHwvNkC9QJV+w55LVrY= +k8s.io/apiserver v0.31.0/go.mod h1:KI9ox5Yu902iBnnyMmy7ajonhKnkeZYJhTZ/YI+WEMk= +k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= +k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= +k8s.io/cloud-provider v0.31.0 h1:qNOs78I2/7zQmyStfDtY2M7EdilUl9fCSYMcqBju/tA= +k8s.io/cloud-provider v0.31.0/go.mod h1:QgUPqLoL6aXhLlrNg1U4IrJk/PvvxgeOnT2ixkgnqT0= +k8s.io/component-base v0.31.0 h1:/KIzGM5EvPNQcYgwq5NwoQBaOlVFrghoVGr8lG6vNRs= +k8s.io/component-base v0.31.0/go.mod h1:TYVuzI1QmN4L5ItVdMSXKvH7/DtvIuas5/mm8YT3rTo= +k8s.io/component-helpers v0.31.0 h1:jyRUKA+GX+q19o81k4x94imjNICn+e6Gzi6T89va1/A= +k8s.io/component-helpers v0.31.0/go.mod h1:MrNIvT4iB7wXIseYSWfHUJB/aNUiFvbilp4qDfBQi6s= +k8s.io/controller-manager v0.31.0 h1:OmM0JfkzMvNXGbKIInj8SOrqIHLW4ymDGaNaa4KqyGc= +k8s.io/controller-manager v0.31.0/go.mod h1:slaIzbI1ecqVphjSuHwlzJQ2pclSwtjUzTEQ6fYAB8A= +k8s.io/csi-translation-lib v0.31.0 h1:5aCBPyFScdhfcWCUj0KDMAi/lDhxK99DF4XcfSnmH1A= +k8s.io/csi-translation-lib v0.31.0/go.mod h1:CM3U0vDm4jfuQpjKkqlJdRDqmAEcLQPm7aoJFjYf668= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.31.0-rc.0 h1:gcl5XqtJ6T9NBo8pTUnfQtqNOvG4RVWsP8wL5lzko1Y= -k8s.io/kms v0.31.0-rc.0/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= +k8s.io/kms v0.31.0 h1:KchILPfB1ZE+ka7223mpU5zeFNkmb45jl7RHnlImUaI= +k8s.io/kms v0.31.0/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= k8s.io/kube-openapi v0.0.0-20240730131305-7a9a4e85957e h1:OnKkExfhk4yxMqvBSPzUfhv3zQ96FWJ+UOZzLrAFyAo= k8s.io/kube-openapi v0.0.0-20240730131305-7a9a4e85957e/go.mod h1:0CVn9SVo8PeW5/JgsBZZIFmmTk5noOM8WXf2e1tCihE= -k8s.io/kubectl v0.31.0-rc.0 h1:1xbgXAKoHX6T30lJ9CHyId+qFYioKbgMOPxQGnlAb14= -k8s.io/kubectl v0.31.0-rc.0/go.mod h1:jJHXIrh7Zs7ECE9+2yD067Aalgp+dzcResDmvsUwLmg= -k8s.io/kubelet v0.31.0-rc.0 h1:Z59TQMku2YD3G1zewjRsWULtNUn6YwlMyBhFp8GVGO0= -k8s.io/kubelet v0.31.0-rc.0/go.mod h1:JKdK0xvJcFarPkpQxhVQyeH9zzGqjpNgMVeVIet6x74= -k8s.io/kubernetes v1.31.0-rc.0 h1:VuDntEecqzeKiWqDaik4hKxqAx+4a3IBo0ew5UQm2PE= -k8s.io/kubernetes v1.31.0-rc.0/go.mod h1:UTpGn7nxrUrPWw5hNIYTAjodcWIvLakgHpLtfrr6GC8= -k8s.io/mount-utils v0.31.0-rc.0 h1:6rlshLhnVzQYbSazXoQdAP+hVhJo/DDyzCs+GRitN7Q= -k8s.io/mount-utils v0.31.0-rc.0/go.mod h1:HV/VYBUGqYUj4vt82YltzpWvgv8FPg0G9ItyInT3NPU= -k8s.io/pod-security-admission v0.31.0-rc.0 h1:LOQGbt80vZeNEKBYiJJXRUqM/hOCrpaKBOZ5dgQlzrE= -k8s.io/pod-security-admission v0.31.0-rc.0/go.mod h1:KXrJgRSMDCqG1dOUQLKowymfscnJKPlvQp2x7rJKNNw= +k8s.io/kubectl v0.31.0 h1:kANwAAPVY02r4U4jARP/C+Q1sssCcN/1p9Nk+7BQKVg= +k8s.io/kubectl v0.31.0/go.mod h1:pB47hhFypGsaHAPjlwrNbvhXgmuAr01ZBvAIIUaI8d4= +k8s.io/kubelet v0.31.0 h1:IlfkBy7QTojGEm97GuVGhtli0HL/Pgu4AdayiF76yWo= +k8s.io/kubelet v0.31.0/go.mod h1:s+OnqnfdIh14PFpUb7NgzM53WSYXcczA3w/1qSzsRc8= +k8s.io/kubernetes v1.31.0 h1:sYAB12TTWexXKp4RxqJMm/7EC+P0mNOgn4Xdj5eu7HM= +k8s.io/kubernetes v1.31.0/go.mod h1:UTpGn7nxrUrPWw5hNIYTAjodcWIvLakgHpLtfrr6GC8= +k8s.io/mount-utils v0.31.0 h1:o+a+n6gyZ7MGc6bIERU3LeFTHbLDBiVReaDpWlJotUE= +k8s.io/mount-utils v0.31.0/go.mod h1:HV/VYBUGqYUj4vt82YltzpWvgv8FPg0G9ItyInT3NPU= +k8s.io/pod-security-admission v0.31.0 h1:z8lTQ1+EZ8aX+xTrDTT2Udt1b9mzci2o2L2O4TUWSUU= +k8s.io/pod-security-admission v0.31.0/go.mod h1:672PutRBAIEOJJljOHDYhXiXrQDDFdB3z7hddN3Pv5c= 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/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-runtime v0.18.1-0.20240731191308-a39ace352f07 h1:TFsoPohpxWF/yAClFydhUqSC6jta8XfgEQDdBPikkN4= -sigs.k8s.io/controller-runtime v0.18.1-0.20240731191308-a39ace352f07/go.mod h1:0N/oS51dz0ZJriISp1SloFWkR7uKCDC6LBt65tRt2J0= +sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= +sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/vendor/k8s.io/apiserver/pkg/features/kube_features.go b/vendor/k8s.io/apiserver/pkg/features/kube_features.go index 638e3f855..27d9761b8 100644 --- a/vendor/k8s.io/apiserver/pkg/features/kube_features.go +++ b/vendor/k8s.io/apiserver/pkg/features/kube_features.go @@ -101,6 +101,11 @@ const ( // Allows authorization to use field and label selectors. AuthorizeWithSelectors featuregate.Feature = "AuthorizeWithSelectors" + // owner: @serathius + // beta: v1.31 + // Enables concurrent watch object decoding to avoid starving watch cache when conversion webhook is installed. + ConcurrentWatchObjectDecode featuregate.Feature = "ConcurrentWatchObjectDecode" + // owner: @cici37 @jpbetz // kep: http://kep.k8s.io/3488 // alpha: v1.26 @@ -312,6 +317,7 @@ const ( // owner: @serathius // kep: http://kep.k8s.io/2340 // alpha: v1.28 + // beta: v1.31 // // Allow the API server to serve consistent lists from cache ConsistentListFromCache featuregate.Feature = "ConsistentListFromCache" @@ -360,10 +366,12 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS APIServerTracing: {Default: true, PreRelease: featuregate.Beta}, - APIServingWithRoutine: {Default: true, PreRelease: featuregate.Beta}, + APIServingWithRoutine: {Default: false, PreRelease: featuregate.Alpha}, AuthorizeWithSelectors: {Default: false, PreRelease: featuregate.Alpha}, + ConcurrentWatchObjectDecode: {Default: false, PreRelease: featuregate.Beta}, + ValidatingAdmissionPolicy: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32 CoordinatedLeaderElection: {Default: false, PreRelease: featuregate.Alpha}, @@ -414,7 +422,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS WatchList: {Default: false, PreRelease: featuregate.Alpha}, - ConsistentListFromCache: {Default: false, PreRelease: featuregate.Alpha}, + ConsistentListFromCache: {Default: true, PreRelease: featuregate.Beta}, ZeroLimitedNominalConcurrencyShares: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32 } diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go index c55304581..48791bd7b 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go +++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go @@ -848,7 +848,8 @@ func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptio preparedKey += "/" } requestWatchProgressSupported := etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress) - if resourceVersion == "" && utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) && requestWatchProgressSupported { + consistentRead := resourceVersion == "" && utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) && requestWatchProgressSupported + if consistentRead { listRV, err = storage.GetCurrentResourceVersionFromStorage(ctx, c.storage, c.newListFunc, c.resourcePrefix, c.objectType.String()) if err != nil { return err @@ -887,9 +888,24 @@ func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptio } objs, readResourceVersion, indexUsed, err := c.listItems(ctx, listRV, preparedKey, pred, recursive) + success := "true" + fallback := "false" if err != nil { + if consistentRead { + if storage.IsTooLargeResourceVersion(err) { + fallback = "true" + err = c.storage.GetList(ctx, key, opts, listObj) + } + if err != nil { + success = "false" + } + metrics.ConsistentReadTotal.WithLabelValues(c.resourcePrefix, success, fallback).Add(1) + } return err } + if consistentRead { + metrics.ConsistentReadTotal.WithLabelValues(c.resourcePrefix, success, fallback).Add(1) + } span.AddEvent("Listed items from cache", attribute.Int("count", len(objs))) // store pointer of eligible objects, // Why not directly put object in the items of listObj? diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go index 2c5dc4806..dd77febb9 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go +++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go @@ -167,6 +167,15 @@ var ( StabilityLevel: compbasemetrics.ALPHA, Buckets: []float64{0.005, 0.025, 0.05, 0.1, 0.2, 0.4, 0.6, 0.8, 1.0, 1.25, 1.5, 2, 3}, }, []string{"resource"}) + + ConsistentReadTotal = compbasemetrics.NewCounterVec( + &compbasemetrics.CounterOpts{ + Namespace: namespace, + Subsystem: subsystem, + Name: "consistent_read_total", + Help: "Counter for consistent reads from cache.", + StabilityLevel: compbasemetrics.ALPHA, + }, []string{"resource", "success", "fallback"}) ) var registerMetrics sync.Once @@ -188,6 +197,7 @@ func Register() { legacyregistry.MustRegister(WatchCacheCapacity) legacyregistry.MustRegister(WatchCacheInitializations) legacyregistry.MustRegister(WatchCacheReadWait) + legacyregistry.MustRegister(ConsistentReadTotal) }) } diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go index 85acf44f8..536f2e1c0 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go @@ -46,8 +46,9 @@ import ( const ( // We have set a buffer in order to reduce times of context switches. - incomingBufSize = 100 - outgoingBufSize = 100 + incomingBufSize = 100 + outgoingBufSize = 100 + processEventConcurrency = 10 ) // defaultWatcherMaxLimit is used to facilitate construction tests @@ -230,8 +231,7 @@ func (wc *watchChan) run(initialEventsEndBookmarkRequired, forceInitialEvents bo go wc.startWatching(watchClosedCh, initialEventsEndBookmarkRequired, forceInitialEvents) var resultChanWG sync.WaitGroup - resultChanWG.Add(1) - go wc.processEvent(&resultChanWG) + wc.processEvents(&resultChanWG) select { case err := <-wc.errChan: @@ -424,10 +424,17 @@ func (wc *watchChan) startWatching(watchClosedCh chan struct{}, initialEventsEnd close(watchClosedCh) } -// processEvent processes events from etcd watcher and sends results to resultChan. -func (wc *watchChan) processEvent(wg *sync.WaitGroup) { +// processEvents processes events from etcd watcher and sends results to resultChan. +func (wc *watchChan) processEvents(wg *sync.WaitGroup) { + if utilfeature.DefaultFeatureGate.Enabled(features.ConcurrentWatchObjectDecode) { + wc.concurrentProcessEvents(wg) + } else { + wg.Add(1) + go wc.serialProcessEvents(wg) + } +} +func (wc *watchChan) serialProcessEvents(wg *sync.WaitGroup) { defer wg.Done() - for { select { case e := <-wc.incomingEventChan: @@ -435,7 +442,7 @@ func (wc *watchChan) processEvent(wg *sync.WaitGroup) { if res == nil { continue } - if len(wc.resultChan) == outgoingBufSize { + if len(wc.resultChan) == cap(wc.resultChan) { klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize, "objectType", wc.watcher.objectType, "groupResource", wc.watcher.groupResource) } // If user couldn't receive results fast enough, we also block incoming events from watcher. @@ -452,6 +459,95 @@ func (wc *watchChan) processEvent(wg *sync.WaitGroup) { } } +func (wc *watchChan) concurrentProcessEvents(wg *sync.WaitGroup) { + p := concurrentOrderedEventProcessing{ + input: wc.incomingEventChan, + processFunc: wc.transform, + output: wc.resultChan, + processingQueue: make(chan chan *watch.Event, processEventConcurrency-1), + + objectType: wc.watcher.objectType, + groupResource: wc.watcher.groupResource, + } + wg.Add(1) + go func() { + defer wg.Done() + p.scheduleEventProcessing(wc.ctx, wg) + }() + wg.Add(1) + go func() { + defer wg.Done() + p.collectEventProcessing(wc.ctx) + }() +} + +type concurrentOrderedEventProcessing struct { + input chan *event + processFunc func(*event) *watch.Event + output chan watch.Event + + processingQueue chan chan *watch.Event + // Metadata for logging + objectType string + groupResource schema.GroupResource +} + +func (p *concurrentOrderedEventProcessing) scheduleEventProcessing(ctx context.Context, wg *sync.WaitGroup) { + var e *event + for { + select { + case <-ctx.Done(): + return + case e = <-p.input: + } + processingResponse := make(chan *watch.Event, 1) + select { + case <-ctx.Done(): + return + case p.processingQueue <- processingResponse: + } + wg.Add(1) + go func(e *event, response chan<- *watch.Event) { + defer wg.Done() + select { + case <-ctx.Done(): + case response <- p.processFunc(e): + } + }(e, processingResponse) + } +} + +func (p *concurrentOrderedEventProcessing) collectEventProcessing(ctx context.Context) { + var processingResponse chan *watch.Event + var e *watch.Event + for { + select { + case <-ctx.Done(): + return + case processingResponse = <-p.processingQueue: + } + select { + case <-ctx.Done(): + return + case e = <-processingResponse: + } + if e == nil { + continue + } + if len(p.output) == cap(p.output) { + klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize, "objectType", p.objectType, "groupResource", p.groupResource) + } + // If user couldn't receive results fast enough, we also block incoming events from watcher. + // Because storing events in local will cause more memory usage. + // The worst case would be closing the fast watcher. + select { + case <-ctx.Done(): + return + case p.output <- *e: + } + } +} + func (wc *watchChan) filter(obj runtime.Object) bool { if wc.internalPred.Empty() { return true diff --git a/vendor/k8s.io/kubernetes/pkg/features/kube_features.go b/vendor/k8s.io/kubernetes/pkg/features/kube_features.go index 993a7485c..80a25132b 100644 --- a/vendor/k8s.io/kubernetes/pkg/features/kube_features.go +++ b/vendor/k8s.io/kubernetes/pkg/features/kube_features.go @@ -1193,7 +1193,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS SizeMemoryBackedVolumes: {Default: true, PreRelease: featuregate.Beta}, - StableLoadBalancerNodeSet: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.30, remove in 1.31 + StableLoadBalancerNodeSet: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.30, remove in 1.32 StatefulSetAutoDeletePVC: {Default: true, PreRelease: featuregate.Beta}, @@ -1260,11 +1260,13 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS genericfeatures.APIServerTracing: {Default: true, PreRelease: featuregate.Beta}, - genericfeatures.APIServingWithRoutine: {Default: true, PreRelease: featuregate.Beta}, + genericfeatures.APIServingWithRoutine: {Default: false, PreRelease: featuregate.Alpha}, genericfeatures.AuthorizeWithSelectors: {Default: false, PreRelease: featuregate.Alpha}, - genericfeatures.ConsistentListFromCache: {Default: false, PreRelease: featuregate.Alpha}, + genericfeatures.ConcurrentWatchObjectDecode: {Default: false, PreRelease: featuregate.Beta}, + + genericfeatures.ConsistentListFromCache: {Default: true, PreRelease: featuregate.Beta}, genericfeatures.CoordinatedLeaderElection: {Default: false, PreRelease: featuregate.Alpha}, diff --git a/vendor/modules.txt b/vendor/modules.txt index 180ee9cc1..845eaf57c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -170,8 +170,8 @@ github.com/josharian/intern # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0 -## explicit; go 1.22.0 +# github.com/kubernetes-csi/csi-lib-utils v0.19.0 +## explicit; go 1.22.5 github.com/kubernetes-csi/csi-lib-utils/accessmodes github.com/kubernetes-csi/csi-lib-utils/connection github.com/kubernetes-csi/csi-lib-utils/leaderelection @@ -660,7 +660,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.32.0-alpha.0 => k8s.io/api v0.31.0-rc.0 +# k8s.io/api v0.31.0 => k8s.io/api v0.31.0 ## explicit; go 1.22.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -720,12 +720,12 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apiextensions-apiserver v0.32.0-alpha.0 => k8s.io/apiextensions-apiserver v0.31.0-rc.0 +# k8s.io/apiextensions-apiserver v0.31.0 => k8s.io/apiextensions-apiserver v0.31.0 ## explicit; go 1.22.0 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/features -# k8s.io/apimachinery v0.32.0-alpha.0 => k8s.io/apimachinery v0.31.0-rc.0 +# k8s.io/apimachinery v0.31.0 => k8s.io/apimachinery v0.31.0 ## explicit; go 1.22.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -792,7 +792,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.31.0-rc.0 => k8s.io/apiserver v0.31.0-rc.0 +# k8s.io/apiserver v0.31.0 => k8s.io/apiserver v0.31.0 ## explicit; go 1.22.0 k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/configuration @@ -943,7 +943,7 @@ k8s.io/apiserver/plugin/pkg/audit/webhook k8s.io/apiserver/plugin/pkg/authenticator/token/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics -# k8s.io/client-go v1.5.2 => k8s.io/client-go v0.31.0-rc.0 +# k8s.io/client-go v0.31.0 => k8s.io/client-go v0.31.0 ## explicit; go 1.22.0 k8s.io/client-go/applyconfigurations k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -1288,7 +1288,7 @@ k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/watchlist k8s.io/client-go/util/workqueue -# k8s.io/cloud-provider v0.30.0 => k8s.io/cloud-provider v0.31.0-rc.0 +# k8s.io/cloud-provider v0.30.0 => k8s.io/cloud-provider v0.31.0 ## explicit; go 1.22.0 k8s.io/cloud-provider k8s.io/cloud-provider/app/config @@ -1301,7 +1301,7 @@ k8s.io/cloud-provider/controllers/service/config k8s.io/cloud-provider/controllers/service/config/v1alpha1 k8s.io/cloud-provider/names k8s.io/cloud-provider/options -# k8s.io/component-base v0.31.0-rc.0 => k8s.io/component-base v0.31.0-rc.0 +# k8s.io/component-base v0.31.0 => k8s.io/component-base v0.31.0 ## explicit; go 1.22.0 k8s.io/component-base/cli/flag k8s.io/component-base/config @@ -1326,12 +1326,12 @@ k8s.io/component-base/metrics/testutil k8s.io/component-base/tracing k8s.io/component-base/tracing/api/v1 k8s.io/component-base/version -# k8s.io/component-helpers v0.31.0-rc.0 => k8s.io/component-helpers v0.31.0-rc.0 +# k8s.io/component-helpers v0.31.0 => k8s.io/component-helpers v0.31.0 ## explicit; go 1.22.0 k8s.io/component-helpers/node/util/sysctl k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity -# k8s.io/controller-manager v0.31.0-rc.0 => k8s.io/controller-manager v0.31.0-rc.0 +# k8s.io/controller-manager v0.31.0 => k8s.io/controller-manager v0.31.0 ## explicit; go 1.22.0 k8s.io/controller-manager/config k8s.io/controller-manager/config/v1 @@ -1343,7 +1343,7 @@ k8s.io/controller-manager/pkg/features k8s.io/controller-manager/pkg/features/register k8s.io/controller-manager/pkg/leadermigration/config k8s.io/controller-manager/pkg/leadermigration/options -# k8s.io/csi-translation-lib v0.29.0 => k8s.io/csi-translation-lib v0.31.0-rc.0 +# k8s.io/csi-translation-lib v0.31.0 => k8s.io/csi-translation-lib v0.31.0 ## explicit; go 1.22.0 k8s.io/csi-translation-lib k8s.io/csi-translation-lib/plugins @@ -1358,7 +1358,7 @@ k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler k8s.io/klog/v2/internal/verbosity k8s.io/klog/v2/textlogger -# k8s.io/kms v0.31.0-rc.0 => k8s.io/kms v0.31.0-rc.0 +# k8s.io/kms v0.31.0 => k8s.io/kms v0.31.0 ## explicit; go 1.22.0 k8s.io/kms/apis/v1beta1 k8s.io/kms/apis/v2 @@ -1385,14 +1385,14 @@ k8s.io/kube-openapi/pkg/validation/errors k8s.io/kube-openapi/pkg/validation/spec k8s.io/kube-openapi/pkg/validation/strfmt k8s.io/kube-openapi/pkg/validation/strfmt/bson -# k8s.io/kubectl v0.27.0 => k8s.io/kubectl v0.31.0-rc.0 +# k8s.io/kubectl v0.31.0 => k8s.io/kubectl v0.31.0 ## explicit; go 1.22.0 k8s.io/kubectl/pkg/scale k8s.io/kubectl/pkg/util/podutils -# k8s.io/kubelet v0.27.0 => k8s.io/kubelet v0.31.0-rc.0 +# k8s.io/kubelet v0.31.0 => k8s.io/kubelet v0.31.0 ## explicit; go 1.22.0 k8s.io/kubelet/pkg/apis -# k8s.io/kubernetes v1.31.0-rc.0 +# k8s.io/kubernetes v1.31.0 ## explicit; go 1.22.0 k8s.io/kubernetes/pkg/api/legacyscheme k8s.io/kubernetes/pkg/api/service @@ -1454,10 +1454,10 @@ k8s.io/kubernetes/test/utils k8s.io/kubernetes/test/utils/format k8s.io/kubernetes/test/utils/image k8s.io/kubernetes/test/utils/kubeconfig -# k8s.io/mount-utils v0.27.0 => k8s.io/mount-utils v0.31.0-rc.0 +# k8s.io/mount-utils v0.31.0 => k8s.io/mount-utils v0.31.0 ## explicit; go 1.22.0 k8s.io/mount-utils -# k8s.io/pod-security-admission v0.27.0 => k8s.io/pod-security-admission v0.31.0-rc.0 +# k8s.io/pod-security-admission v0.31.0 => k8s.io/pod-security-admission v0.31.0 ## explicit; go 1.22.0 k8s.io/pod-security-admission/api k8s.io/pod-security-admission/policy @@ -1487,7 +1487,7 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/controller-runtime v0.18.1-0.20240731191308-a39ace352f07 +# sigs.k8s.io/controller-runtime v0.19.0 ## explicit; go 1.22.0 sigs.k8s.io/controller-runtime/pkg/client sigs.k8s.io/controller-runtime/pkg/client/apiutil @@ -1549,31 +1549,32 @@ sigs.k8s.io/structured-merge-diff/v4/value ## explicit; go 1.12 sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 -# k8s.io/api => k8s.io/api v0.31.0-rc.0 -# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.31.0-rc.0 -# k8s.io/apimachinery => k8s.io/apimachinery v0.31.0-rc.0 -# k8s.io/apiserver => k8s.io/apiserver v0.31.0-rc.0 -# k8s.io/cli-runtime => k8s.io/cli-runtime v0.31.0-rc.0 -# k8s.io/client-go => k8s.io/client-go v0.31.0-rc.0 -# k8s.io/cloud-provider => k8s.io/cloud-provider v0.31.0-rc.0 -# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.31.0-rc.0 -# k8s.io/code-generator => k8s.io/code-generator v0.31.0-rc.0 -# k8s.io/component-base => k8s.io/component-base v0.31.0-rc.0 -# k8s.io/component-helpers => k8s.io/component-helpers v0.31.0-rc.0 -# k8s.io/controller-manager => k8s.io/controller-manager v0.31.0-rc.0 -# k8s.io/cri-api => k8s.io/cri-api v0.31.0-rc.0 -# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.31.0-rc.0 -# k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.31.0-rc.0 -# k8s.io/endpointslice => k8s.io/endpointslice v0.31.0-rc.0 -# k8s.io/kms => k8s.io/kms v0.31.0-rc.0 -# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.31.0-rc.0 -# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.31.0-rc.0 -# k8s.io/kube-proxy => k8s.io/kube-proxy v0.31.0-rc.0 -# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.31.0-rc.0 -# k8s.io/kubectl => k8s.io/kubectl v0.31.0-rc.0 -# k8s.io/kubelet => k8s.io/kubelet v0.31.0-rc.0 -# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.31.0-rc.0 -# k8s.io/metrics => k8s.io/metrics v0.31.0-rc.0 -# k8s.io/mount-utils => k8s.io/mount-utils v0.31.0-rc.0 -# k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.31.0-rc.0 -# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.31.0-rc.0 +# k8s.io/api => k8s.io/api v0.31.0 +# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.31.0 +# k8s.io/apimachinery => k8s.io/apimachinery v0.31.0 +# k8s.io/apiserver => k8s.io/apiserver v0.31.0 +# k8s.io/cli-runtime => k8s.io/cli-runtime v0.31.0 +# k8s.io/client-go => k8s.io/client-go v0.31.0 +# k8s.io/cloud-provider => k8s.io/cloud-provider v0.31.0 +# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.31.0 +# k8s.io/code-generator => k8s.io/code-generator v0.31.0 +# k8s.io/component-base => k8s.io/component-base v0.31.0 +# k8s.io/component-helpers => k8s.io/component-helpers v0.31.0 +# k8s.io/controller-manager => k8s.io/controller-manager v0.31.0 +# k8s.io/cri-api => k8s.io/cri-api v0.31.0 +# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.31.0 +# k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.31.0 +# k8s.io/endpointslice => k8s.io/endpointslice v0.31.0 +# k8s.io/kms => k8s.io/kms v0.31.0 +# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.31.0 +# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.31.0 +# k8s.io/kube-proxy => k8s.io/kube-proxy v0.31.0 +# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.31.0 +# k8s.io/kubectl => k8s.io/kubectl v0.31.0 +# k8s.io/kubelet => k8s.io/kubelet v0.31.0 +# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.31.0 +# k8s.io/metrics => k8s.io/metrics v0.31.0 +# k8s.io/mount-utils => k8s.io/mount-utils v0.31.0 +# k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.31.0 +# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.31.0 +# k8s.io/cri-client => k8s.io/cri-client v0.31.0 diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/client.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/client.go index 451f7b2a1..fe9862b81 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/client.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/client.go @@ -50,28 +50,10 @@ type Options struct { // Cache, if provided, is used to read objects from the cache. Cache *CacheOptions - // WarningHandler is used to configure the warning handler responsible for - // surfacing and handling warnings messages sent by the API server. - WarningHandler WarningHandlerOptions - // DryRun instructs the client to only perform dry run requests. DryRun *bool } -// WarningHandlerOptions are options for configuring a -// warning handler for the client which is responsible -// for surfacing API Server warnings. -type WarningHandlerOptions struct { - // SuppressWarnings decides if the warnings from the - // API server are suppressed or surfaced in the client. - SuppressWarnings bool - // AllowDuplicateLogs does not deduplicate the to-be - // logged surfaced warnings messages. See - // log.WarningHandlerOptions for considerations - // regarding deduplication - AllowDuplicateLogs bool -} - // CacheOptions are options for creating a cache-backed client. type CacheOptions struct { // Reader is a cache-backed reader that will be used to read objects from the cache. @@ -91,6 +73,12 @@ type NewClientFunc func(config *rest.Config, options Options) (Client, error) // New returns a new Client using the provided config and Options. // +// By default, the client surfaces warnings returned by the server. To +// suppress warnings, set config.WarningHandler = rest.NoWarnings{}. To +// define custom behavior, implement the rest.WarningHandler interface. +// See [sigs.k8s.io/controller-runtime/pkg/log.KubeAPIWarningLogger] for +// an example. +// // The client's read behavior is determined by Options.Cache. // If either Options.Cache or Options.Cache.Reader is nil, // the client reads directly from the API server. @@ -124,15 +112,14 @@ func newClient(config *rest.Config, options Options) (*client, error) { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // By default, we de-duplicate and surface warnings. - config.WarningHandler = log.NewKubeAPIWarningLogger( - log.Log.WithName("KubeAPIWarningLogger"), - log.KubeAPIWarningLoggerOptions{ - Deduplicate: !options.WarningHandler.AllowDuplicateLogs, - }, - ) - if options.WarningHandler.SuppressWarnings { - config.WarningHandler = rest.NoWarnings{} + if config.WarningHandler == nil { + // By default, we de-duplicate and surface warnings. + config.WarningHandler = log.NewKubeAPIWarningLogger( + log.Log.WithName("KubeAPIWarningLogger"), + log.KubeAPIWarningLoggerOptions{ + Deduplicate: true, + }, + ) } // Use the rest HTTP client for the provided config if unset diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go index a839abe14..7366a1852 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go @@ -31,6 +31,8 @@ import ( // Using v4 to match upstream jsonpatch "gopkg.in/evanphx/json-patch.v4" + appsv1 "k8s.io/api/apps/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" corev1 "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" @@ -50,6 +52,7 @@ import ( "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/testing" + "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" @@ -83,6 +86,8 @@ const ( maxNameLength = 63 randomLength = 5 maxGeneratedNameLength = maxNameLength - randomLength + + subResourceScale = "scale" ) // NewFakeClient creates a new fake client for testing. @@ -1111,7 +1116,26 @@ type fakeSubResourceClient struct { } func (sw *fakeSubResourceClient) Get(ctx context.Context, obj, subResource client.Object, opts ...client.SubResourceGetOption) error { - panic("fakeSubResourceClient does not support get") + switch sw.subResource { + case subResourceScale: + // Actual client looks up resource, then extracts the scale sub-resource: + // https://github.com/kubernetes/kubernetes/blob/fb6bbc9781d11a87688c398778525c4e1dcb0f08/pkg/registry/apps/deployment/storage/storage.go#L307 + if err := sw.client.Get(ctx, client.ObjectKeyFromObject(obj), obj); err != nil { + return err + } + scale, isScale := subResource.(*autoscalingv1.Scale) + if !isScale { + return apierrors.NewBadRequest(fmt.Sprintf("expected Scale, got %t", subResource)) + } + scaleOut, err := extractScale(obj) + if err != nil { + return err + } + *scale = *scaleOut + return nil + default: + return fmt.Errorf("fakeSubResourceClient does not support get for %s", sw.subResource) + } } func (sw *fakeSubResourceClient) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error { @@ -1138,11 +1162,30 @@ func (sw *fakeSubResourceClient) Update(ctx context.Context, obj client.Object, updateOptions := client.SubResourceUpdateOptions{} updateOptions.ApplyOptions(opts) - body := obj - if updateOptions.SubResourceBody != nil { - body = updateOptions.SubResourceBody + switch sw.subResource { + case subResourceScale: + if err := sw.client.Get(ctx, client.ObjectKeyFromObject(obj), obj); err != nil { + return err + } + if updateOptions.SubResourceBody == nil { + return apierrors.NewBadRequest("missing SubResourceBody") + } + + scale, isScale := updateOptions.SubResourceBody.(*autoscalingv1.Scale) + if !isScale { + return apierrors.NewBadRequest(fmt.Sprintf("expected Scale, got %t", updateOptions.SubResourceBody)) + } + if err := applyScale(obj, scale); err != nil { + return err + } + return sw.client.update(obj, false, &updateOptions.UpdateOptions) + default: + body := obj + if updateOptions.SubResourceBody != nil { + body = updateOptions.SubResourceBody + } + return sw.client.update(body, true, &updateOptions.UpdateOptions) } - return sw.client.update(body, true, &updateOptions.UpdateOptions) } func (sw *fakeSubResourceClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error { @@ -1323,3 +1366,124 @@ func getSingleOrZeroOptions[T any](opts []T) (opt T, err error) { } return } + +func extractScale(obj client.Object) (*autoscalingv1.Scale, error) { + switch obj := obj.(type) { + case *appsv1.Deployment: + var replicas int32 = 1 + if obj.Spec.Replicas != nil { + replicas = *obj.Spec.Replicas + } + var selector string + if obj.Spec.Selector != nil { + selector = obj.Spec.Selector.String() + } + return &autoscalingv1.Scale{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: obj.Namespace, + Name: obj.Name, + UID: obj.UID, + ResourceVersion: obj.ResourceVersion, + CreationTimestamp: obj.CreationTimestamp, + }, + Spec: autoscalingv1.ScaleSpec{ + Replicas: replicas, + }, + Status: autoscalingv1.ScaleStatus{ + Replicas: obj.Status.Replicas, + Selector: selector, + }, + }, nil + case *appsv1.ReplicaSet: + var replicas int32 = 1 + if obj.Spec.Replicas != nil { + replicas = *obj.Spec.Replicas + } + var selector string + if obj.Spec.Selector != nil { + selector = obj.Spec.Selector.String() + } + return &autoscalingv1.Scale{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: obj.Namespace, + Name: obj.Name, + UID: obj.UID, + ResourceVersion: obj.ResourceVersion, + CreationTimestamp: obj.CreationTimestamp, + }, + Spec: autoscalingv1.ScaleSpec{ + Replicas: replicas, + }, + Status: autoscalingv1.ScaleStatus{ + Replicas: obj.Status.Replicas, + Selector: selector, + }, + }, nil + case *corev1.ReplicationController: + var replicas int32 = 1 + if obj.Spec.Replicas != nil { + replicas = *obj.Spec.Replicas + } + return &autoscalingv1.Scale{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: obj.Namespace, + Name: obj.Name, + UID: obj.UID, + ResourceVersion: obj.ResourceVersion, + CreationTimestamp: obj.CreationTimestamp, + }, + Spec: autoscalingv1.ScaleSpec{ + Replicas: replicas, + }, + Status: autoscalingv1.ScaleStatus{ + Replicas: obj.Status.Replicas, + Selector: labels.Set(obj.Spec.Selector).String(), + }, + }, nil + case *appsv1.StatefulSet: + var replicas int32 = 1 + if obj.Spec.Replicas != nil { + replicas = *obj.Spec.Replicas + } + var selector string + if obj.Spec.Selector != nil { + selector = obj.Spec.Selector.String() + } + return &autoscalingv1.Scale{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: obj.Namespace, + Name: obj.Name, + UID: obj.UID, + ResourceVersion: obj.ResourceVersion, + CreationTimestamp: obj.CreationTimestamp, + }, + Spec: autoscalingv1.ScaleSpec{ + Replicas: replicas, + }, + Status: autoscalingv1.ScaleStatus{ + Replicas: obj.Status.Replicas, + Selector: selector, + }, + }, nil + default: + // TODO: CRDs https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#scale-subresource + return nil, fmt.Errorf("unimplemented scale subresource for resource %T", obj) + } +} + +func applyScale(obj client.Object, scale *autoscalingv1.Scale) error { + switch obj := obj.(type) { + case *appsv1.Deployment: + obj.Spec.Replicas = ptr.To(scale.Spec.Replicas) + case *appsv1.ReplicaSet: + obj.Spec.Replicas = ptr.To(scale.Spec.Replicas) + case *corev1.ReplicationController: + obj.Spec.Replicas = ptr.To(scale.Spec.Replicas) + case *appsv1.StatefulSet: + obj.Spec.Replicas = ptr.To(scale.Spec.Replicas) + default: + // TODO: CRDs https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#scale-subresource + return fmt.Errorf("unimplemented scale subresource for resource %T", obj) + } + return nil +} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go index 6cf854815..db50ed8fe 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go @@ -254,6 +254,7 @@ func (o *CreateOptions) AsCreateOptions() *metav1.CreateOptions { o.Raw.DryRun = o.DryRun o.Raw.FieldManager = o.FieldManager + o.Raw.FieldValidation = o.FieldValidation return o.Raw } @@ -274,6 +275,9 @@ func (o *CreateOptions) ApplyToCreate(co *CreateOptions) { if o.FieldManager != "" { co.FieldManager = o.FieldManager } + if o.FieldValidation != "" { + co.FieldValidation = o.FieldValidation + } if o.Raw != nil { co.Raw = o.Raw } @@ -764,6 +768,7 @@ func (o *UpdateOptions) AsUpdateOptions() *metav1.UpdateOptions { o.Raw.DryRun = o.DryRun o.Raw.FieldManager = o.FieldManager + o.Raw.FieldValidation = o.FieldValidation return o.Raw } @@ -786,6 +791,9 @@ func (o *UpdateOptions) ApplyToUpdate(uo *UpdateOptions) { if o.FieldManager != "" { uo.FieldManager = o.FieldManager } + if o.FieldValidation != "" { + uo.FieldValidation = o.FieldValidation + } if o.Raw != nil { uo.Raw = o.Raw } @@ -858,6 +866,7 @@ func (o *PatchOptions) AsPatchOptions() *metav1.PatchOptions { o.Raw.DryRun = o.DryRun o.Raw.Force = o.Force o.Raw.FieldManager = o.FieldManager + o.Raw.FieldValidation = o.FieldValidation return o.Raw } @@ -874,6 +883,9 @@ func (o *PatchOptions) ApplyToPatch(po *PatchOptions) { if o.FieldManager != "" { po.FieldManager = o.FieldManager } + if o.FieldValidation != "" { + po.FieldValidation = o.FieldValidation + } if o.Raw != nil { po.Raw = o.Raw }