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

Allow chef_version to use Gem version semantics? #84

Open
docwhat opened this issue May 14, 2014 · 2 comments
Open

Allow chef_version to use Gem version semantics? #84

docwhat opened this issue May 14, 2014 · 2 comments

Comments

@docwhat
Copy link
Contributor

docwhat commented May 14, 2014

Can we allow chef_version to handle Gem version semantics, such as `~> 11.12'?

It would let us set sane minimums without requiring specific versions.

@tmatilai
Copy link
Contributor

The version number is passed to the Omnitruck API, which doesn't support RubyGems operators. It does support specifying only the major or major plus minor versions, which I think won't pass out validation though.

Of course it would be possible to add our own logic on top of Omnitruck, but I'm not sure if it's worth the effort.

@docwhat
Copy link
Contributor Author

docwhat commented Sep 12, 2014

Hmm... yeah. Tricky.

Maybe a new attribute chef_version_check or something that can be turned into a Gem::Requirement so you can do a satisfied_by? check to decide to even ask the Omnitruck API?

Because, technically, you have two checks there:

  1. Decide if you want to install or not
  2. Omnitruck returning the version

You could add support for Omnitruck API's one-part and two-part version numbers (e.g. 11 or 11.12) which it resolves to 11.12.8-2...

And shouldn't config.rb's retrieve_latest_chef_version() use the Omnitruck API as well? It'd have to be postponed until the install_chef.rb code runs.

Hmm.. except the stupid metadata method doesn't actually return the version number.

You could cheat by using http://www.getchef.com/chef/full_client_list which returns a giant JSON blob with all supported versions. 😁 But then you have do version handling yourself... and weed out the pre-release ones (like the rc ones).

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

No branches or pull requests

2 participants