Skip to content

Conversation

@joelddiaz
Copy link
Contributor

@joelddiaz joelddiaz commented Sep 1, 2020

Try number 2 to use one AWS DNS cleanup implementation.

Rework the DNSZone controller's AWS actuator code for DNS zone cleanup so that it is an exported function that can also be called during a failed cluster installation.

Rather than two similar DNS cleanup functions, unify onto one implementation that can be used by all callers.

This means we now remove more than just A records on a failed intall.

Also, populate DNSZone status immediately after fetching zoneID during Refresh() and Create()

Add test case to cover DNSZone being deleted without status.

Align with other actuators and just store entire AWS dnszone after receiving it.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2020
Copy link
Contributor

@twiest twiest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, 1 minor nit.

I don't feel strongly about it, so I'll lgtm if you want to keep it as is. :)

return err
}

func (a *AWSActuator) deleteRecordSets(logger log.FieldLogger) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function still needed?

Would it be better to just have everything call DeleteAWSRecordSets directly?


// zoneID is the ID of the hosted zone in route53
zoneID *string
// hostedZone is the AWS object representing the hosted zone in route53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I do not object to this change, it is not clear to me why it is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just when comparing to the other actuators, it seemed odd that we didn't have access to the full object after we went through the trouble of fetching it. But you're right, it has no immediate effect other that making the aws actuator more similar to the other actuators.

Comment on lines 33 to 39
if dnsZone.Status.AWS == nil {
return fmt.Errorf("found non-AWS DNSZone for AWS ClusterDeployment")
}
if dnsZone.Status.AWS.ZoneID == nil {
// Shouldn't really be possible as we block install until DNS is ready:
return fmt.Errorf("DNSZone %s has no ZoneID set", dnsZone.Name)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be cleaner if this code were in cleanupAWSDNSZone instead.

Comment on lines +364 to +367
if err := a.ModifyStatus(); err != nil {
logger.WithError(err).Error("failed to populate DNSZone status")
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is snuck in the "just store entire aws dnszone" commit. Should it be in the "populate DNSZone status immediately after fetching zoneID (AWS)" commit instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it came up while testing things and i must have squashed the wrong commits together while cleaning up the commits for submission.

@joelddiaz joelddiaz force-pushed the aws-dns-cleanup-second branch from 85bbea7 to 8d509a9 Compare September 1, 2020 15:44
@joelddiaz
Copy link
Contributor Author

@twiest @staebler PTAL, i addressed the feedback (and tried to clean up the history where the populating of DNSZone status is concerned)

Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Can you squash commit #1 and #4 into a single commit or squash everything into a single commit?

@twiest
Copy link
Contributor

twiest commented Sep 1, 2020

Looks good to me as well. One of us can lgtm after the squash.

Rather than two similar DNS cleanup functions, unify onto one implementation that can be used by all callers.

This means we now remove more than just A records on a failed intall.

Also, populate DNSZone status immediately after fetching zoneID during Refresh() and Create()

Add test case to cover DNSZone being deleted without status.

Align with other actuators and just store entire AWS dnszone after receiving it.
@joelddiaz joelddiaz force-pushed the aws-dns-cleanup-second branch from 8d509a9 to de7dd1d Compare September 1, 2020 18:22
@joelddiaz
Copy link
Contributor Author

squashed and updated git commit text (and PR text as well)

@twiest
Copy link
Contributor

twiest commented Sep 1, 2020

/lgtm

@joelddiaz
Copy link
Contributor Author

/retest

1 similar comment
@joelddiaz
Copy link
Contributor Author

/retest

@joelddiaz
Copy link
Contributor Author

@twiest i think the bot took an unplanned vacation and missed your lgtm

@twiest
Copy link
Contributor

twiest commented Sep 2, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 2, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelddiaz, twiest

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 40a1e3a into openshift:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants