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
Hardcoded checksums in library helpers #350
Comments
Hi there -- the unknown reason is that it's intended to be a default value, but because the packages are distro specific, there isn't one good default value to put in the resource (it varies by platform). |
I'll work on documenting that the method is intended to supply default values for a specific platform. Do you think there's a better way to do that? I feel like having resource parameters for 'deb checksum' and 'rpm checksum' feels like too much for a resource that might not even represent a package install. After having consulted the Chef listserv, the most common response back I got was something to the effect of "hide the platform specifics in a helper library." |
The only problem for me is that the checksum is not defined in the docs as being a sha256sum, when the Elastic.co website contains sha1sum's on their download page. It is not at first apparent what checksum is needed. |
There are several confusing parts I've identified:
Not to turn this into a general 1.0 cookbook discussion but in my opinion this cookbook goes a bit too far in not using attributes, and the need to read cookbook code to investigate checksum failures when only package version is specified is just one example of that. |
Perhaps it would be worth adding back in some basic recipes that use node attributes to declare the resources. @karmi, what do you think about supplying light weight wrapper recipes that just pass node attributes to the libraries? E.g. something like:
Would end up running this resource:
|
The wrapper cookbook I'm currently building uses a default['elastic']['checksums']['1.4.5']['deb'] = '68dce951181e9802e94fd83b894f4b628394fc44bb01c77eb61fdbd1940d94b5'
default['elastic']['checksums']['1.4.5']['rpm'] = '29b005c4148036556f78d6bd01a5e7c8e4ea60e2c20f82b63d8362ab46d83a19'
default['elastic']['checksums']['1.4.5']['tar'] = 'dc28aa9e441cbc3282ecc9cb498bea219355887b102aac872bdf05d5977356e2'
default['elastic']['checksums']['1.5.0']['deb'] = '15a02a2bea74da2330bb78718efb3a8f83a2b2e040a6ee859e100a6556981f36'
default['elastic']['checksums']['1.5.0']['rpm'] = 'b72a9fb9a2c0471e8fe1a35373cdcfe39d29e72b7281bfccbdc32d03ee0eff70'
default['elastic']['checksums']['1.5.0']['tar'] = 'acf572c606552bc446cceef3f8e93814a363ba0d215b323a2864682b3abfbe45'
default['elastic']['checksums']['1.6.2']['deb'] = 'da22c2df44ade970c7d8ec346fd37a440ed40f9e73fb3427b9eacf44baf298c2'
default['elastic']['checksums']['1.6.2']['rpm'] = '60c75a6f386bd729c6af2995af0a5290dd0ed6286673d435fc52620721815d91'
default['elastic']['checksums']['1.6.2']['tar'] = 'b7ef3aae0a263c2312bd1a25b191c3c108c92d5413c3527d776587e582c518d0'
default['elastic']['checksums']['1.7.1']['deb'] = '5832808f2a4c77de5af225db11da00138d9ea07a17f7b9212f4d2aac5317169d'
default['elastic']['checksums']['1.7.1']['rpm'] = '9b083f441490b32f98f9bf654e5e8ddec885838128726691103cfda5068423bc'
default['elastic']['checksums']['1.7.1']['tar'] = '86a0c20eea6ef55b14345bff5adf896e6332437b19180c4582a346394abde019' Perhaps the same idea could be accomplished within this cookbook, either using node attributes or hard-coded in a helper method? |
@bdclark thank you for the suggestion. I've implemented something like that, for the
I'm torn about adding an attribute to control the default version, as that makes things significantly more confusing, e.g. if I use the |
If the checksum isn't specified, it is assumed to be one of the hardcoded values for an unknown version.
At the very least it should be documented what version it is and what checksum/hashing function is used.
The text was updated successfully, but these errors were encountered: