Hi, I'm trying to attach storage to my flows (GitL...
# prefect-community
v
Hi, I'm trying to attach storage to my flows (GitLab with on-prem host). Prefect server (1.x) is hosted on an on-prem K8s cluster. I get the following error
Copy code
Failed to load and execute flow run: ValueError('Local Secret "<prefect.client.secrets.Secret object at 0x00000221D3B7B100>" was not found.')
when trying to use an OAuth token with the Secrets API. i.e. The config.toml is located on my local machine with and has a section:
Copy code
[context.secrets]
GITLAB="<OAuth Token>"
The code that registers the flow is similar to this:
Copy code
secret = Secret("GITLAB")
flow.storage = GitLab(host="path/to/host", repo="repo/address", path="flow/sample_flow.py", access_token_secret=secret)
flow.register(project_name="test-project-name")
I assume this is happening because the config.toml is not on the K8s cluster. If this is the case, is there a way I can attach this storage to the flow without storing OAuth tokens on the cluster itself?
k
I think the access token secret should be a name:
Copy code
flow.storage = GitLab(host="path/to/host", repo="repo/address", path="flow/sample_flow.py", access_token_secret="GITLAB")
flow.register(project_name="test-project-name")
and Prefect will fetch the value during runtime. Yes you need config.toml available to Kubernetes or you can check this for options
v
Thanks! That seemed to work but now it looks like my org hasn't setup SSL certs correctly. Is there a way to use set ssl_verify=False when initializing this storage? I tried including it as an additonal kwarg but that just throws a "got an unexpected keyword argument 'ssl_verify'" error
@Kevin Kho would you happen to know?