Skip to content

Commit

Permalink
Merge c28149c into 160446b
Browse files Browse the repository at this point in the history
  • Loading branch information
midnightercz committed Mar 30, 2020
2 parents 160446b + c28149c commit 358d64d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
8 changes: 8 additions & 0 deletions pubtools/iib/iib_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@
"type": str,
"count": "+",
},
("--overwrite-from-index",): {
"group": "IIB service",
"help": "overwrite from_index_image as output",
"required": False,
"type": bool,
},
}

ADD_CMD_ARGS = CMD_ARGS.copy()
Expand Down Expand Up @@ -192,6 +198,8 @@ def _iib_op_main(args, operation=None, items_final_state="PUSHED"):
extra_args = {"cnr_token": args.iib_cnr_token}
if args.iib_legacy_org:
extra_args["organization"] = args.iib_legacy_org
if args.overwrite_from_index:
extra_args["overwrite_from_index"] = args.overwrite_from_index

build_details = bundle_op(
args.index_image,
Expand Down
13 changes: 10 additions & 3 deletions tests/test_iib_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def fixture_common_iib_op_args():
"--iib-krb-principal",
"example@REALM",
"--iib-insecure",
"--overwrite-from-index",
]


Expand Down Expand Up @@ -150,6 +151,7 @@ def test_add_bundles_cli(
["arch"],
cnr_token="cnr_token",
organization="legacy-org",
overwrite_from_index=True,
)
fixture_pulplib_repo_sync.assert_called_once()
assert fixture_pulplib_repo_sync.mock_calls[0].args[0].feed == "https://feed.com"
Expand Down Expand Up @@ -264,7 +266,12 @@ def test_add_bundles_py(
"iib-server", auth=fixture_iib_krb_auth.return_value, ssl_verify=False
)
fixture_iib_client.return_value.add_bundles.assert_called_once_with(
"index-image", "binary-image", ["bundle1"], ["arch"], cnr_token="cnr_token"
"index-image",
"binary-image",
["bundle1"],
["arch"],
cnr_token="cnr_token",
overwrite_from_index=True,
)
fixture_pulplib_repo_sync.assert_called_once()
assert fixture_pulplib_repo_sync.mock_calls[0].args[0].feed == "https://feed.com"
Expand Down Expand Up @@ -300,7 +307,7 @@ def test_remove_operators_cli(
"iib-server", auth=fixture_iib_krb_auth.return_value, ssl_verify=False
)
fixture_iib_client.return_value.remove_operators.assert_called_once_with(
"index-image", "binary-image", ["op1"], ["arch"]
"index-image", "binary-image", ["op1"], ["arch"], overwrite_from_index=True
)
fixture_pulplib_repo_sync.assert_called_once()
assert fixture_pulplib_repo_sync.mock_calls[0].args[0].feed == "https://feed.com"
Expand Down Expand Up @@ -417,7 +424,7 @@ def test_remove_operators_py(
"iib-server", auth=fixture_iib_krb_auth.return_value, ssl_verify=False
)
fixture_iib_client.return_value.remove_operators.assert_called_once_with(
"index-image", "binary-image", ["op1"], ["arch"]
"index-image", "binary-image", ["op1"], ["arch"], overwrite_from_index=True
)
fixture_pulplib_repo_sync.assert_called_once()
assert fixture_pulplib_repo_sync.mock_calls[0].args[0].feed == "https://feed.com"
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def setup_task(
arches,
cnr_token=None,
organization=None,
overwrite_from_index=False,
state_seq=("in_progress", "finished"),
op_type="add",
):
Expand Down

0 comments on commit 358d64d

Please sign in to comment.