Skip to content

Commit 8d20327

Browse files
committed
Fix: Add annotations regarding s3 related information for serviceaccount
Some test casess use serviceaccount to set aws credential but the way how to set endpoint is wrong. It should use annotations. Signed-off-by: Jooho Lee <jlee@redhat.com>
1 parent c3d0741 commit 8d20327

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

utilities/infra.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,19 @@ def s3_endpoint_secret(
319319
yield secret
320320

321321
else:
322+
# Determine usehttps based on endpoint protocol
323+
usehttps = 0
324+
if aws_s3_endpoint.startswith("https://"):
325+
usehttps = 1
322326
with Secret(
323-
annotations={f"{ApiGroups.OPENDATAHUB_IO}/connection-type": "s3"},
327+
annotations={
328+
f"{ApiGroups.OPENDATAHUB_IO}/connection-type": "s3",
329+
"serving.kserve.io/s3-endpoint": (aws_s3_endpoint.replace("https://", "").replace("http://", "")),
330+
"serving.kserve.io/s3-region": aws_s3_region,
331+
"serving.kserve.io/s3-useanoncredential": "false",
332+
"serving.kserve.io/s3-verifyssl": "0",
333+
"serving.kserve.io/s3-usehttps": str(usehttps),
334+
},
324335
# the labels are needed to set the secret as data connection by odh-model-controller
325336
label={
326337
Labels.OpenDataHubIo.MANAGED: "true",

0 commit comments

Comments
 (0)