Check for label presence in the validation, don't validate labels on simple role setup
This commit is contained in:
@@ -170,6 +170,8 @@ class Kamal::Configuration::Validator
|
||||
end
|
||||
|
||||
def validate_labels!(labels)
|
||||
return true if labels.blank?
|
||||
|
||||
with_context("labels") do
|
||||
labels.each do |key, _|
|
||||
with_context(key) do
|
||||
|
||||
@@ -6,7 +6,7 @@ class Kamal::Configuration::Validator::Accessory < Kamal::Configuration::Validat
|
||||
error "specify one of `host`, `hosts`, `role`, `roles`, `tag` or `tags`"
|
||||
end
|
||||
|
||||
validate_labels!(config["labels"]) if config.key?("labels")
|
||||
validate_labels!(config["labels"])
|
||||
|
||||
validate_docker_options!(config["options"])
|
||||
end
|
||||
|
||||
@@ -2,12 +2,12 @@ class Kamal::Configuration::Validator::Role < Kamal::Configuration::Validator
|
||||
def validate!
|
||||
validate_type! config, Array, Hash
|
||||
|
||||
validate_labels!(config["labels"]) if config.key?("labels")
|
||||
|
||||
if config.is_a?(Array)
|
||||
validate_servers!(config)
|
||||
else
|
||||
super
|
||||
validate_labels!(config["labels"])
|
||||
validate_docker_options!(config["options"])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user