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

bluecat: improve test coverage #2185

Merged
merged 3 commits into from
Jul 20, 2021

Conversation

jaideepbellani
Copy link
Contributor

@jaideepbellani jaideepbellani commented Jul 19, 2021

Description

Removed return statements for error from BluecatRecords function.
Added two new tests and test cases to improve test coverage

Checklist

  • Unit tests updated
  • End user documentation updated

Jaideep Bellani added 2 commits July 19, 2021 16:13
We were returning an error when the owner string was not found and this was causing the loop to quit. This is not ideal because it does not fetch the other records once it returns.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 19, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 19, 2021
@vinny-sabatini
Copy link
Contributor

/assign @seanmalloy
/assign

@@ -215,7 +215,7 @@ func (p *BluecatProvider) Records(ctx context.Context) (endpoints []*endpoint.En
tempEndpoint := endpoint.NewEndpoint(rec.Name, endpoint.RecordTypeTXT, rec.Properties)
tempEndpoint.Labels[endpoint.OwnerLabelKey], err = extractOwnerfromTXTRecord(rec.Properties)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the only error being returned by extractOwnerfromTXTRecord is if an owner is not found, and not having an owner is a valid thing that can happen (ex if something was created in Bluecat by something other than External DNS), it might make sense to just not return an error on the function.

Another option could be to get the value and do not directly attempt to set the label of the Endpoint, and then if an error is not returned in the function, the endpoint would have the label added, and it would be added to the list of endpoints.

@seanmalloy what if your opinion on that?

Copy link
Contributor

Choose a reason for hiding this comment

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

After talking with Sean, we think this is the appropriate way to handle this

provider/bluecat/bluecat_test.go Outdated Show resolved Hide resolved
@seanmalloy
Copy link
Member

/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jul 20, 2021
@seanmalloy
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 20, 2021
Copy link
Contributor

@vinny-sabatini vinny-sabatini left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaideepbellani, vinny-sabatini

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 20, 2021
@k8s-ci-robot k8s-ci-robot merged commit f9a3fe3 into kubernetes-sigs:master Jul 20, 2021
@seanmalloy seanmalloy deleted the bluecat-delete branch July 20, 2021 16:55
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants