Conversation
Replace github.com/aws/aws-sdk-go (v1) with github.com/aws/aws-sdk-go-v2 across all production and test code. Key changes include: - Client interface: add context.Context to all methods, use concrete v2 service clients instead of v1 interfaces - Session management: replace aws/session with aws-sdk-go-v2/config - Types: use value types from service/*/types packages instead of pointer types (e.g., ec2types.Instance, []ec2types.Tag) - Pointer helpers: aws.StringValue -> aws.ToString, aws.Int64 -> aws.Int32 - Error handling: awserr.Error -> smithy.APIError - IMDS: ec2metadata -> feature/ec2/imds with IMDSv2 support - Credentials: static credentials use v2 provider - Custom endpoints: per-service BaseEndpoint instead of global resolver - Remove v1 SDK from go.mod and vendor
|
/hold |
WalkthroughComprehensive migration of AWS SDK for Go from v1 to v2 across the codebase. Updates go.mod dependencies, refactors all AWS client method signatures to accept context parameters, replaces v1 types with v2 equivalents, and adjusts error handling to use smithy-based error types throughout machine actuators, machineset logic, and termination handlers. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/client/client.go (1)
518-552:⚠️ Potential issue | 🟠 MajorMerge the custom CA bundle with the system trust store and preserve DefaultTransport behavior.
The current approach creates an empty cert pool containing only the custom CA bundle, losing access to system root CAs. This breaks connectivity to public AWS APIs in typical corporate environments where custom bundles contain only internal CAs. Additionally, creating a bare
http.Transportdiscards connection pooling and other defaults. Usex509.SystemCertPool()to preserve system trust, append the custom CA, and clonehttp.DefaultTransportto maintain proper transport behavior:Suggested fix
- certPool := x509.NewCertPool() - if !certPool.AppendCertsFromPEM([]byte(caBundle)) { + certPool, err := x509.SystemCertPool() + if err != nil || certPool == nil { + certPool = x509.NewCertPool() + } + if !certPool.AppendCertsFromPEM([]byte(caBundle)) { return nil, fmt.Errorf("failed to parse custom CA bundle") } - return &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: &tls.Config{ - RootCAs: certPool, - MinVersion: tls.VersionTLS12, - }, - }, - }, nil + transport := http.DefaultTransport.(*http.Transport).Clone() + if transport.TLSClientConfig == nil { + transport.TLSClientConfig = &tls.Config{} + } + transport.TLSClientConfig.RootCAs = certPool + transport.TLSClientConfig.MinVersion = tls.VersionTLS12 + + return &http.Client{Transport: transport}, nil🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/client/client.go` around lines 518 - 552, In buildHTTPClient, don't create an empty cert pool or a bare http.Transport; instead call x509.SystemCertPool() to obtain the system roots (handle nil/err), append the custom CA PEM to that pool (the certPool used for TLSClientConfig), and use a clone of http.DefaultTransport (type assert to *http.Transport and Clone()) to preserve connection pooling and defaults before setting TLSClientConfig.RootCAs to the merged certPool and MinVersion to tls.VersionTLS12; update the returned *http.Client to use that cloned transport.
🧹 Nitpick comments (5)
pkg/actuators/machineset/ec2_instance_types.go (1)
142-142: Consider propagating context through the call chain.Using
context.TODO()here prevents proper timeout handling, cancellation, and distributed tracing. The recommended approach is to acceptcontext.Contextas a parameter infetchEC2InstanceTypes,refresh, andGetInstanceType, then propagate from the caller.This is acceptable for an initial SDK migration but should be addressed in a follow-up to enable proper request lifecycle management.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/actuators/machineset/ec2_instance_types.go` at line 142, The call to awsClient.DescribeInstanceTypes uses context.TODO(), preventing cancellation/timeouts and tracing; change fetchEC2InstanceTypes, refresh, and GetInstanceType to accept a context.Context parameter and pass that ctx through to awsClient.DescribeInstanceTypes (and any other AWS SDK calls) instead of using context.TODO(); update all call sites to propagate the caller's ctx so cancellation and deadlines flow through the call chain (functions to edit: fetchEC2InstanceTypes, refresh, GetInstanceType).pkg/actuators/machine/machine_scope_test.go (2)
383-385: Consider keeping a nilvpcIDtest case for behavioral coverage.This call now only exercises the non-nil path. If
getCustomDomainFromDHCPis intended to tolerate nil input, add a dedicated nil-input case to prevent regressions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/actuators/machine/machine_scope_test.go` around lines 383 - 385, Add a dedicated test case that passes a nil *string VPC ID to mS.getCustomDomainFromDHCP to exercise the nil-input path: create vpcID := (*string)(nil), call got, err := mS.getCustomDomainFromDHCP(vpcID) and assert the function does not panic, returns the expected zero-value domain (e.g., "" or whatever the package contract defines) and an appropriate error state (preferably nil if it should tolerate nil); name the case clearly (e.g., "nil vpcID") so future changes won’t remove this behavioral coverage.
371-381: Tighten gomock request matching to avoid false positives.Using
gomock.Any()for both args means the test won't catch if the production code's EC2 input payloads become malformed (for example, missing/incorrect DHCP options IDs). Consider asserting the request content in at least one expectation using a pattern likeDoAndReturnto validate required fields are present.Example hardening pattern
- mockAWSClient.EXPECT().DescribeDHCPOptions(gomock.Any(), gomock.Any()).Return(tc.describeDhcpOptionsOutput, nil).AnyTimes() + mockAWSClient.EXPECT(). + DescribeDHCPOptions(gomock.Any(), gomock.AssignableToTypeOf(&ec2.DescribeDhcpOptionsInput{})). + DoAndReturn(func(_ context.Context, in *ec2.DescribeDhcpOptionsInput) (*ec2.DescribeDhcpOptionsOutput, error) { + if len(in.DhcpOptionsIds) == 0 { + t.Fatalf("expected at least one DHCP options ID") + } + return tc.describeDhcpOptionsOutput, nil + }). + AnyTimes()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/actuators/machine/machine_scope_test.go` around lines 371 - 381, Tighten the gomock expectations so the test validates request payloads instead of using gomock.Any() for both args: update the mockAWSClient.Expect().DescribeVpcs(...) and/or mockAWSClient.EXPECT().DescribeDHCPOptions(...) to use DoAndReturn (or a custom gomock.Matcher) that inspects the input context/EC2 request and asserts the presence/format of the DHCP options ID (e.g., that the DescribeVpcs input contains the expected DhcpOptionsId or that DescribeDHCPOptions call receives the correct DHCPOptionsIds slice) before returning tc.describeDhcpOptionsOutput, leaving machineScope and mockAWSClient references intact.pkg/actuators/machine/machine_scope.go (1)
204-227: Consider using the embedded context instead ofcontext.TODO().The
machineScopestruct embedscontext.Context(see line 43), butcontext.TODO()is used for the AWS API calls on lines 209 and 221. Consider usings.Contextfor consistency and proper context propagation.♻️ Suggested improvement
- vpc, err := s.awsClient.DescribeVpcs(context.TODO(), &ec2.DescribeVpcsInput{ + vpc, err := s.awsClient.DescribeVpcs(s.Context, &ec2.DescribeVpcsInput{ VpcIds: []string{*vpcID}, })- dhcp, err := s.awsClient.DescribeDHCPOptions(context.TODO(), &ec2.DescribeDhcpOptionsInput{ + dhcp, err := s.awsClient.DescribeDHCPOptions(s.Context, &ec2.DescribeDhcpOptionsInput{ DhcpOptionsIds: []string{aws.ToString(vpc.Vpcs[0].DhcpOptionsId)}, })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/actuators/machine/machine_scope.go` around lines 204 - 227, In getCustomDomainFromDHCP, replace the calls using context.TODO() with the embedded context on the scope (s.Context) so the AWS API calls inherit the request/operation context; update both DescribeVpcs and DescribeDHCPOptions invocations to use s.Context instead of context.TODO() to ensure proper context propagation from the machineScope.pkg/termination/handler.go (1)
119-131: LGTM! Error handling correctly uses smithy types for v2.The 404 detection via
smithyhttp.ResponseErroris the correct pattern for AWS SDK v2.One minor note: Line 128
fmt.Errorf("%w", err)is redundant since it only wraps the error without adding context. You could simplify toreturn false, err.♻️ Optional simplification
if err != nil { var re *smithyhttp.ResponseError if errors.As(err, &re) && re.HTTPStatusCode() == http.StatusNotFound { logger.V(2).Info("Instance not marked for termination") return false, nil } - return false, fmt.Errorf("%w", err) + return false, err }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/termination/handler.go` around lines 119 - 131, The error return currently wraps the AWS SDK error redundantly using fmt.Errorf("%w", err); in the GetMetadata error branch inside the imdsClient.GetMetadata call replace that wrapping with a direct return of the original error (i.e., return false, err) so the function preserves the original error value instead of rewrapping it; keep the existing smithyhttp.ResponseError 404 detection and the logger.V(2).Info branch intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pkg/actuators/machine/dedicatedhosts.go`:
- Around line 44-45: The AllocateHosts/ReleaseHosts calls use context.TODO()
which prevents cancellation propagation; update the surrounding helper functions
in dedicatedhosts.go to accept a context.Context parameter (e.g., add ctx to the
function signature that calls client.AllocateHosts and client.ReleaseHosts) and
replace context.TODO() with the passed ctx when invoking
client.AllocateHosts(ctx, allocateInput) and client.ReleaseHosts(ctx,
releaseInput). Ensure all call sites of those helpers are updated to forward the
upstream ctx so parent cancellations/timeouts propagate correctly.
In `@pkg/actuators/machine/instances_test.go`:
- Line 1191: The test currently stubs DescribeAvailabilityZones to always return
nil error; update the mock expectation in the table-driven test so
DescribeAvailabilityZones returns tc.zonesOutput, tc.azErr (i.e., wire tc.azErr
into mockAWSClient.EXPECT().DescribeAvailabilityZones(...).Return(...)) so the
`"Subnet with availability zone with error"` case can exercise the AWS error
path; locate the call to
mockAWSClient.EXPECT().DescribeAvailabilityZones(gomock.Any(),
gomock.Any()).Return(tc.zonesOutput, nil).AnyTimes() and change the returned
error to tc.azErr.
In `@pkg/actuators/machine/instances.go`:
- Around line 78-90: The helper functions (getSecurityGroupsIDs, getSubnetIDs,
getAMI, getBlockDeviceMappings, getAvalabilityZoneFromSubnetID,
getAvalabilityZoneTypeFromZoneName) and their caller launchInstance are using
context.TODO() for AWS SDK calls; change their signatures to accept a
context.Context parameter and thread the reconciler's context (from machineScope
or the caller) through to each helper and ultimately into
client.DescribeSecurityGroups / DescribeSubnets / DescribeImages /
DescribeAvailabilityZones / DescribeInstances calls so the v2 AWS client
receives the real cancelled/deadline-aware context instead of context.TODO();
update all call sites (including launchInstance callers) to pass the incoming
ctx along.
In `@pkg/actuators/machine/loadbalancers.go`:
- Around line 53-65: The switch on targetGroup.TargetType only sets target.Id
for Instance and Ip and can leave target.Id nil, so add a default case in the
switch (checking targetGroup.TargetType) that logs/returns/skips for unsupported
target types instead of leaving target uninitialized; then before any
dereference of target.Id (or before using it in registration/logging) add a nil
guard like if target.Id == nil { klog.Errorf("unsupported or missing target id
for target group %v", aws.ToString(targetGroup.TargetGroupArn));
continue/return/error } and use aws.ToString(target.Id) (or otherwise safely
handle the nil) when logging/using the ID; update the switch block that handles
elbv2types.TargetTypeEnumInstance and elbv2types.TargetTypeEnumIp and the
subsequent registration/logging code to include these guards.
- Line 31: The functions that call AWS ELB/ELBv2 APIs (e.g.,
RegisterInstancesWithLoadBalancer invocation and
registerWithNetworkLoadBalancers, plus the deregister counterparts) should
accept a caller context parameter (ctx) and pass that ctx into all SDK calls
instead of using context.TODO(); update the signatures where needed and replace
context.TODO() with ctx for calls like client.RegisterInstancesWithLoadBalancer
and client.RegisterTargets/RegisterTargetGroup/etc. In
registerWithNetworkLoadBalancers and similar helpers, avoid dereferencing
target.Id unconditionally: only read target.Id for target.Type == "instance" or
"ip" (and set the InstanceId/TargetId appropriately), and for "lambda" or "alb"
target types either leave the field nil or handle them according to AWS contract
(do not call aws.StringValue on a nil pointer); add a nil-check (e.g., if
target.Id != nil) or a switch on target.Type to safely build the target
description to prevent the panic. Ensure the same ctx propagation and
target-type-safe handling is applied to the other referenced call sites (lines
noted) for both register and deregister flows.
In `@pkg/actuators/machine/utils.go`:
- Line 117: The EC2 calls use context.TODO() which discards
cancellation/deadline propagation; update the helper functions that call
client.DescribeInstances (and similar EC2 client calls at the noted locations)
to accept a context.Context parameter (or accept the machine scope so you can
read machineScope.Context) and replace context.TODO() with that context (use
machineScope.Context where these helpers are invoked). Locate all occurrences of
client.DescribeInstances(...) and other EC2 calls in this file and thread the
caller context through the function signatures and call sites so cancellation
and deadlines from machineScope.Context are honored.
In `@pkg/client/client.go`:
- Around line 262-263: GetCachedDescribeRegions is building an EC2 client from
only aws.Config, so it ignores the service-specific ec2OptFns (resolved in
newAWSConfig) and thus validates regions against the default endpoint; update
the cache API and callers to accept and forward the EC2 service option funcs
(ec2OptFns) or apply those funcs when constructing the validation EC2 client
inside GetCachedDescribeRegions so the DescribeRegions call uses the configured
BaseEndpoint; search for newAWSConfig, ec2OptFns, and GetCachedDescribeRegions
(and the other affected cached methods referenced around lines 275-297, 333-345,
397-401) and ensure each callsite passes the ec2 option functions through to the
cache and that the cache uses them when creating the ec2.NewFromConfig client.
---
Outside diff comments:
In `@pkg/client/client.go`:
- Around line 518-552: In buildHTTPClient, don't create an empty cert pool or a
bare http.Transport; instead call x509.SystemCertPool() to obtain the system
roots (handle nil/err), append the custom CA PEM to that pool (the certPool used
for TLSClientConfig), and use a clone of http.DefaultTransport (type assert to
*http.Transport and Clone()) to preserve connection pooling and defaults before
setting TLSClientConfig.RootCAs to the merged certPool and MinVersion to
tls.VersionTLS12; update the returned *http.Client to use that cloned transport.
---
Nitpick comments:
In `@pkg/actuators/machine/machine_scope_test.go`:
- Around line 383-385: Add a dedicated test case that passes a nil *string VPC
ID to mS.getCustomDomainFromDHCP to exercise the nil-input path: create vpcID :=
(*string)(nil), call got, err := mS.getCustomDomainFromDHCP(vpcID) and assert
the function does not panic, returns the expected zero-value domain (e.g., "" or
whatever the package contract defines) and an appropriate error state
(preferably nil if it should tolerate nil); name the case clearly (e.g., "nil
vpcID") so future changes won’t remove this behavioral coverage.
- Around line 371-381: Tighten the gomock expectations so the test validates
request payloads instead of using gomock.Any() for both args: update the
mockAWSClient.Expect().DescribeVpcs(...) and/or
mockAWSClient.EXPECT().DescribeDHCPOptions(...) to use DoAndReturn (or a custom
gomock.Matcher) that inspects the input context/EC2 request and asserts the
presence/format of the DHCP options ID (e.g., that the DescribeVpcs input
contains the expected DhcpOptionsId or that DescribeDHCPOptions call receives
the correct DHCPOptionsIds slice) before returning tc.describeDhcpOptionsOutput,
leaving machineScope and mockAWSClient references intact.
In `@pkg/actuators/machine/machine_scope.go`:
- Around line 204-227: In getCustomDomainFromDHCP, replace the calls using
context.TODO() with the embedded context on the scope (s.Context) so the AWS API
calls inherit the request/operation context; update both DescribeVpcs and
DescribeDHCPOptions invocations to use s.Context instead of context.TODO() to
ensure proper context propagation from the machineScope.
In `@pkg/actuators/machineset/ec2_instance_types.go`:
- Line 142: The call to awsClient.DescribeInstanceTypes uses context.TODO(),
preventing cancellation/timeouts and tracing; change fetchEC2InstanceTypes,
refresh, and GetInstanceType to accept a context.Context parameter and pass that
ctx through to awsClient.DescribeInstanceTypes (and any other AWS SDK calls)
instead of using context.TODO(); update all call sites to propagate the caller's
ctx so cancellation and deadlines flow through the call chain (functions to
edit: fetchEC2InstanceTypes, refresh, GetInstanceType).
In `@pkg/termination/handler.go`:
- Around line 119-131: The error return currently wraps the AWS SDK error
redundantly using fmt.Errorf("%w", err); in the GetMetadata error branch inside
the imdsClient.GetMetadata call replace that wrapping with a direct return of
the original error (i.e., return false, err) so the function preserves the
original error value instead of rewrapping it; keep the existing
smithyhttp.ResponseError 404 detection and the logger.V(2).Info branch intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 066942d3-68cd-4a5e-9b04-3507ee750da1
⛔ Files ignored due to path filters (275)
go.sumis excluded by!**/*.sumvendor/github.com/aws/aws-sdk-go-v2/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/checksum.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/context.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/errors.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/logging.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/ec2query/error_utils.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/request.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/types.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/version.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/auth_scheme_preference.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/env_config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/generate.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/load_options.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/local.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/resolve.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/dpop.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/file.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.jsonis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSEis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptAddressTransfer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptCapacityReservationBillingOwnership.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptReservedInstancesExchangeQuote.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayMulticastDomainAssociations.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayPeeringAttachment.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayVpcAttachment.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcEndpointConnections.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcPeeringConnection.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AdvertiseByoipCidr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateHosts.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateIpamPoolCidr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ApplySecurityGroupsToClientVpnTargetNetwork.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignIpv6Addresses.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateIpAddresses.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateNatGatewayAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateCapacityReservationBillingOwner.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateClientVpnTargetNetwork.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateDhcpOptions.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateEnclaveCertificateIamRole.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIamInstanceProfile.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateInstanceEventWindow.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamByoasn.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamResourceDiscovery.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateNatGatewayAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteServer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteTable.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSecurityGroupVpc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSubnetCidrBlock.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayMulticastDomain.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayPolicyTable.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayRouteTable.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTrunkInterface.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateVpcCidrBlock.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachClassicLinkVpc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachInternetGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachNetworkInterface.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVerifiedAccessTrustProvider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVolume.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVpnGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeClientVpnIngress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupEgress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupIngress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_BundleInstance.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelBundleTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservation.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservationFleets.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelConversionTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelDeclarativePoliciesReport.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelExportTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImageLaunchPermission.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImportTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelReservedInstancesListing.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotFleetRequests.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotInstanceRequests.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ConfirmProductInstance.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyFpgaImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopySnapshot.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyVolumes.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityManagerDataExport.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservation.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationBySplitting.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationFleet.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCarrierGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnEndpoint.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnRoute.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipCidr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipPool.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCustomerGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultSubnet.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultVpc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDelegateMacVolumeOwnershipTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDhcpOptions.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateEgressOnlyInternetGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFleet.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFlowLogs.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFpgaImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImageUsageReport.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceConnectEndpoint.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceEventWindow.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceExportTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInternetGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInterruptibleCapacityReservationAllocation.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpam.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamExternalResourceVerificationToken.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamPolicy.gois excluded by!**/vendor/**,!vendor/**
📒 Files selected for processing (25)
go.modpkg/actuators/machine/actuator_test.gopkg/actuators/machine/controller_test.gopkg/actuators/machine/dedicatedhosts.gopkg/actuators/machine/dedicatedhosts_test.gopkg/actuators/machine/filter.gopkg/actuators/machine/instances.gopkg/actuators/machine/instances_test.gopkg/actuators/machine/loadbalancers.gopkg/actuators/machine/loadbalancers_test.gopkg/actuators/machine/machine_scope.gopkg/actuators/machine/machine_scope_test.gopkg/actuators/machine/reconciler.gopkg/actuators/machine/reconciler_test.gopkg/actuators/machine/stubs.gopkg/actuators/machine/utils.gopkg/actuators/machine/utils_test.gopkg/actuators/machineset/controller_test.gopkg/actuators/machineset/ec2_instance_types.gopkg/client/client.gopkg/client/client_test.gopkg/client/fake/fake.gopkg/client/mock/client_generated.gopkg/termination/handler.gopkg/termination/handler_test.go
| output, err := client.AllocateHosts(context.TODO(), allocateInput) | ||
| if err != nil { |
There was a problem hiding this comment.
Pass the caller context into dedicated-host lifecycle calls.
Both host allocation and release now use the v2 client interface, but context.TODO() makes them uncancelable once the parent operation is canceled or times out. Please thread ctx through these helpers instead.
Also applies to: 67-67
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/actuators/machine/dedicatedhosts.go` around lines 44 - 45, The
AllocateHosts/ReleaseHosts calls use context.TODO() which prevents cancellation
propagation; update the surrounding helper functions in dedicatedhosts.go to
accept a context.Context parameter (e.g., add ctx to the function signature that
calls client.AllocateHosts and client.ReleaseHosts) and replace context.TODO()
with the passed ctx when invoking client.AllocateHosts(ctx, allocateInput) and
client.ReleaseHosts(ctx, releaseInput). Ensure all call sites of those helpers
are updated to forward the upstream ctx so parent cancellations/timeouts
propagate correctly.
| mockAWSClient.EXPECT().DescribeImages(gomock.Any()).Return(tc.imageOutput, tc.imageErr).AnyTimes() | ||
| mockAWSClient.EXPECT().RunInstances(tc.runInstancesInput).Return(tc.instancesOutput, tc.instancesErr).AnyTimes() | ||
| mockAWSClient.EXPECT().DescribeSecurityGroups(gomock.Any(), gomock.Any()).Return(tc.securityGroupOutput, tc.securityGroupErr).AnyTimes() | ||
| mockAWSClient.EXPECT().DescribeAvailabilityZones(gomock.Any(), gomock.Any()).Return(tc.zonesOutput, nil).AnyTimes() |
There was a problem hiding this comment.
Wire tc.azErr into the DescribeAvailabilityZones mock.
The "Subnet with availability zone with error" case currently never exercises the AWS error path because this expectation always returns nil for the error.
🧪 Suggested fix
- mockAWSClient.EXPECT().DescribeAvailabilityZones(gomock.Any(), gomock.Any()).Return(tc.zonesOutput, nil).AnyTimes()
+ mockAWSClient.EXPECT().DescribeAvailabilityZones(gomock.Any(), gomock.Any()).Return(tc.zonesOutput, tc.azErr).AnyTimes()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/actuators/machine/instances_test.go` at line 1191, The test currently
stubs DescribeAvailabilityZones to always return nil error; update the mock
expectation in the table-driven test so DescribeAvailabilityZones returns
tc.zonesOutput, tc.azErr (i.e., wire tc.azErr into
mockAWSClient.EXPECT().DescribeAvailabilityZones(...).Return(...)) so the
`"Subnet with availability zone with error"` case can exercise the AWS error
path; locate the call to
mockAWSClient.EXPECT().DescribeAvailabilityZones(gomock.Any(),
gomock.Any()).Return(tc.zonesOutput, nil).AnyTimes() and change the returned
error to tc.azErr.
| func getSecurityGroupsIDs(securityGroups []machinev1beta1.AWSResourceReference, client awsclient.Client) ([]string, error) { | ||
| var securityGroupIDs []string | ||
| for _, g := range securityGroups { | ||
| // ID has priority | ||
| if g.ID != nil { | ||
| securityGroupIDs = append(securityGroupIDs, g.ID) | ||
| securityGroupIDs = append(securityGroupIDs, *g.ID) | ||
| } else if g.Filters != nil { | ||
| klog.Info("Describing security groups based on filters") | ||
| // Get groups based on filters | ||
| describeSecurityGroupsRequest := ec2.DescribeSecurityGroupsInput{ | ||
| Filters: buildEC2Filters(g.Filters), | ||
| } | ||
| describeSecurityGroupsResult, err := client.DescribeSecurityGroups(&describeSecurityGroupsRequest) | ||
| describeSecurityGroupsResult, err := client.DescribeSecurityGroups(context.TODO(), &describeSecurityGroupsRequest) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
wc -l pkg/actuators/machine/instances.goRepository: openshift/machine-api-provider-aws
Length of output: 116
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '70,100p'Repository: openshift/machine-api-provider-aws
Length of output: 1356
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '100,160p'Repository: openshift/machine-api-provider-aws
Length of output: 2911
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '165,230p'Repository: openshift/machine-api-provider-aws
Length of output: 2704
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '265,280p'Repository: openshift/machine-api-provider-aws
Length of output: 733
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '540,550p'Repository: openshift/machine-api-provider-aws
Length of output: 630
🏁 Script executed:
head -30 pkg/actuators/machine/instances.goRepository: openshift/machine-api-provider-aws
Length of output: 857
🏁 Script executed:
fd client.go pkg/clientRepository: openshift/machine-api-provider-aws
Length of output: 98
🏁 Script executed:
cat -n pkg/client/client.go | head -100Repository: openshift/machine-api-provider-aws
Length of output: 5864
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '485,510p'Repository: openshift/machine-api-provider-aws
Length of output: 1550
🏁 Script executed:
rg "launchInstance|getSecurityGroupsIDs|getSubnetIDs|getAMI|getBlockDeviceMappings" pkg/actuators/machine/instances.go -nRepository: openshift/machine-api-provider-aws
Length of output: 1419
🏁 Script executed:
rg "launchInstance" pkg/actuators/machine/ -nRepository: openshift/machine-api-provider-aws
Length of output: 908
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '355,365p'Repository: openshift/machine-api-provider-aws
Length of output: 713
🏁 Script executed:
rg "func.*Create\|func.*create" pkg/actuators/machine/instances.go -nRepository: openshift/machine-api-provider-aws
Length of output: 60
🏁 Script executed:
cat -n pkg/actuators/machine/reconciler.go | sed -n '95,110p'Repository: openshift/machine-api-provider-aws
Length of output: 794
🏁 Script executed:
cat -n pkg/actuators/machine/reconciler.go | sed -n '1,50p'Repository: openshift/machine-api-provider-aws
Length of output: 2137
🏁 Script executed:
rg "func.*Reconcile" pkg/actuators/machine/reconciler.go -n -A 3Repository: openshift/machine-api-provider-aws
Length of output: 2783
🏁 Script executed:
cat -n pkg/actuators/machine/reconciler.go | grep -A 20 "type machineScope"Repository: openshift/machine-api-provider-aws
Length of output: 60
🏁 Script executed:
rg "type machineScope struct" pkg/actuators/machine/ -A 15Repository: openshift/machine-api-provider-aws
Length of output: 1232
🏁 Script executed:
cat -n pkg/actuators/machine/machine_scope.go | sed -n '1,50p'Repository: openshift/machine-api-provider-aws
Length of output: 1915
Stop dropping the reconcile context on these AWS calls.
The v2 client surface now accepts context.Context, but these helpers still hardcode context.TODO() for every EC2 request. The reconciler has access to a deadline/cancellation context through machineScope, but it's never passed into launchInstance or any of the helper functions (getSecurityGroupsIDs, getSubnetIDs, getAMI, getBlockDeviceMappings, getAvalabilityZoneFromSubnetID, getAvalabilityZoneTypeFromZoneName). That means controller cancellation/timeouts never reach AWS, so a cancelled reconcile can keep doing network I/O and then race the next retry. Please thread the caller context through these helpers and use it consistently instead.
Occurs at: lines 90, 130, 149, 172, 195, 225, 272, 546
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/actuators/machine/instances.go` around lines 78 - 90, The helper
functions (getSecurityGroupsIDs, getSubnetIDs, getAMI, getBlockDeviceMappings,
getAvalabilityZoneFromSubnetID, getAvalabilityZoneTypeFromZoneName) and their
caller launchInstance are using context.TODO() for AWS SDK calls; change their
signatures to accept a context.Context parameter and thread the reconciler's
context (from machineScope or the caller) through to each helper and ultimately
into client.DescribeSecurityGroups / DescribeSubnets / DescribeImages /
DescribeAvailabilityZones / DescribeInstances calls so the v2 AWS client
receives the real cancelled/deadline-aware context instead of context.TODO();
update all call sites (including launchInstance callers) to pass the incoming
ctx along.
| LoadBalancerName: aws.String(elbName), | ||
| } | ||
| _, err := client.RegisterInstancesWithLoadBalancer(req) | ||
| _, err := client.RegisterInstancesWithLoadBalancer(context.TODO(), req) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
wc -l pkg/actuators/machine/loadbalancers.goRepository: openshift/machine-api-provider-aws
Length of output: 120
🏁 Script executed:
cat -n pkg/actuators/machine/loadbalancers.go | head -200Repository: openshift/machine-api-provider-aws
Length of output: 9212
🏁 Script executed:
# Let's look specifically at the lines mentioned in the review
cat -n pkg/actuators/machine/loadbalancers.go | sed -n '1,100p'Repository: openshift/machine-api-provider-aws
Length of output: 4788
🏁 Script executed:
# Get more context around the problematic areas
cat -n pkg/actuators/machine/loadbalancers.go | sed -n '60,90p'Repository: openshift/machine-api-provider-aws
Length of output: 1753
🏁 Script executed:
# Check the full function signatures and context propagation
cat -n pkg/actuators/machine/loadbalancers.go | sed -n '1,40p'Repository: openshift/machine-api-provider-aws
Length of output: 1687
🏁 Script executed:
rg -n "registerWithClassicLoadBalancers|registerWithNetworkLoadBalancers|deregisterNetworkLoadBalancers" --type goRepository: openshift/machine-api-provider-aws
Length of output: 1368
🏁 Script executed:
# Check if there are other target types beyond Instance and Ip
rg -n "TargetType" --type goRepository: openshift/machine-api-provider-aws
Length of output: 12641
🏁 Script executed:
sed -n '410,430p' pkg/actuators/machine/reconciler.goRepository: openshift/machine-api-provider-aws
Length of output: 788
🏁 Script executed:
sed -n '440,460p' pkg/actuators/machine/reconciler.goRepository: openshift/machine-api-provider-aws
Length of output: 746
🏁 Script executed:
# Get function signature for the callers to see if context is available
sed -n '1,50p' pkg/actuators/machine/reconciler.go | head -50Repository: openshift/machine-api-provider-aws
Length of output: 1787
🏁 Script executed:
# Find the method containing these calls to understand context availability
sed -n '300,430p' pkg/actuators/machine/reconciler.goRepository: openshift/machine-api-provider-aws
Length of output: 5278
🏁 Script executed:
# Check the machineScope or Reconciler struct for context
rg -n "func.*create|func.*terminate" pkg/actuators/machine/reconciler.go | head -20Repository: openshift/machine-api-provider-aws
Length of output: 118
🏁 Script executed:
# Check the machineScope structure to see if it has context
rg -n "type machineScope|Context" pkg/actuators/machine/reconciler.go | head -30Repository: openshift/machine-api-provider-aws
Length of output: 269
🏁 Script executed:
# Find where Context is defined in machineScope
fd -t f "*.go" -x grep -l "machineScope" {} \;Repository: openshift/machine-api-provider-aws
Length of output: 361
🏁 Script executed:
# Check the machine scope file
cat pkg/actuators/machine/machine_scope.go | head -100Repository: openshift/machine-api-provider-aws
Length of output: 3616
🏁 Script executed:
# Check the AWS SDK to see all possible TargetTypeEnum values
grep -A 10 "type TargetTypeEnum" vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types/enums.goRepository: openshift/machine-api-provider-aws
Length of output: 422
🏁 Script executed:
# Also verify the exact line number for the nil dereference and check surrounding context more carefully
sed -n '50,78p' pkg/actuators/machine/loadbalancers.goRepository: openshift/machine-api-provider-aws
Length of output: 1392
Propagate the caller context through ELB and ELBv2 operations, and handle all supported target group types.
Every AWS call in this file is made with context.TODO(), so registration/deregistration work can continue after the parent operation has already been canceled. These helper functions should accept ctx from their callers (available via Reconciler.Context) and forward it to the AWS SDK calls instead.
Additionally, registerWithNetworkLoadBalancers() only initializes target for instance and ip target types. If a target group uses lambda or alb type (both supported by AWS), target.Id remains nil, causing a panic at line 73 when dereferenced.
Also applies to: 83-83, 125-125, 151-151, 163-163, 182-182
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/actuators/machine/loadbalancers.go` at line 31, The functions that call
AWS ELB/ELBv2 APIs (e.g., RegisterInstancesWithLoadBalancer invocation and
registerWithNetworkLoadBalancers, plus the deregister counterparts) should
accept a caller context parameter (ctx) and pass that ctx into all SDK calls
instead of using context.TODO(); update the signatures where needed and replace
context.TODO() with ctx for calls like client.RegisterInstancesWithLoadBalancer
and client.RegisterTargets/RegisterTargetGroup/etc. In
registerWithNetworkLoadBalancers and similar helpers, avoid dereferencing
target.Id unconditionally: only read target.Id for target.Type == "instance" or
"ip" (and set the InstanceId/TargetId appropriately), and for "lambda" or "alb"
target types either leave the field nil or handle them according to AWS contract
(do not call aws.StringValue on a nil pointer); add a nil-check (e.g., if
target.Id != nil) or a switch on target.Type to safely build the target
description to prevent the panic. Ensure the same ctx propagation and
target-type-safe handling is applied to the other referenced call sites (lines
noted) for both register and deregister flows.
| var target elbv2types.TargetDescription | ||
| switch string(targetGroup.TargetType) { | ||
| case string(elbv2types.TargetTypeEnumInstance): | ||
| target = elbv2types.TargetDescription{ | ||
| Id: instance.InstanceId, | ||
| } | ||
| klog.V(4).Infof("Registering instance %q by instance ID to target group: %v", *instance.InstanceId, *targetGroup.TargetGroupArn) | ||
| case elbv2.TargetTypeEnumIp: | ||
| target = &elbv2.TargetDescription{ | ||
| klog.V(4).Infof("Registering instance %q by instance ID to target group: %v", *instance.InstanceId, aws.ToString(targetGroup.TargetGroupArn)) | ||
| case string(elbv2types.TargetTypeEnumIp): | ||
| target = elbv2types.TargetDescription{ | ||
| Id: instance.PrivateIpAddress, | ||
| } | ||
| klog.V(4).Infof("Registering instance %q by IP to target group: %v", *instance.InstanceId, *targetGroup.TargetGroupArn) | ||
| klog.V(4).Infof("Registering instance %q by IP to target group: %v", *instance.InstanceId, aws.ToString(targetGroup.TargetGroupArn)) | ||
| } |
There was a problem hiding this comment.
Handle unknown target types before dereferencing target.Id.
Only the instance and ip cases initialize target, so any other TargetType leaves target.Id nil and Line 73 will panic. A default branch plus a nil-ID guard would fail cleanly here.
🛡️ Suggested guard
var target elbv2types.TargetDescription
switch string(targetGroup.TargetType) {
case string(elbv2types.TargetTypeEnumInstance):
target = elbv2types.TargetDescription{
Id: instance.InstanceId,
}
klog.V(4).Infof("Registering instance %q by instance ID to target group: %v", *instance.InstanceId, aws.ToString(targetGroup.TargetGroupArn))
case string(elbv2types.TargetTypeEnumIp):
target = elbv2types.TargetDescription{
Id: instance.PrivateIpAddress,
}
klog.V(4).Infof("Registering instance %q by IP to target group: %v", *instance.InstanceId, aws.ToString(targetGroup.TargetGroupArn))
+ default:
+ errs = append(errs, fmt.Errorf("%s: unsupported target type %q", aws.ToString(targetGroup.TargetGroupArn), targetGroup.TargetType))
+ continue
}
+ if target.Id == nil {
+ errs = append(errs, fmt.Errorf("%s: missing target identifier for target type %q", aws.ToString(targetGroup.TargetGroupArn), targetGroup.TargetType))
+ continue
+ }Also applies to: 67-75
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/actuators/machine/loadbalancers.go` around lines 53 - 65, The switch on
targetGroup.TargetType only sets target.Id for Instance and Ip and can leave
target.Id nil, so add a default case in the switch (checking
targetGroup.TargetType) that logs/returns/skips for unsupported target types
instead of leaving target uninitialized; then before any dereference of
target.Id (or before using it in registration/logging) add a nil guard like if
target.Id == nil { klog.Errorf("unsupported or missing target id for target
group %v", aws.ToString(targetGroup.TargetGroupArn)); continue/return/error }
and use aws.ToString(target.Id) (or otherwise safely handle the nil) when
logging/using the ID; update the switch block that handles
elbv2types.TargetTypeEnumInstance and elbv2types.TargetTypeEnumIp and the
subsequent registration/logging code to include these guards.
| } | ||
|
|
||
| result, err := client.DescribeInstances(request) | ||
| result, err := client.DescribeInstances(context.TODO(), request) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '110,130p'Repository: openshift/machine-api-provider-aws
Length of output: 843
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '190,210p'Repository: openshift/machine-api-provider-aws
Length of output: 933
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '220,240p'Repository: openshift/machine-api-provider-aws
Length of output: 814
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '255,275p'Repository: openshift/machine-api-provider-aws
Length of output: 777
🏁 Script executed:
rg -n "^func.*getInstanceByID|^func.*correctExistingTags|^func.*getInstances|^func.*terminateInstances" pkg/actuators/machine/utils.goRepository: openshift/machine-api-provider-aws
Length of output: 611
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '100,120p'Repository: openshift/machine-api-provider-aws
Length of output: 852
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '175,210p'Repository: openshift/machine-api-provider-aws
Length of output: 1446
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '205,230p'Repository: openshift/machine-api-provider-aws
Length of output: 1062
🏁 Script executed:
cat -n pkg/actuators/machine/utils.go | sed -n '245,265p'Repository: openshift/machine-api-provider-aws
Length of output: 1158
🏁 Script executed:
rg -n "getInstanceByID|correctExistingTags|getInstances|terminateInstances" pkg/actuators/machine/utils.go | grep -v "^[0-9]*:func\|^[0-9]*://"Repository: openshift/machine-api-provider-aws
Length of output: 431
🏁 Script executed:
fd "\.go$" pkg/actuators/machine | xargs rg -l "getInstanceByID|correctExistingTags|getInstances|terminateInstances" | head -5Repository: openshift/machine-api-provider-aws
Length of output: 219
🏁 Script executed:
rg -n -B 5 "getInstanceByID|getInstances\(" pkg/actuators/machine/instances.go | head -50Repository: openshift/machine-api-provider-aws
Length of output: 60
🏁 Script executed:
rg -n -B 5 "terminateInstances|correctExistingTags" pkg/actuators/machine/instances.go | head -50Repository: openshift/machine-api-provider-aws
Length of output: 258
🏁 Script executed:
rg -n "func.*\(ctx\|context" pkg/actuators/machine/instances.go | head -10Repository: openshift/machine-api-provider-aws
Length of output: 60
🏁 Script executed:
rg -n "func.*\(ctx\|context" pkg/actuators/machine/reconciler.go | head -10Repository: openshift/machine-api-provider-aws
Length of output: 60
🏁 Script executed:
cat -n pkg/actuators/machine/instances.go | sed -n '45,75p'Repository: openshift/machine-api-provider-aws
Length of output: 1218
🏁 Script executed:
rg -n "context\." pkg/actuators/machine/instances.go | head -15Repository: openshift/machine-api-provider-aws
Length of output: 854
🏁 Script executed:
rg -n "context\." pkg/actuators/machine/reconciler.go | head -15Repository: openshift/machine-api-provider-aws
Length of output: 60
🏁 Script executed:
rg -n "^func \(.*\)" pkg/actuators/machine/instances.go | head -20Repository: openshift/machine-api-provider-aws
Length of output: 209
🏁 Script executed:
rg -n "^func \(.*\)" pkg/actuators/machine/reconciler.go | head -20Repository: openshift/machine-api-provider-aws
Length of output: 892
🏁 Script executed:
cat -n pkg/actuators/machine/reconciler.go | head -100 | tail -50Repository: openshift/machine-api-provider-aws
Length of output: 2792
🏁 Script executed:
rg -n "type Reconciler struct" pkg/actuators/machine/reconciler.go -A 20Repository: openshift/machine-api-provider-aws
Length of output: 895
🏁 Script executed:
rg -n "Context" pkg/actuators/machine/reconciler.go | head -10Repository: openshift/machine-api-provider-aws
Length of output: 269
🏁 Script executed:
rg -n "type machineScope struct" pkg/actuators/machine/ -A 15Repository: openshift/machine-api-provider-aws
Length of output: 1280
🏁 Script executed:
grep -n "Context.*context" pkg/actuators/machine/machine_scope.go | head -10Repository: openshift/machine-api-provider-aws
Length of output: 60
Propagate the caller context into these EC2 requests.
Using context.TODO() here discards cancellation and deadlines from the request path. The context is available through the machineScope.Context embedded field at entry points and should be threaded through these helper functions instead of being discarded.
Affected lines: 117, 198, 225, 261
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/actuators/machine/utils.go` at line 117, The EC2 calls use context.TODO()
which discards cancellation/deadline propagation; update the helper functions
that call client.DescribeInstances (and similar EC2 client calls at the noted
locations) to accept a context.Context parameter (or accept the machine scope so
you can read machineScope.Context) and replace context.TODO() with that context
(use machineScope.Context where these helpers are invoked). Locate all
occurrences of client.DescribeInstances(...) and other EC2 calls in this file
and thread the caller context through the function signatures and call sites so
cancellation and deadlines from machineScope.Context are honored.
| GetCachedDescribeRegions(ctx context.Context, cfg aws.Config) (*ec2.DescribeRegionsOutput, error) | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cd / && find . -type f -name "client.go" | grep "pkg/client" | head -5Repository: openshift/machine-api-provider-aws
Length of output: 522
🏁 Script executed:
wc -l pkg/client/client.goRepository: openshift/machine-api-provider-aws
Length of output: 102
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '1,50p'Repository: openshift/machine-api-provider-aws
Length of output: 1967
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '240,280p'Repository: openshift/machine-api-provider-aws
Length of output: 1614
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '260,280p'Repository: openshift/machine-api-provider-aws
Length of output: 984
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '50,150p'Repository: openshift/machine-api-provider-aws
Length of output: 6962
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '273,320p'Repository: openshift/machine-api-provider-aws
Length of output: 2115
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '150,240p'Repository: openshift/machine-api-provider-aws
Length of output: 5001
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '320,400p'Repository: openshift/machine-api-provider-aws
Length of output: 4008
🏁 Script executed:
grep -n "newAWSConfig" pkg/client/client.go | head -10Repository: openshift/machine-api-provider-aws
Length of output: 607
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '330,450p'Repository: openshift/machine-api-provider-aws
Length of output: 5604
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '390,430p'Repository: openshift/machine-api-provider-aws
Length of output: 1502
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '444,480p'Repository: openshift/machine-api-provider-aws
Length of output: 1761
🏁 Script executed:
cat -n pkg/client/client.go | sed -n '212,227p'Repository: openshift/machine-api-provider-aws
Length of output: 1002
🏁 Script executed:
grep -n "GetCachedDescribeRegions\|RegionCache" pkg/client/client.goRepository: openshift/machine-api-provider-aws
Length of output: 1069
Region validation bypasses the configured EC2 endpoint.
newAWSConfig() resolves custom EC2 BaseEndpoint options and returns them separately as ec2OptFns, but GetCachedDescribeRegions() receives only aws.Config and creates an EC2 client without these service options. When custom endpoints are configured via Infrastructure.Status.PlatformStatus.AWS.ServiceEndpoints, the region validation uses the default endpoint instead of the configured one, while the actual client created afterward applies the configuration correctly. Pass the EC2 option functions to the cache method or apply them when building the validation client.
Also applies to: 275-297, 333-345, 397-401
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/client/client.go` around lines 262 - 263, GetCachedDescribeRegions is
building an EC2 client from only aws.Config, so it ignores the service-specific
ec2OptFns (resolved in newAWSConfig) and thus validates regions against the
default endpoint; update the cache API and callers to accept and forward the EC2
service option funcs (ec2OptFns) or apply those funcs when constructing the
validation EC2 client inside GetCachedDescribeRegions so the DescribeRegions
call uses the configured BaseEndpoint; search for newAWSConfig, ec2OptFns, and
GetCachedDescribeRegions (and the other affected cached methods referenced
around lines 275-297, 333-345, 397-401) and ensure each callsite passes the ec2
option functions through to the cache and that the cache uses them when creating
the ec2.NewFromConfig client.
|
@RadekManak: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Replace github.com/aws/aws-sdk-go (v1) with github.com/aws/aws-sdk-go-v2 across all production and test code. Key changes include:
Summary by CodeRabbit
Release Notes
Infrastructure Upgrade
Bug Fixes & Improvements