Skip to content

Imager updater is nil reference when --disable-kubernetes #1274

@naonao2323

Description

@naonao2323

Describe the bug
Running the test command causes a panic (invalid memory address or nil pointer dereference) when --disable-kubernetes is used.
To Reproduce
after build, run below commnad
./dist/argocd-image-updater test gcr.io/google-containers/busybox --update-strategy newest-build --loglevel debug --platforms linux/amd64 --disable-kubernetes

commnad result

panic: runtime error: invalid memory address or nil pointer dereference                                                                                                                                                                                                                            goroutine 1 [running]:                                                                                                                                                                                                                                                        
main.newTestCommand.func1(})                                                                                                                                                                                                 
argocd-image-updater/cmd/test.go:121                                                                                                                                                                                        
github.com/spf13/cobra.(*Command).execute()                                                                                                                                                                                          
github.com/spf13/[email protected]/command.go:1019                                                                                                                                                                                
github.com/spf13/cobra.(*Command).ExecuteC()                                                                                                                                                                                                                     
github.com/spf13/[email protected]/command.go:1148                                                                                                                                                                                  
github.com/spf13/cobra.(*Command).Execute(...)                                                                                                                                                                                                                                
github.com/spf13/[email protected]/command.go:1071                                                                                                                                                                                              
main.newRootCommand()                                                                                                                                                                                                                                                         
argocd-image-updater/cmd/main.go:69                                                                                                                                                                                                 
argocd-image-updater/cmd/main.go:86

Expected behavior

Additional context
Add any other context about the problem here.

Version
Please tell us about the version you encountered the issue with
v0.17
Logs
Please paste any relevant logs here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions