rajatjindal / krew-release-bot

bot to bump version of plugin in krew-index on new releases
Apache License 2.0
47 stars 17 forks source link

failed to get plugin name from processed template.\nerr: error converting YAML to JSON: yaml: line 12: did not find expected '-' indicator #49

Closed dhiller closed 3 years ago

dhiller commented 3 years ago

First of all: thanks for this effort, will save all the krew plugin packaging people a lot of time!

I've been integrating the release bot for the release automation of the kubectl-virt-plugin, where I stumbled over this error here: https://github.com/kubevirt/kubectl-virt-plugin/runs/1571142549?check_suite_focus=true#step:4:11

Unfortunately there's no output of the actual krew manifest generated, so I can't really see what's going on. So I'm turning to you in the hopes that you might see what I did configure wrong in the plugin manifest template.

dhiller commented 3 years ago

I built the binary locally and used the template command like this:

$ ./krew-release-bot template --tag v0.36.0 --template-file $GH/kubevirt.io/kubectl-virt-plugin/.krew.yaml
INFO[0000] getting sha256 for https://github.com/kubevirt/kubectl-virt-plugin/releases/download/v0.36.0/virtctl-darwin-amd64.tar.gz                                                                                                                                              
INFO[0003] downloaded file /tmp/130730406/1608222854                                                                                                                                                                                                                             
INFO[0003] getting sha256 for https://github.com/kubevirt/kubectl-virt-plugin/releases/download/v0.36.0/virtctl-linux-amd64.tar.gz                                                                                                                                               
INFO[0005] downloaded file /tmp/733434061/1608222857                                                                                                                                                                                                                             
INFO[0005] getting sha256 for https://github.com/kubevirt/kubectl-virt-plugin/releases/download/v0.36.0/virtctl-windows-amd64.exe.tar.gz                                                                                                                                         
INFO[0007] downloaded file /tmp/494706632/1608222859                                                                                                                                                                                                                             
apiVersion: krew.googlecontainertools.github.com/v1alpha2                                                                                                                                                                                                                        
kind: Plugin                                                                                                                                                                                                                                                                     
metadata:                                                                                                                                                                                                                                                                        
  name: virt                                                                                                                                                                                                                                                                     
spec:                                                                                                                                                                                                                                                                            
  version: "v0.36.0"                                                                                                                                                                                                                                                             
  platforms:                                                                                                                                                                                                                                                                     
    - selector:                                                                                                                                                                                                                                                                  

        matchLabels:                                                                                                                                                                                                                                                      [0/121]
          os: darwin                                                                                                                    
          arch: amd64                                                                                                                                                                                                                                                            
      uri: https://github.com/kubevirt/kubectl-virt-plugin/releases/download/v0.36.0/virtctl-darwin-amd64.tar.gz                        
    sha256: 50b44aac0560acde5503c57a6d2727ad586c2d659f0702ee5e7a0b591a76b8ae                                                            
      files:                                                                                                                            
        - from: "/virtctl/virtctl-darwin-amd64"           
          to: "virtctl"                                                                                                                                                                                                                                                          
        - from: virtctl/LICENSE                                                                                                         
          to: .                                                                                                                                                                                                                                                                  
      bin: "virtctl"                                                                                                                                                                                                                                                             
    - selector:                                                                                                                         
        matchLabels:                                                
          os: linux
          arch: amd64       
      uri: https://github.com/kubevirt/kubectl-virt-plugin/releases/download/v0.36.0/virtctl-linux-amd64.tar.gz                         
    sha256: 4e5f1de86635d67ca3f4d946802282b0c2238a4193c1b8415d9aaf068cd9a8a0                                                            
      files:                                                                                                                            
        - from: "/virtctl/virtctl-linux-amd64"
          to: "virtctl"                                                                                                                 
        - from: virtctl/LICENSE                                     
          to: .
      bin: "virtctl"                    
    - selector:                                                     
        matchLabels:                                                                                                                    
          os: windows                                                                                                                                                                                                                                                            
          arch: amd64                                 
      uri: https://github.com/kubevirt/kubectl-virt-plugin/releases/download/v0.36.0/virtctl-windows-amd64.exe.tar.gz                   
    sha256: 76a0451249faf157b96f3178e655af63113f307e3d4327169636c0d60f8956eb                                                            
      files:                                                        
        - from: "/virtctl/virtctl-windows-amd64.exe"
          to: "virtctl.exe"                          
        - from: virtctl/LICENSE                 
          to: .                                              
      bin: "virtctl.exe"                                                                                                                
  shortDescription: Control KubeVirt virtual machines using virtctl 
  homepage: https://kubevirt.io                
  caveats: |                                                                                                                                                                                                                                                                     
    virt plugin is a wrapper for virtctl originating from the KubeVirt project. In order to use virtctl you will                        
    need to have KubeVirt installed on your Kubernetes cluster to use it. See https://kubevirt.io/ for details                          

    See                                                             

      https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/graphical-and-console-access.html                               

    for a usage example                                      
  description: |                                                                                                                        
    virt plugin is a wrapper for virtctl originating from the KubeVirt project. KubeVirt is a virtualization add-on to                  
    Kubernetes, i.e. it enables to run existing virtual machines on Kubernetes clusters. virtctl controls virtual                       
    machine related operations on your Kubernetes cluster like connecting to the serial and VNC consoles.                                                                                                                                                                        

    Kubevirt documentation:
      Installation:
        https://kubevirt.io/user-guide/docs/latest/administration/intro.html
      User Guide:
        https://kubevirt.io/user-guide/docs/latest/welcome/index.html
      Minikube Quickstart:
        https://kubevirt.io/quickstart_minikube/
      Virtctl usage examples:
        https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/graphical-and-console-access.html
        https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/expose-service.html
        https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/virtual-machine-replica-set.html

FATA[0007] failed to get plugin name from processed template.
err: error converting YAML to JSON: yaml: line 12: did not find expected '-' indicator 

So this clearly shows that there's something wrong with the formatting. Will keep looking...

dhiller commented 3 years ago

OK, so I found out that this was just a formatting issue in the template. Sorry for the noise.

/close

rajatjindal commented 3 years ago

thanks for using it and sorry that you ran into the issue while using this. its for sure is not noise, and i have seen some users having trouble with generating initial template.

for helping with that, i had implemented a tool at: https://rajatjindal.com/tools/krew-release-bot-helper/

i have now added that as an issue template to help users incase they run into this issue. (its part of readme as well, but easy to miss).

thanks again for taking out time to report the issue