Add validator for buildpack arch
This commit is contained in:
@@ -8,6 +8,8 @@ class Kamal::Configuration::Validator::Builder < Kamal::Configuration::Validator
|
|||||||
|
|
||||||
error "Builder arch not set" unless config["arch"].present?
|
error "Builder arch not set" unless config["arch"].present?
|
||||||
|
|
||||||
|
error "buildpacks only support building for one arch" if config["pack"] && config["arch"].is_a?(Array) && config["arch"].size > 1
|
||||||
|
|
||||||
error "Cannot disable local builds, no remote is set" if config["local"] == false && config["remote"].blank?
|
error "Cannot disable local builds, no remote is set" if config["local"] == false && config["remote"].blank?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ class ConfigurationValidationTest < ActiveSupport::TestCase
|
|||||||
assert_error "builder/arch: should be an array or a string", builder: { "arch" => {} }
|
assert_error "builder/arch: should be an array or a string", builder: { "arch" => {} }
|
||||||
assert_error "builder/args: should be a hash", builder: { "args" => [ "foo" ] }
|
assert_error "builder/args: should be a hash", builder: { "args" => [ "foo" ] }
|
||||||
assert_error "builder/cache/options: should be a string", builder: { "cache" => { "options" => [] } }
|
assert_error "builder/cache/options: should be a string", builder: { "cache" => { "options" => [] } }
|
||||||
|
assert_error "builder: buildpacks only support building for one arch", builder: { "arch" => [ "amd64", "arm64" ], "pack" => { "builder" => "heroku/builder:24" } }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user