Skip to content

Commit 0c57d10

Browse files
committed
OCPBUGS-34243: unique AWS HostedZone Caller Ref
The CallerReference used when creating an AWS Hosted Zone should be unqiue, as stated in the docs: > A unique string that identifies the request https://docs.aws.amazon.com/cli/latest/reference/route53/create-hosted-zone.html Prior to this commit, the Caller Reference is simply a timestamp. We have seen an issue, when batch launching multiple simultaneous installs in CI that the call may happen at the same time and therefore have the same Caller Reference, which leads to the failure: > failed to create private hosted zone: error creating private hosted zone: > HostedZoneAlreadyExists: A hosted zone has already been created with > the specified caller reference. Instead, let's use the infraid, which is our typical way of distinguishing clusters and contains a short unique-ish id to avoid collisions.
1 parent 8310b10 commit 0c57d10

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/asset/installconfig/aws/route53.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"strconv"
77
"strings"
8-
"time"
98

109
"github.com/aws/aws-sdk-go/aws"
1110
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
@@ -248,9 +247,8 @@ func (c *Client) CreateHostedZone(ctx context.Context, input *HostedZoneInput) (
248247
cfg := GetR53ClientCfg(c.ssn, input.Role)
249248
svc := route53.New(c.ssn, cfg)
250249

251-
callRef := fmt.Sprintf("%d", time.Now().Unix())
252250
res, err := svc.CreateHostedZoneWithContext(ctx, &route53.CreateHostedZoneInput{
253-
CallerReference: aws.String(callRef),
251+
CallerReference: aws.String(input.InfraID),
254252
Name: aws.String(input.Name),
255253
HostedZoneConfig: &route53.HostedZoneConfig{
256254
PrivateZone: aws.Bool(true),

0 commit comments

Comments
 (0)