unifio / covalence

A tool for the management and orchestration of data used by HashiCorp infrastructure tooling.
Mozilla Public License 2.0
7 stars 3 forks source link

sops tasks fail when an update is available for the binary #72

Closed disaac closed 6 years ago

disaac commented 6 years ago

Currently when executing the sops task the version is checked to ensure it adheres to the proper semantics. When an update is available for sops the binary will return the following output as an example:

/workspace # sops --version
sops 3.0.5
[info] sops 3.1.1 is available, update with `go get -u go.mozilla.org/sops/cmd/sops`

The above output results in an error when this occurs like this:

rake aborted!
ArgumentError: 3.0.53.1.1.. is not a valid SemVer Version (http://semver.org)
/opt/gems/ruby/2.4.0/gems/semantic-1.6.1/lib/semantic/version.rb:15:in `initialize'
/opt/gems/ruby/2.4.0/gems/covalence-0.8.1/lib/covalence/core/cli_wrappers/sops_cli.rb:61:in `new'
/opt/gems/ruby/2.4.0/gems/covalence-0.8.1/lib/covalence/core/cli_wrappers/sops_cli.rb:61:in `modify_files'
/opt/gems/ruby/2.4.0/gems/covalence-0.8.1/lib/covalence/core/cli_wrappers/sops_cli.rb:30:in `decrypt_path'
/opt/gems/ruby/2.4.0/gems/covalence-0.8.1/lib/covalence/sops_tasks.rb:14:in `block in run'
/opt/gems/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'
Tasks: TOP => sops:decrypt_path
(See full trace by running task with --trace)

To address this the handling of the SOPS_VERSION parsing needs to be adjusted.

disaac commented 6 years ago

Workaround

example

/workspace # sops --version
sops 3.0.5
[info] sops 3.1.1 is available, update with `go get -u go.mozilla.org/sops/cmd/sops`
SOPS_VERSION=3.0.5

This will prevent covalence from attempting to obtain this version from the command output avoiding the issue and preventing the error.

disaac commented 6 years ago

Issue addressed in v0.8.3