Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cert when querying modelmesh / kserve #2081

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
32 changes: 14 additions & 18 deletions ods_ci/libs/Helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def send_random_inference_request(
value_range=[0, 255],
shape={"B": 1, "C": 3, "H": 512, "W": 512},
no_requests=100,
cert_file=None,
):
for _ in range(no_requests):
data_img = [
Expand All @@ -243,25 +244,20 @@ def send_random_inference_request(
+ " }]}"
)

request_kwargs = {"url": endpoint, "headers": headers, "data": data}

if cert_file is not None:
request_kwargs["verify"] = cert_file

# This file only exists when running on self-managed clusters
ca_bundle = Path("openshift_ca.crt")
knative_ca_bundle = Path("openshift_ca_istio_knative.crt")
if ca_bundle.is_file():
response = requests.post(
endpoint,
headers=headers,
data=data,
verify="openshift_ca.crt",
)
elif knative_ca_bundle.is_file():
response = requests.post(
endpoint,
headers=headers,
data=data,
verify="openshift_ca_istio_knative.crt",
)
else:
response = requests.post(endpoint, headers=headers, data=data)
elif ca_bundle := Path("openshift_ca.crt"):
request_kwargs["verify"] = ca_bundle

elif knative_ca_bundle := Path("openshift_ca_istio_knative.crt"):
request_kwargs["verify"] = knative_ca_bundle

response = requests.post(**request_kwargs)

return response.status_code, response.text # pyright: ignore [reportPossiblyUnboundVariable]

@keyword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,20 +414,22 @@
[Documentation] Deletes all currently deployed models, if any are present.
# Returns an empty list if no matching elements found
Switch Model Serving Project project_name=All projects
@{projects}= Get WebElements xpath://table/tbody/tr/td[@data-label="Project"]
WHILE len(@{projects}) > 0
${projects}= Get WebElements xpath://table/tbody/tr/td[@data-label="Project"]
${projects_length}= Get length ${projects}
WHILE ${projects_length} > 0
${project}= Set Variable ${projects}[0]
${project}= Get Text ${project}
@{project description}= Split String ${project}
Switch Model Serving Project ${project description}[0]
${models}= Get WebElements xpath://table/tbody/tr/td[@data-label="Name"]/div/a
${models}= Get WebElements xpath://table/tbody/tr/td[@data-label="Name"]
FOR ${model} IN @{models}
${model}= Get Text ${model}
Delete Model Via UI ${model}
Sleep 1s
END
Switch Model Serving Project project_name=All projects
@{projects}= Get WebElements xpath://table/tbody/tr/td[@data-label="Project"]
${projects}= Get WebElements xpath://table/tbody/tr/td[@data-label="Project"]
${projects_length}= Get length ${projects}

Check notice

Code scanning / Robocop

Variable '{{ name }}' is assigned but not used Note test

Variable '${projects_length}' is assigned but not used
END

Add Namespace To ServiceMeshMemberRoll
Expand Down
Loading