From e7431f9832a1d49353456c6e8d0cf7b7fad7603a Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Thu, 6 Jun 2024 12:53:08 +0100 Subject: [PATCH] Simplfy choosing a builder --- lib/kamal/commands/builder.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/kamal/commands/builder.rb b/lib/kamal/commands/builder.rb index 1e764154..1f105d53 100644 --- a/lib/kamal/commands/builder.rb +++ b/lib/kamal/commands/builder.rb @@ -2,6 +2,7 @@ require "active_support/core_ext/string/filters" class Kamal::Commands::Builder < Kamal::Commands::Base delegate :create, :remove, :push, :clean, :pull, :info, :buildx_inspect, :validate_image, :first_mirror, to: :target + delegate :multiarch?, :local?, :remote?, to: "config.builder" include Clone @@ -10,15 +11,12 @@ class Kamal::Commands::Builder < Kamal::Commands::Base end def target - case - when !config.builder.multiarch? && !config.builder.cached? - local - when !config.builder.multiarch? && config.builder.cached? - local - when config.builder.local? && config.builder.remote? - hybrid - when config.builder.remote? - remote + if remote? + if local? + hybrid + else + remote + end else local end