github-vet / github-vet/rangeloop-pointer-findings

weaveworks/eksctl: pkg/actions/nodegroup/get.go; 31 LoC

Open
#12,915 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [weaveworks/eksctl](https://www.github.com/weaveworks/eksctl) at [pkg/actions/nodegroup/get.go](https://github.com/weaveworks/eksctl/blob/969cd5f09a02b13a9da859b423aae7f738931f6b/pkg/actions/nodegroup/get.go#L39-L69)

Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.

> reference to nodeGroupWithoutStack was used in a composite literal at line 42

[Click here to see the code in its original context.](https://github.com/weaveworks/eksctl/blob/969cd5f09a02b13a9da859b423aae7f738931f6b/pkg/actions/nodegroup/get.go#L39-L69)

Click here to show the 31 line(s) of Go which triggered the analyzer.

```go
for _, nodeGroupWithoutStack := range nodeGroupsWithoutStacks {
describeOutput, err := ng.ctl.Provider.EKS().DescribeNodegroup(&eks.DescribeNodegroupInput{
ClusterName: &ng.cfg.Metadata.Name,
NodegroupName: &nodeGroupWithoutStack,
})
if err != nil {
return nil, err
}

asgs := []string{}

if describeOutput.Nodegroup.Resources != nil {
for _, v := range describeOutput.Nodegroup.Resources.AutoScalingGroups {
asgs = append(asgs, aws.StringValue(v.Name))
}
}

summaries = append(summaries, &manager.NodeGroupSummary{
Name: *describeOutput.Nodegroup.NodegroupName,
Cluster: *describeOutput.Nodegroup.ClusterName,
Status: *describeOutput.Nodegroup.Status,
MaxSize: int(*describeOutput.Nodegroup.ScalingConfig.MaxSize),
MinSize: int(*describeOutput.Nodegroup.ScalingConfig.MinSize),
DesiredCapacity: int(*describeOutput.Nodegroup.ScalingConfig.DesiredSize),
InstanceType: *describeOutput.Nodegroup.InstanceTypes[0],
ImageID: *describeOutput.Nodegroup.AmiType,
CreationTime: describeOutput.Nodegroup.CreatedAt,
NodeInstanceRoleARN: *describeOutput.Nodegroup.NodeRole,
AutoScalingGroupName: strings.Join(asgs, ","),
})
}

```

Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.

commit ID: 969cd5f09a02b13a9da859b423aae7f738931f6b

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with pkg/actions/nodegroup/get.go at the referenced lines and review the surrounding nodegroup handling in commit 969cd5f09a02b13a9da859b423aae7f738931f6b. Determine whether the reference to nodeGroupWithoutStack in the composite literal is a bug, mitigated, or desirable behavior, then leave the corresponding reaction on the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.