Hi, everyone. While using Secrets on Flytekit, I s...
# flytekit
m
Hi, everyone. While using Secrets on Flytekit, I stumbled upon a bug. When I use
flytectl.current_context().secrets.get()
with a Secret mounted as a file, the
get_secrets_file()
method here searches for it using
Copy code
return os.path.join(self._base_dir, group.lower(), f"{self._file_prefix}{key.lower()}")
The thing is, Kubernetes mounts secret files without changing the case of letters. Therefore, if I call
flytectl.current_context().secrets.get('mlflow-credentials', 'MLFLOW_TRACKING_URI')
, the Secrets Manager is unable to find this secret, even though its present on
/etc/flyte/secrets/mlflow-credentials/MLFLOW_TRACKING_URI
. I think this is a problem on the Kubernetes side, right? Because I just checked that secrets requested as environment variables are passed with all upper case, even though the key is lower case. I was even opening a PR on
flyteorg/flytekit
removing the
.upper()
and
.lower()
calls on the Secret Manager, but, again, I'm not sure if this is a problem on the SDK side or on the server side.
k
this is weird
cc @Haytham Abuelfutuh i dont know if we call this a bug in k8s or intended behavior
maybe, we should ignore case?
161 Views