Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurestack: Modify destroy code to handle public dns record deletion #5095

Merged

Conversation

rna-afk
Copy link
Contributor

@rna-afk rna-afk commented Jul 20, 2021

Modifying the Azure deletion code to check if the environment is
Azure Stack Hub and if so, check and delete the A records in the
public DNS that is relevant to the current cluster during cluster
destroy.

@rna-afk
Copy link
Contributor Author

rna-afk commented Jul 20, 2021

/cc @patrickdillon

@rna-afk
Copy link
Contributor Author

rna-afk commented Jul 21, 2021

/test e2e-azure

@rna-afk rna-afk force-pushed the azurestack_destroy_dns_record branch from d8456e3 to 8303357 Compare July 21, 2021 11:35
@rna-afk
Copy link
Contributor Author

rna-afk commented Jul 21, 2021

/test e2e-azure

Copy link
Contributor

@patrickdillon patrickdillon left a comment

Choose a reason for hiding this comment

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

This is in good shape. I don't love deleting based on the name but I don't think we have many other options. Adding a check against tag/metadata will provide some more piece of mind, but as I said we can follow that up later if time does not allow doing it now.

To merge this can you please address the two comments about squashing commit and deleting the comment. Then we can deal with the other work subsequently.

pkg/destroy/azure/azure.go Outdated Show resolved Hide resolved
pkg/destroy/azure/azure.go Outdated Show resolved Hide resolved
pkg/destroy/azure/azure.go Outdated Show resolved Hide resolved
return err
}
for _, record := range recordPages.Values() {
if t := to.String(record.Name); t == privateDNSRecordName || t == publicDNSRecordName {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if in addition we can check based on a tag/metadata. I see that there is support for creating with a tag/metadata.

So would the client support a check to see if the record has the tag with key/value:

"kubernetes.io_cluster.${var.cluster_id}" = "owned"

I don't believe we can locate the DNS record by this tag, which would be the ideal scenario (then we would not need to add new values to the metadata).

This can also be followed up in a subsequent PR to add the tag in the terraform code & check the tag here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually if we can check on tags, then we wouldn't need/want to check the names. That is, we could just loop through all the records and see if they match the tag (not the name). But yeah that can be a subsequent PR once we confirm installer, ingress and any other dns records can be tagged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll check it out. Will update this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we adding the tags right now? I don't see them in the DNS records on the portal.

Copy link
Contributor

Choose a reason for hiding this comment

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

No. We can add them in a subsequent pr.

@rna-afk rna-afk force-pushed the azurestack_destroy_dns_record branch from 8303357 to a0fc5b3 Compare July 22, 2021 12:26
@rna-afk rna-afk force-pushed the azurestack_destroy_dns_record branch from a0fc5b3 to 3f946c0 Compare July 22, 2021 14:01
@rna-afk rna-afk force-pushed the azurestack_destroy_dns_record branch from 3f946c0 to b9211ee Compare July 23, 2021 12:30
Modifying the Azure deletion code to check if the environment is
Azure Stack Hub and if so, check and delete the A records in the
public DNS that is relevant to the current cluster during cluster
destroy.
Adding vendor files for Azure Stack Hub client support for DNS.
@rna-afk rna-afk force-pushed the azurestack_destroy_dns_record branch from b9211ee to 4abfaaf Compare July 23, 2021 15:09
@patrickdillon
Copy link
Contributor

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 23, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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

The pull request process is described here

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 23, 2021

@rna-afk: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-openstack-kuryr 4abfaaf link /test e2e-openstack-kuryr
ci/prow/e2e-crc 4abfaaf link /test e2e-crc
ci/prow/e2e-aws-single-node 4abfaaf link /test e2e-aws-single-node
ci/prow/e2e-aws-fips 4abfaaf link /test e2e-aws-fips
ci/prow/e2e-aws-workers-rhel7 4abfaaf link /test e2e-aws-workers-rhel7
ci/prow/e2e-libvirt 4abfaaf link /test e2e-libvirt
ci/prow/e2e-metal-ipi-ovn-ipv6 4abfaaf link /test e2e-metal-ipi-ovn-ipv6

Full PR test history. Your PR dashboard.

Instructions 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/test-infra repository. I understand the commands that are listed here.

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.

None yet

3 participants