Skip to content

Commit

Permalink
Add internal_index_image_copy and internal_index_image_copy_resolved
Browse files Browse the repository at this point in the history
For Add and Rm Requests only

Refers to CLOUDDST-13288
  • Loading branch information
yashvardhannanavati committed Jun 13, 2022
1 parent 6e6b537 commit 79dba0f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions iiblib/iib_build_details_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ class AddModel(IIBBuildDetailsModel):
A reference of new index image
index_image (str)
A reference of index image to rebuild
internal_index_image_copy (str)
A reference of IIB's internal copy of the built index image
internal_index_image_copy_resolved (str)
A reference of resolved IIB's internal copy of the built index image
removed_operators (list)
A list of operators to be removed from index image
organization (str)
Expand All @@ -230,6 +234,8 @@ class AddModel(IIBBuildDetailsModel):
"from_index_resolved",
"index_image",
"index_image_resolved",
"internal_index_image_copy",
"internal_index_image_copy_resolved",
"omps_operator_version",
"organization",
"removed_operators",
Expand All @@ -247,6 +253,8 @@ class AddModel(IIBBuildDetailsModel):
"from_index_resolved",
"index_image",
"index_image_resolved",
"internal_index_image_copy",
"internal_index_image_copy_resolved",
"removed_operators",
"organization",
"omps_operator_version",
Expand Down Expand Up @@ -282,6 +290,10 @@ class RmModel(IIBBuildDetailsModel):
A reference of new index image
index_image (str)
A reference of index image to rebuild
internal_index_image_copy (str)
A reference of IIB's internal copy of the built index image
internal_index_image_copy_resolved (str)
A reference of resolved IIB's internal copy of the built index image
removed_operators (list)
A list of operators to be removed from index image
organization (str)
Expand All @@ -300,6 +312,8 @@ class RmModel(IIBBuildDetailsModel):
"from_index_resolved",
"index_image",
"index_image_resolved",
"internal_index_image_copy",
"internal_index_image_copy_resolved",
"organization",
"removed_operators",
]
Expand All @@ -315,6 +329,8 @@ class RmModel(IIBBuildDetailsModel):
"from_index_resolved",
"index_image",
"index_image_resolved",
"internal_index_image_copy",
"internal_index_image_copy_resolved",
"organization",
"removed_operators",
]
Expand Down
24 changes: 24 additions & 0 deletions tests/test_iib_build_details_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def fixture_add_build_details_json():
"from_index_resolved": "from_index_resolved",
"index_image": "index_image",
"index_image_resolved": "index_image_resolved",
"internal_index_image_copy": "internal_index_image_copy",
"internal_index_image_copy_resolved": "index_image_copy_resolved",
"removed_operators": ["operator1"],
"organization": "organization",
"omps_operator_version": {"operator": "1.0"},
Expand Down Expand Up @@ -65,6 +67,8 @@ def fixture_rm_build_details_json():
"from_index_resolved": "from_index_resolved",
"index_image": "index_image",
"index_image_resolved": "index_image_resolved",
"internal_index_image_copy": "internal_index_image_copy",
"internal_index_image_copy_resolved": "index_image_copy_resolved",
"removed_operators": ["operator1"],
"organization": "organization",
"distribution_scope": "null",
Expand Down Expand Up @@ -249,6 +253,8 @@ def test_from_dict_failure(
from_index_resolved="from_index_resolved",
index_image="index_image",
index_image_resolved="index_image_resolved",
internal_index_image_copy="internal_index_image_copy",
internal_index_image_copy_resolved="index_image_copy_resolved",
removed_operators=["operator1"],
organization="organization",
omps_operator_version={"operator": "1.0"},
Expand Down Expand Up @@ -320,6 +326,8 @@ def test_to_dict_rm(fixture_rm_build_details_json):
from_index_resolved="from_index_resolved",
index_image="index_image",
index_image_resolved="index_image_resolved",
internal_index_image_copy="internal_index_image_copy",
internal_index_image_copy_resolved="index_image_copy_resolved",
removed_operators=["operator1"],
organization="organization",
distribution_scope="null",
Expand Down Expand Up @@ -409,6 +417,14 @@ def test_add_model_attributes(fixture_add_build_details_json):
assert model.from_index == model._data["from_index"]
assert model.from_index_resolved == model._data["from_index_resolved"]
assert model.index_image == model._data["index_image"]
assert (
model.internal_index_image_copy
== model._data["internal_index_image_copy"]
)
assert (
model.internal_index_image_copy_resolved
== model._data["internal_index_image_copy_resolved"]
)
assert model.removed_operators == model._data["removed_operators"]
assert model.organization == model._data["organization"]
assert model.omps_operator_version == model._data["omps_operator_version"]
Expand All @@ -426,6 +442,14 @@ def test_rm_model_attributes(fixture_rm_build_details_json):
assert model.from_index == model._data["from_index"]
assert model.from_index_resolved == model._data["from_index_resolved"]
assert model.index_image == model._data["index_image"]
assert (
model.internal_index_image_copy
== model._data["internal_index_image_copy"]
)
assert (
model.internal_index_image_copy_resolved
== model._data["internal_index_image_copy_resolved"]
)
assert model.removed_operators == model._data["removed_operators"]
assert model.organization == model._data["organization"]
assert model.distribution_scope == model._data["distribution_scope"]
Expand Down
4 changes: 4 additions & 0 deletions tests/test_iib_build_details_pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def fixture_add_build_details_json():
"from_index_resolved": "from_index_resolved",
"index_image": "index_image",
"index_image_resolved": "index_image_resolved",
"internal_index_image_copy": "internal_index_image_copy",
"internal_index_image_copy_resolved": "index_image_copy_resolved",
"removed_operators": ["operator1"],
"organization": "organization",
"omps_operator_version": {"operator": "1.0"},
Expand Down Expand Up @@ -59,6 +61,8 @@ def fixture_add_build_details_json2():
"bundle_mapping": {"bundle_mapping": "map"},
"from_index": "from_index",
"from_index_resolved": "from_index_resolved",
"internal_index_image_copy": "internal_index_image_copy",
"internal_index_image_copy_resolved": "index_image_copy_resolved",
"index_image": "index_image",
"index_image_resolved": "index_image_resolved",
"removed_operators": ["operator1"],
Expand Down
6 changes: 6 additions & 0 deletions tests/test_iib_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def fixture_add_build_details_json():
"from_index_resolved": "from_index_resolved",
"index_image": "index_image",
"index_image_resolved": "index_image_resolved",
"internal_index_image_copy": "internal_index_image_copy",
"internal_index_image_copy_resolved": "index_image_copy_resolved",
"removed_operators": ["operator1"],
"organization": "organization",
"omps_operator_version": {"operator": "1.0"},
Expand Down Expand Up @@ -74,6 +76,8 @@ def fixture_rm_build_details_json():
"from_index_resolved": "from_index_resolved",
"index_image": "index_image",
"index_image_resolved": "index_image_resolved",
"internal_index_image_copy": "internal_index_image_copy",
"internal_index_image_copy_resolved": "index_image_copy_resolved",
"removed_operators": ["operator1"],
"organization": "organization",
"distribution_scope": "null",
Expand Down Expand Up @@ -105,6 +109,8 @@ def fixture_deprecation_list_build_details_json():
"from_index_resolved": "from_index_resolved",
"index_image": "index_image",
"index_image_resolved": "index_image_resolved",
"internal_index_image_copy": "internal_index_image_copy",
"internal_index_image_copy_resolved": "index_image_copy_resolved",
"removed_operators": ["operator1"],
"organization": "organization",
"omps_operator_version": {"operator": "1.0"},
Expand Down

0 comments on commit 79dba0f

Please sign in to comment.