godaddy / godaddy/kubernetes-client

Get pods via LabelSelctor

Open
#144 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted request for example
Dominant language
JavaScript
Stars
962
Forks
189
PR merge metrics
No merged PRs in 30d

Description

When trying to get pods via label selector I get all pods returned in the name space.
core.ns.po.get({ qs: { labelSelector: 'mylabel=thelabel' } }, (err, results) = > { console.log(results); });

Not sure what the correct method would be for getting pods based on label selectors. Looking through the code base, I noticed the .get on pods will not accept the label selector.
https://github.com/godaddy/kubernetes-client/blob/master/lib/replicationcontrollers.js#L46

Am I overlooking something simple?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the core.ns.po.get entry point and inspect the related request handling in lib/replicationcontrollers.js, especially the label-selector behavior mentioned in the issue. Confirm that passing labelSelector filters the returned pods rather than returning every pod in the namespace, and verify the result against the reported example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, kubernetes, nodejs
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.