Skip to content

Commit

Permalink
Fix missed conversions from OpenStruct to Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Robinson committed Mar 12, 2020
1 parent bf386d1 commit 7214f9b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/models/git_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ def capture_stdout(*command, dir: repo_cache_dir)
*command,
whitelist_env: ['HOME', 'PATH'],
timeout: 30.minutes,
err: '/dev/null',
dir: dir
)
unless result[:status]
Expand Down
2 changes: 1 addition & 1 deletion plugins/gcloud/lib/samson_gcloud/tag_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def resolve_docker_image_tag(image)
whitelist_env: ["PATH"]
)
raise "GCLOUD ERROR: unable to resolve #{image}\n#{result[:error]}" unless result[:status]
digest = JSON.parse(result.output).dig_fetch("image_summary", "digest")
digest = JSON.parse(result[:output]).dig_fetch("image_summary", "digest")

base = image.split(":", 2).first
"#{base}@#{digest}"
Expand Down
4 changes: 2 additions & 2 deletions test/lib/samson/command_executor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

it "runs in specified directory" do
Dir.mktmpdir("foobar") do |dir|
Samson::CommandExecutor.execute("pwd", timeout: 1, dir: dir).output.must_include dir
Samson::CommandExecutor.execute("pwd", timeout: 1, dir: dir)[:output].must_include dir
end
end

Expand Down Expand Up @@ -101,7 +101,7 @@
it "does not allow env access" do
with_env FOO: 'bar' do
Samson::CommandExecutor.execute("printenv", "FOO", timeout: 1).must_equal(status: false, error: "", output: "")
end
end
end

it "can set env" do
Expand Down

0 comments on commit 7214f9b

Please sign in to comment.