Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Conversation

@igorpeshansky
Copy link
Contributor

No description provided.

Copy link
Contributor

@supriyagarg supriyagarg left a comment

Choose a reason for hiding this comment

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

A few comments on kubernetes.cc. These are on unedited lines, so commenting at the top level:

L56: kK8sNodeResourcePrefix is no longer used.

L44: kKubernetesApiVersion -> why is this fixed to 1.6? Is there a way to know the current kubernetes version?

@igorpeshansky
Copy link
Contributor Author

Responding to @supriyagarg:

L56: kK8sNodeResourcePrefix is no longer used.

Removed.

L44: kKubernetesApiVersion -> why is this fixed to 1.6? Is there a way to know the current kubernetes version?

Not really. That said, we talked about tagging this with the actual API version (e.g., "v1", "v1beta1", etc). Out of scope for this PR, though.

Copy link
Contributor

@supriyagarg supriyagarg left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

{"topLevelControllerType", json::string(top_level_kind)},
{"topLevelControllerName", json::string(top_level_name)},
})},
{"nodeName", json::string(node_name)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a common convention to use camel casing for metadata labels vs underscores for resource labels? Is there any value in trying to push for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The monitored resource labels use snake_case. Since the associations are part of the metadata blobs, we've tried to be consistent with the source of the metadata -- in this case, the Kubernetes API. Kubernetes uses camelCase, so we stuck with that.

Copy link
Contributor

Choose a reason for hiding this comment

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

SGTM

: "Pod";

const json::Object* spec = pod->Get<json::Object>("spec");
const std::string node_name = spec->Get<json::String>("nodeName");
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when node name is not set? Is the value null or empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If node name is not set, this will throw a json::Exception. However, given that our query filters the pods that run on this node, those pods will definitely have a node name.
That said, we should figure out what to do about node-less (unscheduled) pods. I've added a comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great point, SGTM!

Copy link
Contributor Author

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

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

PTAL.

: "Pod";

const json::Object* spec = pod->Get<json::Object>("spec");
const std::string node_name = spec->Get<json::String>("nodeName");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If node name is not set, this will throw a json::Exception. However, given that our query filters the pods that run on this node, those pods will definitely have a node name.
That said, we should figure out what to do about node-less (unscheduled) pods. I've added a comment.

{"topLevelControllerType", json::string(top_level_kind)},
{"topLevelControllerName", json::string(top_level_name)},
})},
{"nodeName", json::string(node_name)},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The monitored resource labels use snake_case. Since the associations are part of the metadata blobs, we've tried to be consistent with the source of the metadata -- in this case, the Kubernetes API. Kubernetes uses camelCase, so we stuck with that.

Copy link
Contributor

@bmoyles0117 bmoyles0117 left a comment

Choose a reason for hiding this comment

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

LGTM

@igorpeshansky igorpeshansky merged commit 570623c into master Feb 2, 2018
@igorpeshansky igorpeshansky deleted the igorp-remove-node-name branch February 2, 2018 20:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants