Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get nodegroup (without specifying nodegroup name) returns error when no nodegroup exists instead of empty list #3177

Closed
PierreBeucher opened this issue Jan 29, 2021 · 4 comments · Fixed by #3178
Labels
kind/bug priority/important-soon Ideally to be resolved in time for the next release

Comments

@PierreBeucher
Copy link

What were you trying to accomplish?

We're trying to obtain a list of existing nodegroups as JSON or YAML, obtaining the nodegroup definition as list or an empty list like [] if none exists.

What happened?

Since 0.31.0 running eksctl get nodegroup --cluster my-cluster -o json without specifying nodegroup name (i.e. we want to list existing nodegroups) returns an error like:

# eksctl 0.31.0
$ eksctl get ng --cluster my-cluster -o json
Error: Nodegroup with name  not found

However using 0.30.0 we get null output

# eksctl 0.30.0
$ eksctl get ng --cluster my-cluster -o json
null

Further back with 0.9.0 we got an empty list

# eksctl 0.9.0
$ eksctl get ng --cluster my-cluster -o json
[]

How to reproduce it?

Create or use an EKS cluster without any nodegroup and run these steps for related versions:

# 0.9.0
curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/0.9.0/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp
echo Testing version:
/tmp/eksctl version
/tmp/eksctl get ng --cluster my-cluster -o json
echo "\n$?"
echo
echo "---"

# 0.10.0
curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/0.10.0/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp
echo Testing version
/tmp/eksctl version
/tmp/eksctl get ng --cluster my-cluster -o json
echo "\n$?"
echo
echo "---"

# 0.30.0
curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/0.30.0/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp
echo Testing version:
/tmp/eksctl version
/tmp/eksctl get ng --cluster my-cluster -o json
echo "\n$?"
echo
echo "---"

# 0.31.0
curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/0.31.0/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp
echo Testing version:
/tmp/eksctl version
/tmp/eksctl get ng --cluster my-cluster -o json
echo $?
echo
echo "---"

Gives output like:

Testing version:
[ℹ]  version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.9.0"}
[]
0
---
Testing version
[ℹ]  version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.10.0"}
null
0
---
Testing version:
0.30.0
null
0
---
Testing version:
0.31.0
Error: Nodegroup with name  not found
1

Anything else we need to know?

It would be nice to be able to list existing nodegroups and have an actual JSON or YAML empty list if no nodegroup exists. Currently behavior is not consistent and changes between versions, making it hard to automate eksctl in script or other systems.

@Callisto13
Copy link
Contributor

Thanks for reporting this @PierreBeucher, and thanks for the thorough repro 🚀

If you have a fix in mind, we are happy to accept PRs, otherwise the team will get to this asap.

@Callisto13 Callisto13 added the priority/important-soon Ideally to be resolved in time for the next release label Jan 29, 2021
@Callisto13
Copy link
Contributor

Looks like it went in with #2731

@Callisto13
Copy link
Contributor

The fix will be available in 0.38.0

@PierreBeucher
Copy link
Author

Great, thanks for your reactivity !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug priority/important-soon Ideally to be resolved in time for the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants