Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Filtering out non-running containers/tasks/pods #209

Merged
merged 8 commits into from
Dec 19, 2017

Conversation

janmiderback
Copy link
Contributor

@janmiderback janmiderback commented Dec 19, 2017

We should not trust information from Docker containers, Swarm tasks, or K8s pods unless the item is reported as successfully be running.

Also, added logging on when we discard, non-running items. Added debug info on all discovered items and their JSON content. Convenient to have at debug logging level.

Unit test data extended with non-running items to make sure the selection mech works.

@@ -43,12 +43,19 @@ class KubernetesClient {
*/
static async listEngines() {
const pods = await kubeHttpGet(`/api/v1/pods?labelSelector=${Config.discoveryLabel}`);
const validPods = pods.items.filter(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

runningPods is a better name

Copy link
Member

@wennmo wennmo left a comment

Choose a reason for hiding this comment

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

Nice! Just a minor comment

const engine = {
ip: pod.status.podIP,
};
const engine = { ip: pod.status.podIP };
Copy link
Member

Choose a reason for hiding this comment

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

will pods in state running always have an IP?

Copy link
Contributor

@peol peol left a comment

Choose a reason for hiding this comment

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

Nice, LGTM

@janmiderback janmiderback merged commit 3d6749b into master Dec 19, 2017
@janmiderback janmiderback deleted the jm/debug-engine-info branch December 19, 2017 14:09
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