Skip to content

Conversation

@abhinavdahiya
Copy link
Contributor

@abhinavdahiya abhinavdahiya commented May 21, 2019

It uses the infra-id from clustermetadata to extract the ResourceGroup

The destroy code performs 2 operations:

  1. Remove dns records from the shared public DNS zone

    • Find the private dns zones in Resource Group
    • Find all public zones that can be parent of the private zone, and remove all records that match the complete dns record in the private zone
    • Use the records in the private zone to remove the corresponding records from the shared dns zone.
  2. Delete the Resource Group

    Azure automatically deletes all the resources in the Resource Group

/cc @wking @jstuever

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 21, 2019
@abhinavdahiya
Copy link
Contributor Author

/retest

@wking
Copy link
Member

wking commented May 22, 2019

Why does nobody support tagging DNS records?? Sigh...

Copy link
Member

Choose a reason for hiding this comment

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

Why the local variable vs. o.resourceGroupsClient = resources.NewGroupsGroupClient(o.SubscriptionID)? Are we casting to an Interface or some such and loosing access to the Authorizer property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Azure sdk doesn't have a way to initialize a client with auth.
So the

client := NewClient()
client.Authorizer = auth
o.client = client

seems more appropriate of create a new client, and use that to initialize/assign our client.

Do you have strongly about not using the local var? If not personally current make more sense to me and i would like to keep it as is...?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking:

o.client = NewClient()
o.client.Authorizer = auth

but don't feel strongly either way.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it functions properly, I think Trevor's recommendation is more concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, fixed with 1bd15ad...9a57507

@trown
Copy link

trown commented May 22, 2019

/test e2e-openstack

This bump is required to include `github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/`
Copy link
Member

Choose a reason for hiding this comment

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

getSharedDNSZone -> getSharedDNSZones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

Do we want our own type, or can we use dns.Zone directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

[dns.Zone][https://godoc.org/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns#Zone] has pointers for fields, doesn't have the resource group (that needs to be inferred from ID).

This small spare struct stores the details in easy to use way.

Copy link
Member

Choose a reason for hiding this comment

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

This will fail instead of endlessly retrying (which is what the AWS destroyer does now). Sometimes (e.g. stuck resource), failing is good. Sometimes (e.g. network hiccup), retrying is good. Do we have a design preference? Or is this behavior going to be a per-platform choice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Azure only makes 2 calls, delete public records and another is delete resource group. Also the underlying impl has retries for retryable errors..

So I think this is good start. and We can make it retryable on our end when we think that will become necessary.

@trown
Copy link

trown commented May 22, 2019

/test e2e-openstack

@abhinavdahiya
Copy link
Contributor Author

In the commit message, we pick the public DNS zone with the longest name that exists is stale now that we check all public zones.

also fixed the commit message.

@abhinavdahiya
Copy link
Contributor Author

ping @wking @jstuever

It uses the `infra-id` from clustermetadata to extract the ResourceGroup

The destroy code performs 2 operations:

1) Remove dns records from the shared public DNS zone

    - Find the private dns zones in Resource Group
    - Find all public zones that can be parent of the private zone, and remove all records that match the `complete` dns record in the private zone
    - Use the records in the private zone to remove the corresponding records from the shared dns zone.

2) Delete the Resource Group

    Azure automatically deletes all the resources in the Resource Group
@jstuever
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 29, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, jstuever

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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 29, 2019

@abhinavdahiya: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-scaleup-rhel7 9a57507 link /test e2e-aws-scaleup-rhel7

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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.

@openshift-merge-robot openshift-merge-robot merged commit 3ef6441 into openshift:master May 29, 2019
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. platform/azure size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants