File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
tests/flytekit/unit/core/image_spec Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ def id(self) -> str:
160160
161161 :return: a unique identifier of the ImageSpec
162162 """
163- parameters_to_exclude = ["pip_secret_mounts" ]
163+ parameters_to_exclude = ["pip_secret_mounts" , "builder" ]
164164 # Only get the non-None values in the ImageSpec to ensure the hash is consistent across different Flytekit versions.
165165 image_spec_dict = asdict (
166166 self , dict_factory = lambda x : {k : v for (k , v ) in x if v is not None and k not in parameters_to_exclude }
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def test_image_spec(mock_image_spec_builder, monkeypatch):
6363 assert image_spec .entrypoint == ["/bin/bash" ]
6464 assert image_spec .copy == ["/src/file1.txt" , "/src" , "/src/file2.txt" ]
6565
66- assert image_spec .image_name () == f"localhost:30001/flytekit:AjLtng9gJfYzLnjbNy70gA "
66+ assert image_spec .image_name () == f"localhost:30001/flytekit:{ image_spec . tag } "
6767 ctx = context_manager .FlyteContext .current_context ()
6868 with context_manager .FlyteContextManager .with_context (
6969 ctx .with_execution_state (ctx .execution_state .with_params (mode = ExecutionState .Mode .TASK_EXECUTION ))
@@ -294,3 +294,10 @@ def test_image_spec_same_id_and_tag_with_pip_secret_mounts():
294294 image_spec_with_pip_secret_mounts = ImageSpec (name = "my_image" , pip_secret_mounts = [("src" , "dst" )])
295295 assert image_spec .id == image_spec_with_pip_secret_mounts .id
296296 assert image_spec .tag == image_spec_with_pip_secret_mounts .tag
297+
298+
299+ def test_image_spec_same_id_and_tag_with_builder ():
300+ image_spec = ImageSpec (name = "my_image" )
301+ image_spec_with_builder = ImageSpec (name = "my_image" , builder = "envd" )
302+ assert image_spec .id == image_spec_with_builder .id
303+ assert image_spec .tag == image_spec_with_builder .tag
You can’t perform that action at this time.
0 commit comments