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

refactor (3/3): Introducing local FakeDNS #507

Merged
merged 1 commit into from
May 31, 2021
Merged

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented May 31, 2021

I removed global fake DNS from controller and replaced it by local DNS server from utils.
I fixed controller unit tests to be interacting with local FakeDNS instances.

Signed-off-by: kuritka [email protected]

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

Just one comment above.

Overall looks really clean and manageable. Is it a candidate for https://github.com/AbsaOSS/gopkg/ in the future? Can be reused outside of k8gb

fqdn := strings.Split(rr.String(), "\t")[0]
if fqdn == r.Question[0].Name {
msg.Answer = append(msg.Answer, rr)
// msg.Extra = append(msg.Extra, rr)
Copy link
Member

Choose a reason for hiding this comment

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

Reserved for the future?

I removed global fake DNS from controller and replaced it by local dns server from utils.
I fixed controller unit tests to be interracting with local FakeDNS instances.

Signed-off-by: kuritka <[email protected]>
@kuritka kuritka force-pushed the refactor-FakeDNS2 branch from 47dbf07 to d20c1d9 Compare May 31, 2021 15:23
@kuritka
Copy link
Collaborator Author

kuritka commented May 31, 2021

@ytsarev , amended.

💯 it will go to gopkg. The idea is to make it run for a while in k8gb. Maybe some changes will need to be implemented and when it settles down a bit, we'll move it into gopkg.

@kuritka kuritka requested a review from ytsarev May 31, 2021 15:32
@kuritka kuritka merged commit 7264ca7 into master May 31, 2021
@kuritka kuritka deleted the refactor-FakeDNS2 branch May 31, 2021 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants