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

Updating version does not update the binary #38

Closed
scalp42 opened this issue Dec 18, 2015 · 8 comments
Closed

Updating version does not update the binary #38

scalp42 opened this issue Dec 18, 2015 · 8 comments

Comments

@scalp42
Copy link
Contributor

scalp42 commented Dec 18, 2015

Upgrading does not appear to be upgrading the binary:

default['consul_template']['version'] = '0.12.0'
default['consul_template']['checksums']['consul-template_0.12.0_linux_amd64'] = '1fff23fa44fd0af0cb56f011a911af1e9d407a2eeb360f520a503d2f330fdf43'
Recipe: consul-template::install_binary
  * ark[consul-template] action cherry_pick
    * directory[/usr/local/bin] action create (up to date)
    * remote_file[/var/chef/cache/consul-template.zip] action create
      - create new file /var/chef/cache/consul-template.zip
      - update content in file /var/chef/cache/consul-template.zip from none to 1fff23
      (new content is binary, diff output suppressed)
    * execute[cherry_pick consul-template from /var/chef/cache/consul-template.zip] action nothing (skipped due to action :nothing)
    * execute[set owner on /usr/local/bin] action nothing (skipped due to action :nothing)
    * execute[cherry_pick consul-template from /var/chef/cache/consul-template.zip] action run (up to date)

  * file[/usr/local/bin/consul-template] action touch
    - update utime on file /usr/local/bin/consul-template
root@i-014fe1d8# consul-template --version
2015/12/18 02:05:07 [DEBUG] (logging) setting up logging
2015/12/18 02:05:07 [DEBUG] (logging) config:

{
  "name": "consul-template",
  "level": "WARN",
  "syslog": false,
  "syslog_facility": "LOCAL0"
}

consul-template v0.10.0
@ccannell67
Copy link
Contributor

Yeah, I believe that is due to using the 'creates' attribute with the 'cherry_pick' action in the ark resource - https://github.com/adamkrone/chef-consul-template/blob/master/recipes/install_binary.rb#L32

using 'creates', keeps the extraction from running every time, since it checks for existence of file.

To handle updates, ark :install should probably be used to install to a versioned path and use a symlink to the binary.

That or do version checking of the consul-template library.

@scalp42
Copy link
Contributor Author

scalp42 commented Dec 22, 2015

Nice catch @ccannell67 !

Going to ping @someara @sigje @tas50,

Should I open an issue in ark ?

@adamkrone
Copy link
Owner

It sounds like we should be symlinking, or using our own guard, as @ccannell67 mentioned.

I should have some time over the holidays to take a look at this, but feel free to submit a PR if you'd like to take a stab at it.

adamkrone added a commit that referenced this issue Jan 15, 2016
- removes ark (uses libarchive instead)
- fixes version updates using a symlink (Issue #38)
- fixes issue that could cause a zero-length consul-template file to be
  created (Issue #40)
- updates checksums to use releases.hashicorp.com for all version (also
  simplified install_binary logic)
- adds new 0.12.2 version to checksums
@adamkrone
Copy link
Owner

@scalp42 I just merged some changes into master that updates the way binaries are downloaded/extracted/etc. I moved away from ark, and it's now using a symlink.

Let me know if this fixes things for you. If everything checks out, I will be releasing a new version on the supermarket soon.

@scalp42
Copy link
Contributor Author

scalp42 commented Jan 15, 2016

@adamkrone just saw that. Thanks for looking into it.

I'm hoping to tinker with it today or Tuesday!

@scalp42
Copy link
Contributor Author

scalp42 commented Jan 18, 2016

Testing.

@scalp42
Copy link
Contributor Author

scalp42 commented Jan 18, 2016

@adamkrone working great! Updated consul-template version itself and the chef-consul-template cookbook version at same time.

💯

@scalp42
Copy link
Contributor Author

scalp42 commented Jan 18, 2016

Closing as it's fixed in master.

@scalp42 scalp42 closed this as completed Jan 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants