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

Updates node configz and healthz endpoints #467

Merged
merged 2 commits into from
Jul 11, 2018

Conversation

chuckha
Copy link
Contributor

@chuckha chuckha commented Jul 5, 2018

Fixes #465

The proxy subresource was moved in k8s v1.10

Signed-off-by: Chuck Ha [email protected]

What this PR does / why we need it:
This fixes the configz and healthz outputs. They were null as of k8s 1.10. However, no one really noticed so I wonder how many people use or need this feature.

Special notes for your reviewer:

Release note:

NONE

@chuckha chuckha requested review from timothysc and liztio July 5, 2018 18:05
Resource("nodes").
Name(node.Name).
SubResource("proxy").
Suffix("configz")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b/c the signatures are nearly identical, you could probably wrap into a generic proxy-getter closure or f(n).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reasonable request.

@chuckha chuckha force-pushed the configz-healthz branch 3 times, most recently from 98b0f23 to 13018ba Compare July 9, 2018 20:19
@chuckha
Copy link
Contributor Author

chuckha commented Jul 9, 2018

@timothysc updated as per requested and refactored some logic I added TODOs with where I would like to see this go. My goal with these changes is to get something testable. If the entire kubernetes.Interface interface is a parameter of the function then you're out of luck for testing. I'd like to start pushing the big dependencies up to make the small pieces unit testable.

_, err = untypedQuery(out, "configz.json", func() (interface{}, error) {
var configz map[string]interface{}
_, err := untypedQuery(out, "configz.json", func() (interface{}, error) {
result, err := getNodeEndpoint(restclient, name, "configz")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you ignoring the error here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b/c it could be overridden | masked by the raw call below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the error is ignored, thanks for 👀

@chuckha
Copy link
Contributor Author

chuckha commented Jul 10, 2018

/hold

@chuckha
Copy link
Contributor Author

chuckha commented Jul 11, 2018

/hold cancel

This is good to go.

It's two commits as opposed to two PRs since the second commit depends on the first but is a logically separate issue.

Copy link
Contributor

@timothysc timothysc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit otherwise lgtm.

merge at will.

SubResource("proxy").
Suffix(endpoint)

// Get the configz endpoint, put the result in the nodeData
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ the comment above no longer makes sense, since it's generic.

Chuck Ha added 2 commits July 11, 2018 12:59
Fixes vmware-tanzu#465

The proxy subresource was moved in k8s v1.10

Signed-off-by: Chuck Ha <[email protected]>
@chuckha chuckha merged commit 5a2bbf1 into vmware-tanzu:master Jul 11, 2018
@chuckha chuckha deleted the configz-healthz branch July 11, 2018 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

configz and healthz are failing
2 participants