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

OCPBUGS-43041: fix slice init length #9072

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/asset/installconfig/aws/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func subnets(ctx context.Context, session *session.Session, region string, ids [
var vpcFromSubnet string
client := ec2.New(session, aws.NewConfig().WithRegion(region))

idPointers := make([]*string, len(ids))
idPointers := make([]*string, 0, len(ids))
for _, id := range ids {
idPointers = append(idPointers, aws.String(id))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/installconfig/gcp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (c *Client) GetRegions(ctx context.Context, project string) ([]string, erro
return nil, errors.Wrapf(err, "failed to get regions for project")
}

computeRegions := make([]string, len(gcpRegionsList.Items))
computeRegions := make([]string, 0, len(gcpRegionsList.Items))
for _, region := range gcpRegionsList.Items {
computeRegions = append(computeRegions, region.Name)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/destroy/aws/ec2helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ func deleteEC2VPCEndpointService(ctx context.Context, client *ec2.EC2, id string
logger.Warn("Unable to get the list of VPC endpoint connections connected to service: ", err)
logger.Warn("Attempting to delete the VPC Endpoint Service")
} else {
endpointList := make([]*string, len(output.VpcEndpointConnections))
endpointList := make([]*string, 0, len(output.VpcEndpointConnections))
for _, endpoint := range output.VpcEndpointConnections {
if aws.StringValue(endpoint.VpcEndpointState) != "rejected" {
endpointList = append(endpointList, endpoint.VpcEndpointId)
Expand Down