Skip to content

Commit

Permalink
Merge pull request openshift#73 from odvarkadaniel/fix-diff-subnet-az
Browse files Browse the repository at this point in the history
OCPBUGS-6882: Fix getting AZ from subnet id to check mismatch
  • Loading branch information
openshift-merge-robot committed May 26, 2023
2 parents 472139b + c645535 commit b793cbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/actuators/machine/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func getSubnetIDs(machine runtimeclient.ObjectKey, subnet machinev1beta1.AWSReso
if subnet.ID != nil {
subnetIDs = append(subnetIDs, subnet.ID)

availabilityZoneFromSubnetID, err := getAvalabilityZoneFromSubnetID(availabilityZone, client)
availabilityZoneFromSubnetID, err := getAvalabilityZoneFromSubnetID(*subnet.ID, client)
if err != nil {
klog.Errorf("could not check if the subnet id and availability zone fields are mismatched: %w", err)
return subnetIDs, nil
Expand Down Expand Up @@ -165,7 +165,7 @@ func getSubnetIDs(machine runtimeclient.ObjectKey, subnet machinev1beta1.AWSReso
// getAvalabilityZoneFromSubnetID gets an availability zone from specified subnet id.
func getAvalabilityZoneFromSubnetID(subnetID string, client awsclient.Client) (string, error) {
result, err := client.DescribeSubnets(&ec2.DescribeSubnetsInput{
DryRun: aws.Bool(true),
DryRun: aws.Bool(false),
SubnetIds: []*string{
aws.String(subnetID),
},
Expand Down

0 comments on commit b793cbd

Please sign in to comment.