Error parsing the plugin name from processed template
ahmetb opened this issue · 5 comments
I'm getting an error like:
...
time="2022-08-29T21:16:48Z" level=info msg="downloaded file /tmp/768358419/1661807808"
time="2022-08-29T21:16:48Z" level=fatal msg="failed to get plugin name from processed template.
err: error converting YAML to JSON: yaml: line 19: did not find expected '-' indicator"
I'm using rajatjindal/krew-release-bot@v0.0.43
action.
My template looks like the following:
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: foreach
spec:
version: {{ .TagName }}
homepage: https://github.com/ahmetb/kubectl-foreach
shortDescription: Run kubectl commands against some/all contexts in parallel
description: |
Lets you run the same kubectl command against multiple contexts
simultaneously and prints their output, prefixed by context name.
You can choose or exclude contexts with exact name match or regular
expression patterns.
platforms:
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/ahmetb/kubectl-foreach/releases/download/{{ .TagName }}/kubectl-foreach_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
bin: kubectl-foreach
- selector:
matchLabels:
os: darwin
arch: arm64
{{addURIAndSha "https://github.com/ahmetb/kubectl-foreach/releases/download/{{ .TagName }}/kubectl-foreach_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
bin: kubectl-foreach
- selector:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/ahmetb/kubectl-foreach/releases/download/{{ .TagName }}/kubectl-foreach_{{ .TagName }}_linux_amd64.tar.gz" .TagName }}
bin: kubectl-foreach
- selector:
matchLabels:
os: linux
arch: arm64
{{addURIAndSha "https://github.com/ahmetb/kubectl-foreach/releases/download/{{ .TagName }}/kubectl-foreach_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
bin: kubectl-foreach
- selector:
matchLabels:
os: windows
arch: amd64
{{addURIAndSha "https://github.com/ahmetb/kubectl-foreach/releases/download/{{ .TagName }}/kubectl-foreach_{{ .TagName }}_windows_amd64.tar.gz" .TagName }}
bin: kubectl-foreach.exe
When I run the command locally, it still prints that same error as a fatal error.
But sometimes it prints the error before printing the YAML manifest, and sometimes after the YAML.
Makes me think there's a concurrency issue.
docker run -v $PWD/.krew.yaml:/tmp/template-file.yaml rajatjindal/krew-release-bot:v0.0.43 krew-release-bot template --tag v0.1.0 --template-file /tmp/template-file.yaml
Unable to find image 'rajatjindal/krew-release-bot:v0.0.43' locally
v0.0.43: Pulling from rajatjindal/krew-release-bot
df9b9388f04a: Pull complete
cb18aa924e39: Pull complete
004744c05d32: Pull complete
9b7f46ff092b: Pull complete
70c5b48dd309: Pull complete
Digest: sha256:754b72003753ef875fda36be42ad99f3046940b87f84fe6216dcd27b2e5284b2
Status: Downloaded newer image for rajatjindal/krew-release-bot:v0.0.43
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
time="2022-08-30T00:24:01Z" level=info msg="getting sha256 for https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_darwin_amd64.tar.gz"
time="2022-08-30T00:24:03Z" level=info msg="downloaded file /tmp/3254061850/1661819041"
time="2022-08-30T00:24:03Z" level=info msg="getting sha256 for https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_darwin_arm64.tar.gz"
time="2022-08-30T00:24:04Z" level=info msg="downloaded file /tmp/1370856538/1661819043"
time="2022-08-30T00:24:04Z" level=info msg="getting sha256 for https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_linux_amd64.tar.gz"
time="2022-08-30T00:24:04Z" level=info msg="downloaded file /tmp/4291279037/1661819044"
time="2022-08-30T00:24:04Z" level=info msg="getting sha256 for https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_linux_arm64.tar.gz"
time="2022-08-30T00:24:04Z" level=info msg="downloaded file /tmp/1664310480/1661819044"
time="2022-08-30T00:24:04Z" level=info msg="getting sha256 for https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_windows_amd64.tar.gz"
time="2022-08-30T00:24:06Z" level=info msg="downloaded file /tmp/456172339/1661819044"
time="2022-08-30T00:24:06Z" level=fatal msg="failed to get plugin name from processed template.\nerr: error converting YAML to JSON: yaml: line 19: did not find expected '-' indicator"
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: foreach
spec:
version: v0.1.0
homepage: https://github.com/ahmetb/kubectl-foreach
shortDescription: Run kubectl commands against some/all contexts in parallel
description: |
Lets you run the same kubectl command against multiple contexts
simultaneously and prints their output, prefixed by context name.
You can choose or exclude contexts with exact name match or regular
expression patterns.
platforms:
- selector:
matchLabels:
os: darwin
arch: amd64
uri: https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_darwin_amd64.tar.gz
sha256: a1c572f64dadfca7088421adad8b203f520fbe251ab08d61501d4629665bad86
bin: kubectl-foreach
- selector:
matchLabels:
os: darwin
arch: arm64
uri: https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_darwin_arm64.tar.gz
sha256: 6d2b1d715ba81d1a0c40a9f9e93288175f67e4d14252dec33df928a62459d27e
bin: kubectl-foreach
- selector:
matchLabels:
os: linux
arch: amd64
uri: https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_linux_amd64.tar.gz
sha256: ed93b7d02b59927f18fea23f9c0d07321adaf15af5afee52ec801846d0cf722e
bin: kubectl-foreach
- selector:
matchLabels:
os: linux
arch: arm64
uri: https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_linux_arm64.tar.gz
sha256: c1d67b5d02122fe8514b4f768c829f5d3986661083bec8cf0c242d7c03448e10
bin: kubectl-foreach
- selector:
matchLabels:
os: windows
arch: amd64
uri: https://github.com/ahmetb/kubectl-foreach/releases/download/v0.1.0/kubectl-foreach_v0.1.0_windows_amd64.tar.gz
sha256: 2384493f126f10cf3fa07fc252058155d64b975fcc100c20ca16caa0e1898ead
bin: kubectl-foreach.exe
this is due to indentation of yaml lines. i have submitted PR with the fix to kubectl-foreach
repo
Interesting, because I copied the template as is with the same indentation from kubectl-tree repo. But that uses a much older version of the action.
Hey Ahmet
I just looked into kubectl tree and it seems like it has the right indentation.
Is it possible that maybe the code editor changed it on save?
Yeah, it turns out everything got indented, I blame IntelliJ IDEA. Thanks for looking into this.