operating-system-manager icon indicating copy to clipboard operation
operating-system-manager copied to clipboard

Fix for corev1.Endpoints is deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice

Open archups opened this issue 3 months ago • 0 comments

Post Go controller-runtime package bump go get -v sigs.k8s.io/[email protected] which bumped the Go k8s.io packages dependencies to v0.34.0, following staticcheck issues are reported via golangci-lint which are now deferred (by adding to exclusions.rules in .golangci.yml) should be fixed.

level=info msg="[runner] linters took 2m46.324763118s with stages: goanalysis_metalinter: 2m46.323660095s"
pkg/clusterinfo/configmap.go:77:15: SA1019: corev1.Endpoints is deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. (staticcheck)
	endpoint := &corev1.Endpoints{}
	             ^
pkg/clusterinfo/configmap.go:97:26: SA1019: corev1.EndpointSubset is deprecated: This API is deprecated in v1.33+. (staticcheck)
	getSecurePort := func(_ corev1.EndpointSubset) *corev1.EndpointPort {
	                        ^
pkg/clusterinfo/configmap_test.go:85:41: SA1019: corev1.Endpoints is deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. (staticcheck)
			objects: []ctrlruntimeclient.Object{&corev1.Endpoints{
			                                     ^
pkg/clusterinfo/configmap_test.go:90:16: SA1019: corev1.EndpointSubset is deprecated: This API is deprecated in v1.33+. (staticcheck)
				Subsets: []corev1.EndpointSubset{
				           ^
4 issues:
* staticcheck: 4

To reproduce the issue, remove the following entries from .golangci.yml under exclusions.rules.

- path: (.+)\.go$
  text: 'SA1019: corev1.Endpoints is deprecated: This API is deprecated in v1.33+.'
- path: (.+)\.go$
  text: 'SA1019: corev1.EndpointSubset is deprecated: This API is deprecated in v1.33+.'

archups avatar Sep 03 '25 11:09 archups