Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion posit-bakery/posit_bakery/image/bake/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def from_image_target(
]

if image_target.temp_name is not None:
kwargs["tags"] = [image_target.temp_name.rsplit(":", 1)[0]]
kwargs["tags"] = [image_target.temp_name]

secrets = [s.as_bake_json() for s in image_target.resolved_build_secrets]
if secrets:
Expand Down
12 changes: 12 additions & 0 deletions posit-bakery/test/image/bake/test_bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ def test_target_included_in_json_when_set(self, basic_standard_image_target):
json_data = bake_target.model_dump(exclude_none=True)
assert json_data["target"] == "my-stage"

def test_temp_registry_with_port_not_mangled(self, basic_standard_image_target):
"""A temp registry with a port keeps its full reference as the bake target tag (#738)."""
basic_standard_image_target.settings = ImageTargetSettings(temp_registry="localhost:5000")
bake_target = BakeTarget.from_image_target(basic_standard_image_target)
assert bake_target.tags == ["localhost:5000/test-image/tmp"]

def test_temp_name_matches_build_strategy(self, basic_standard_image_target):
"""Bake and build strategies derive the same temp image.name (#738)."""
basic_standard_image_target.settings = ImageTargetSettings(temp_registry="localhost:5000")
bake_target = BakeTarget.from_image_target(basic_standard_image_target)
assert bake_target.tags == [basic_standard_image_target.temp_name]

def test_secret_populated_when_env_set(self, basic_standard_image_target, monkeypatch):
"""Configured build secrets surface on the bake target as env-typed dicts."""
from posit_bakery.config.image.build_secret import BuildSecret
Expand Down
Loading