tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
571 stars 99 forks source link

Only query allocated remote assets #498

Closed william-richard closed 7 years ago

william-richard commented 7 years ago

If you decommission an asset for multicollins, it shouldn't try to query it anymore.

I have tested this and it works as expected.

@tumblr/collins @byxorna @discordianfish

discordianfish commented 7 years ago

@Primer42 I never used multicollins (but we're planning to), so not sure about the details. But why limit it to allocated assets? Shouldn't it possible to search for any kind of asset, even decomissioned?

roymarantz commented 7 years ago

I believe this code is used to find the remote collins instances to query so it 👍

william-richard commented 7 years ago

@discordianfish sorry for the confusion - the way multicollins works is that you create an asset (usually of type DATA_CENTER) in your local instance of collins, and set an attribute (default is LOCATION) with the url with creds that allow you to query the remote collins i.e. http://user:pass@collins.other-dc.example.com/. If you ask collins to do a remote query, it searches its local database for all of the assets of the correct type with the LOCATION attribute set, and uses the value of that LOCATION attribute to query the remote collins, and returns the results all together. I'm modifying the code that does that local search, so when it's trying to find the remote datacenter assets, it only chooses Allocated assets instead of choosing all datacenter assets regardless of state. Does that make more sense?

discordianfish commented 7 years ago

@Primer42 Ah! Got it. In this case, LGTM!

defect commented 7 years ago

👍

ssgelm commented 3 years ago

Just FYI this should be documented somewhere. Nowhere is it specified in the docs that DATA_CENTER assets must be in the allocated state and ours were not (cause it never seemed to matter in the past).