Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staticcheck: kubernetes.go error SA1019 (1.8.2) #3435

Closed
knweiss opened this Issue Nov 8, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@knweiss
Copy link
Contributor

knweiss commented Nov 8, 2017

What did you do?

go/src/github.com/prometheus/prometheus (release-1.8) $ git describe --tag
v1.8.2
go/src/github.com/prometheus/prometheus (release-1.8) $ make
>> formatting code
>> running staticcheck
discovery/kubernetes/kubernetes.go:162:13: d.client.Core is deprecated: please explicitly pick a version if possible.  (SA1019)
discovery/kubernetes/kubernetes.go:163:14: d.client.Extensions is deprecated: please explicitly pick a version if possible.  (SA1019)
make: *** [staticcheck] Error 1

What did you expect to see?

No staticcheck errors.

What did you see instead? Under which circumstances?

SA1019

Environment

$ go version                                                                                                                                                                                                                           
go version go1.9.2 linux/amd64
$ staticcheck -version
staticcheck (no version)

(it's the latest staticcheck version)

Workaround

$ git diff
diff --git a/Makefile b/Makefile
index 41317fcb..55dfaf05 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@ endif

 STATICCHECK_IGNORE = \
   github.com/prometheus/prometheus/discovery/kubernetes/node.go:SA1019 \
+  github.com/prometheus/prometheus/discovery/kubernetes/kubernetes.go:SA1019 \
   github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter/main.go:SA1019 \
   github.com/prometheus/prometheus/storage/local/codable/codable.go:SA6002 \
   github.com/prometheus/prometheus/storage/local/persistence.go:SA6002 \
@grobie

This comment has been minimized.

Copy link
Member

grobie commented Nov 8, 2017

It is fixed in master already. I'm not sure there is much we can do for an already tagged version.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Nov 8, 2017

We don't change tags once they're released so I don't think there's anything to do here.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Nov 8, 2017

Note that the “fix” is to simply include the warning in STATICCHECK_IGNORE in the Makefile, i.e. exactly the workaround @knweiss mentioned. If you need to build the 1.8.2 tag yourself, patch in the same line.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.