fog-google icon indicating copy to clipboard operation
fog-google copied to clipboard

Get rid of "name eq .*#{identity}" logic

Open Temikus opened this issue 6 years ago • 3 comments

So, if I'm reading it right the "name eq .*#{identity}" logic is not needed anymore.

I'm talking about the "Servers" for example: https://github.com/fog/fog-google/blob/8780575ea089e75b8628565ec6f112e5e850b419/lib/fog/compute/google/models/servers.rb#L34-L38

I think we shouldn't append the .* to the filter (which used to be important when selecting by self-links, but not anymore) and let users set their own regex if they choose to.

This will also get rid of #33

This is a breaking change so setting to milestone 2.0

@icco WDYT?

Temikus avatar Jul 20 '18 07:07 Temikus

If not needed anymore, let's remove it. I hadn't realized it changed, what's the difference that makes it not needed?

icco avatar Jul 20 '18 12:07 icco

@icco So AFAIK the resources in .all method used to be looked up by self-link attribute, making it necessary to match my_instance to https://www.googleapis.com/compute/v1/projects/my-project/zones/australia-southeast1-c/instances/my_instance. Otherwise I don't see much need with the leading .* in (:filter => "name eq .*#{identity}")

The problem of changing it to (:filter => "name eq .*#{identity}") is that if someone relied on old behavior, i.e. server matching my_server this will break their lookup.

Temikus avatar Jul 21 '18 10:07 Temikus

This issue has been marked inactive and will be closed if no further activity occurs.

github-actions[bot] avatar Apr 18 '21 02:04 github-actions[bot]