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

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

Open
Temikus opened this issue Jul 20, 2018 · 3 comments
Open

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

Temikus opened this issue Jul 20, 2018 · 3 comments

Comments

@Temikus
Copy link
Member

Temikus commented Jul 20, 2018

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

I'm talking about the "Servers" for example:

else
server = all(:filter => "name eq .*#{identity}").first
response = server.attributes if server
end
return nil if response.nil?

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 Temikus added this to the 2.0 milestone Jul 20, 2018
@Temikus Temikus self-assigned this Jul 20, 2018
@icco
Copy link
Member

icco commented Jul 20, 2018

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

@Temikus
Copy link
Member Author

Temikus commented Jul 21, 2018

@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.

@github-actions
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants