Skip to content

Commit

Permalink
Calculate the tag based on the name of the base image (#2740)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw authored Sep 10, 2024
1 parent 7290c2a commit 15d82ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flytekit/image_spec/image_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def tag(self) -> str:
# copy the image spec to avoid modifying the original image spec. otherwise, the hash will be different.
spec = copy.deepcopy(self)
if isinstance(spec.base_image, ImageSpec):
spec = dataclasses.replace(spec, base_image=spec.base_image)
spec = dataclasses.replace(spec, base_image=spec.base_image.image_name())

if self.source_root:
from flytekit.tools.fast_registration import compute_digest
Expand Down
2 changes: 1 addition & 1 deletion tests/flytekit/unit/core/image_spec/test_image_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_image_spec(mock_image_spec_builder, monkeypatch):
assert image_spec._is_force_push is True
assert image_spec.entrypoint == ["/bin/bash"]

assert image_spec.image_name() == f"localhost:30001/flytekit:lh20ze1E7qsZn5_kBQifRw"
assert image_spec.image_name() == f"localhost:30001/flytekit:nDg0IzEKso7jtbBnpLWTnw"
ctx = context_manager.FlyteContext.current_context()
with context_manager.FlyteContextManager.with_context(
ctx.with_execution_state(ctx.execution_state.with_params(mode=ExecutionState.Mode.TASK_EXECUTION))
Expand Down

0 comments on commit 15d82ef

Please sign in to comment.