Vaikath Job
07/11/2022, 8:36 PMFailed 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:
[context.secrets]
GITLAB="<OAuth Token>"
The code that registers the flow is similar to this:
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?Kevin Kho
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 optionsVaikath Job
07/11/2022, 9:19 PM