I have the following function, which is supposed to connect to an API (a forgejo/gitea instance), but the secret containing the auth token isn't resolved, it's just blank?
I've based this on the example in the cookbook. I've also tried injecting the secret like for docker builds, still the same issue.
Code: https://pastebin.com/kiyRjY67
How I test the function:
dagger call --verbose get-latest-version --url="https://gitea.example.com/" --owner="foobar" --name="hhkb_ansi_32u4_oscarcarlsson.hex" --token=file:./.token
The error message:
✘ QmkFirmware.getLatestVersion(
name: "hhkb_ansi_32u4_oscarcarlsson.hex"
owner: "keebs"
token: ✔ setSecret(name: ""): Secret! 0.0s
url: "https://gitea.spindeltax.net/"
): String! 4.8s
! call function "get_latest_version": process "/runtime" did not complete successfully: exit code: 1
┃ ╭─ Error ──────────────────────────────────────────────────────────────────────╮
┃ │ Function execution error: 'str' object has no attribute 'get' │
┃ ╰──────────────────────────────────────────────────────────────────────────────╯
✔ Container.from(address: "alpine:latest"): Container! 1.0s
✔ resolving docker.io/library/alpine:latest 1.0s
✔ Container.withExec(args: ["apk", "add", "curl"]): Container! 1.4s
✔ Container.withExec(args: ["sh", "-c", "curl \"$URL/api/v1/packages/$OWNER\" --header \"Authorization: token $GITEA_TOKEN\""], expand: true): Container! 1.6s
✔ Container.stdout: String! 1.7s
Full trace at https://dagger.cloud/foobar/etc
Error: response from query: input: qmkFirmware.getLatestVersion resolve: call function "get_latest_version": process "/runtime" did not complete successfully: exit code: 1
Stderr:
╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ Function execution error: 'str' object has no attribute 'get' │
╰──────────────────────────────────────────────────────────────────────────────╯
Any ideas?
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.