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

Mrtyler instance filter #53

Merged
merged 16 commits into from
Nov 19, 2015
Merged

Mrtyler instance filter #53

merged 16 commits into from
Nov 19, 2015

Conversation

mrtyler
Copy link
Contributor

@mrtyler mrtyler commented Nov 14, 2015

I wanted to try out some stuff with a new instance of the reminder service, but that service has a ton of instances so doing paasta status is slow and painful. Now we can filter instances like we can filter clusters:

(py)troscoe@dev2-devc:~/paasta_tools (mrtyler_instance_filter) $ ./paasta_tools/paasta_cli/paasta_cli.py status -s paasta_canary -c norcal-devc,qwer -i sensu_canary,asdf
Pipeline: https://jenkins.yelpcorp.com/view/services-paasta_canary

cluster: norcal-devc
  instance: sensu_canary
    Git sha:    b8517e76
    Config:     configbb7d0b2a
      Status:   Enabled, Started
      Last:     OK (2015-11-13T16:40, a minute ago)
      Schedule: R/2015-11-14T00:50:00.000Z/PT10M Epsilon: PT60S
      Command:  sensu-scheduled-canary.sh
      Mesos:    Not running

Warning: This service does not have any instance matching these filters:
asdf

Warning: This service does not have any cluster matching these filters:
qwer

@@ -200,9 +213,20 @@ def paasta_status(args):
cluster_filter = args.clusters.split(",")
else:
cluster_filter = None
if args.instances is not None:
instance_filter = args.instances.split(",")
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO instance_filter is a misnomer - filters are generally functions rather than lists; I'd expect 'desired_instances' or something.

Saying that, I see that we use cluster_filter and bogus_filters elsewhere, so I guess you're just following prior art here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I didn't invent this nomenclature.

We could call them _whitelist ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok see this is dumb. we're still having this conversation, github. just because i pushed a commit doesn't mean we're done.

Copy link
Contributor

Choose a reason for hiding this comment

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

_whitelist is good.

@mrtyler
Copy link
Contributor Author

mrtyler commented Nov 18, 2015

r2 - None -> [], filter -> whitelist

"""Warns the user if the filter used is not even in the deployed

def report_bogus_whitelists(whitelists, items, item_type):
"""Warns the user if the whitelist used is not even in the deployed
Copy link
Contributor

Choose a reason for hiding this comment

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

this docstring doesn't make sense to me. """Warns the user if there are invalid values in the whitelist""" would be clearer.

@mrtyler
Copy link
Contributor Author

mrtyler commented Nov 19, 2015

v3 - More renames

@Rob-Johnson
Copy link
Contributor

shipit

mrtyler added a commit that referenced this pull request Nov 19, 2015
@mrtyler mrtyler merged commit d66ced5 into master Nov 19, 2015
@mrtyler mrtyler deleted the mrtyler_instance_filter branch November 19, 2015 19:49
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.

2 participants