Skip to content

Commit

Permalink
Add support for --platform argument (#492)
Browse files Browse the repository at this point in the history
Signed-off-by: Noi Sek <[email protected]>
  • Loading branch information
NoiSek authored Apr 26, 2023
1 parent f7e6709 commit befa9be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kubectl_build/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def kubectl_build(ref, context, build_args={}, dockerfile=None,
entrypoint=[], target=None, ssh=None, secret=None,
extra_tag=None, cache_from=[], pull=False,
registry_secret=None, push=False,
namespace=None, builder=None):
namespace=None, builder=None, platform=None):
# incompatible parameters with docker_build:
# only
# container_args
Expand Down Expand Up @@ -42,6 +42,8 @@ def kubectl_build(ref, context, build_args={}, dockerfile=None,
kwargs["cache_from"] = cache_from
if pull != None:
kwargs["pull"] = pull
if platform != None:
kwargs["platform"] = platform
docker_build(**kwargs)
return
pre_command = ""
Expand Down Expand Up @@ -95,6 +97,8 @@ def kubectl_build(ref, context, build_args={}, dockerfile=None,
else:
for s in secret:
command += ['--secret', s]
if platform:
command += ['--platform', platform]
command = [shlex.quote(c) for c in command]
command += ['-t', '$EXPECTED_REF']
command += [shlex.quote(context)]
Expand Down

0 comments on commit befa9be

Please sign in to comment.