Skip to content

Commit

Permalink
Increase timeouts back and add fix login_to_external_registry
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Oct 22, 2024
1 parent a14a2c5 commit dd09123
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
3 changes: 0 additions & 3 deletions container_ci_suite/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ def helm_installation(self, values: Dict = None):
command_values = ' '.join(
[f"--set {key}={value}" for key, value in utils.shared_cluster_variables().items()]
)
if "name" in values:
date_string = utils.get_datetime_string()
values["name"] = self.get_name_from_values_yaml() + f"-{date_string}"
command_values += " " + ' '.join([f"--set {key}={value}" for key, value in values.items()])
if self.is_pvc_in_values_yaml():
command_values += f" --set pvc.netapp_nfs=true --set pvc.app_code={utils.get_shared_variable('app_code')}"
Expand Down
10 changes: 5 additions & 5 deletions container_ci_suite/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ def login_to_shared_cluster(self):

@staticmethod
def login_external_registry() -> Any:
registry_url = utils.get_shared_variable("internal_image_registry")
robot_token = utils.get_shared_variable("robot_account")
robot_name = utils.load_shared_credentials("ROBOT_NAME")
registry_url = utils.get_shared_variable("registry_url")
robot_token = utils.load_shared_credentials("ROBOT_TOKEN")
robot_name = utils.get_shared_variable("robot_account")
if not all([registry_url, robot_token, robot_name]):
print(
"Important variable ROBOT_TOKEN or variables in file /root/shared_cluster"
" 'internal_image_registry,robot_account' are missing."
" 'registry_url,robot_account' are missing."
)
return None
cmd = f"podman login -u {robot_name} -p {robot_token} {registry_url}"
cmd = f"podman login -u \"{robot_name}\" -p \"{robot_token}\" {registry_url}"
output = utils.run_command(
cmd=cmd,
ignore_error=False,
Expand Down
10 changes: 5 additions & 5 deletions container_ci_suite/openshift_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def is_pod_running(self, pod_name_prefix: str = "", loops: int = 180) -> bool:
output = self.get_logs(pod_name=pod_name)
print(output)
# Wait couple seconds for sure
time.sleep(1)
time.sleep(3)
return True
time.sleep(1)
time.sleep(3)
return False

def is_build_pod_present(self) -> bool:
Expand Down Expand Up @@ -174,7 +174,7 @@ def is_build_pod_finished(self, cycle_count: int = 180) -> bool:
print(".", sep="", end="")
if self.build_failed:
return False
time.sleep(1)
time.sleep(3)
continue
print("\nBuild pod is finished")
return True
Expand All @@ -194,7 +194,7 @@ def is_s2i_pod_running(self, pod_name_prefix: str = "", cycle_count: int = 180)
time.sleep(1)
continue
if not self.is_pod_finished(pod_suffix_name="build"):
time.sleep(1)
time.sleep(3)
continue
build_pod_finished = True
print(f"\nBuild pod with name {pod_name_prefix} is finished.")
Expand All @@ -206,7 +206,7 @@ def is_s2i_pod_running(self, pod_name_prefix: str = "", cycle_count: int = 180)
for count in range(cycle_count):
print(".", sep="", end="")
if not self.is_pod_running():
time.sleep(1)
time.sleep(3)
continue
print("\nPod is running")
return True
Expand Down
3 changes: 2 additions & 1 deletion container_ci_suite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ def shared_cluster_variables() -> dict:
shared_cluster_data = {
"registry.enabled": "true",
"registry.name": get_shared_variable("registry_url"),
"registry.namespace": "core-services-ocp"
"registry.namespace": "core-services-ocp",
"registry.push_secret": get_shared_variable("push_secret"),
}
return shared_cluster_data

Expand Down

0 comments on commit dd09123

Please sign in to comment.