Skip to content

Commit a1ab9aa

Browse files
committed
remove unnecessary condition
1 parent fe8e826 commit a1ab9aa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fridge-job-api/app/minio_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def __init__(
2121
secure: bool = False,
2222
):
2323
retry_count = 0
24-
st = None # Default session token to None if not using STS
24+
st = None # Default session token to None if not using STS
25+
2526
# Try STS auth if access or secret key is not defined
2627
while (access_key == None or secret_key == None) and retry_count < 5:
2728
print("Attempting Minio authentication with STS")
@@ -40,7 +41,7 @@ def __init__(
4041
endpoint,
4142
access_key=access_key,
4243
secret_key=secret_key,
43-
session_token=st if st else None,
44+
session_token=st,
4445
secure=secure,
4546
)
4647
print("Successfully configured Minio client")
@@ -50,7 +51,9 @@ def handle_sts_auth(self, sts_endpoint, tenant):
5051
SA_TOKEN_FILE = os.getenv("MINIO_SA_TOKEN_PATH", "/minio/token")
5152

5253
# Kube CA cert path added by mounted service account, needed for TLS with Minio STS
53-
KUBE_CA_CRT = os.getenv("STS_CA_CERT_FILE", "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt")
54+
KUBE_CA_CRT = os.getenv(
55+
"STS_CA_CERT_FILE", "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
56+
)
5457

5558
# Read service account token
5659
sa_token = Path(SA_TOKEN_FILE).read_text().strip()

0 commit comments

Comments
 (0)