Skip to content

CLI fails if a cluster is still creating in AWS  #858

@mateimicu

Description

@mateimicu

Describe the bug
When a cluster is still creating in AWS, there is a panic if you run the CLI.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102bbc4dc]

goroutine 60 [running]:
github.com/mateimicu/kdiscover/internal/aws.(*EKSClient).detailCluster(0x14000122ac0, {0x1400016c030, 0x12})
        /.../kdiscover/internal/aws/eks.go:95 +0x38c
github.com/mateimicu/kdiscover/internal/aws.(*EKSClient).GetClusters.func1(0x14000702180, 0x1)
        /.../kdiscover/internal/aws/eks.go:44 +0x3b0
github.com/aws/aws-sdk-go/service/eks.(*EKS).ListClustersPagesWithContext(0x1400011e238, {0x1031a80a8?, 0x1400003c0f8}, 0x140003d3b00, 0x140003a03a8, {0x0, 0x0, 0x0})
        /Users/matei/go/pkg/mod/github.com/aws/aws-sdk-go@v1.44.224/service/eks/api.go:2430 +0x178
github.com/aws/aws-sdk-go/service/eks.(*EKS).ListClustersPages(0x0?, 0x0?, 0x0?)
        /Users/matei/go/pkg/mod/github.com/aws/aws-sdk-go@v1.44.224/service/eks/api.go:2404 +0x48
github.com/mateimicu/kdiscover/internal/aws.(*EKSClient).GetClusters(0x14000122ac0, 0x1400008c6c0)
        /.../kdiscover/internal/aws/eks.go:33 +0xac
created by github.com/mateimicu/kdiscover/internal/aws.getEKSClusters
        /.../kdiscover/internal/aws/eks_cluster.go:73 +0x128

I think this is because some Cluster information is not present but we assume it is.

Environment:

  • OS: macOS
  • Shell zsh
    Output of kdiscover version
    {"Version":"0.1.5","Commit":"933c61215acc55d4b90535541541a960f2943408","Date":"2022-07-18T23:32:14Z"}

To Reproduce
Steps to reproduce the behavior:

  1. Go to run kdiscover aws list

Expected behavior
The list found clusters.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

Status

To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions