Skip to content

Commit

Permalink
Handle missing VPC ID on initial provision (#1070)
Browse files Browse the repository at this point in the history
Kops clusters don't have their VPC ID stored in metadata the first
time the cluster is provisioned. This change adds a direct lookup
in those cases.
  • Loading branch information
gabrieljackson committed Aug 28, 2024
1 parent a819b35 commit c613cb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/provisioner/cluster_provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ func provisionCluster(
// Sync PGBouncer configmap if there is any change
vpc := cluster.VpcID()
if vpc == "" {
return errors.New("cluster metadata returned an empty VPC ID")
vpc, err = awsClient.GetClaimedVPC(cluster.ID, logger)
if err != nil {
return errors.Wrap(err, "failed to lookup cluster VPC")
}
}

ctx, cancel = context.WithTimeout(context.Background(), time.Duration(10)*time.Second)
Expand Down

0 comments on commit c613cb5

Please sign in to comment.