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

feat: Support for cache DNS server in VPP + e2e test refactoring #1779

Merged
merged 13 commits into from
Feb 3, 2021

Conversation

fgschwan
Copy link
Collaborator

I will add only the simple functionality (turn it on and configure the upstream DNS server that will VPP consult for unknown domain names).
However, this PR will contain also e2e test and related e2e changes. These related changes touched some basic things that lead to some heavy e2e refactoring (docker contrainer code deduplication, decupling of basic test topology components (agent,etcd,microservices,...) with underlaying runtime (docker containers)).

refactor: deduplicated common container related code and commands run in container

Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
refactor: big refactoring making test topology components (agent, ms, etcd, dns server) decoupled from underlaying docker runtime (some test specific help methods need to be yet change)

Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
…ainer as DNS server

Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
…r struct where it logically belongs + added some todos to do the same for other test components

Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
… execCmd configuration with vpp-agent configuration

Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
@fgschwan fgschwan changed the title WIP feat: Support for cache DNS server in VPP + e2e test refactoring feat: Support for cache DNS server in VPP + e2e test refactoring Jan 26, 2021
@fgschwan
Copy link
Collaborator Author

Unit test + integration tests (vpp 20.01,20.05,20.09) + e2e tests (vpp 20.01,20.05,20.09) were successful.

// EquivalentDNSServers determines whether 2 DNS servers are logically equal. This comparison takes
// into consideration also semantics that couldn't be modeled into proto models (i.e. upstream servers are
// IP addresses and not only strings)
func (d *DNSServerDescriptor) EquivalentDNSServers(key string, oldDNSServer, newDNSServer *dns.DNSServer) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

EquivalentDNSServers could compare UpstreamDnsServers as sets, i.e. different order of the same set of values could be considered equivalent. Otherwise it behaves just like proto.Equal and so it is not neccessarry.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Upstream DNS server is a list and not a set. Removing EquivalentDNSServers. Fixed in ac77bf2

return nil, nil
}

func (d *DNSServerDescriptor) updateUpstreamDNSServerList(oldServers, newServers []string) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be more efficient - delete only the obsolete entries and add only the truly new ones. Otherwise it is essentially re-create and so the Update method could be omitted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Initially i wanted to do it efficiently until i realized that it is not possible. VPP doesn't allow me to insert new upstream DNS server into proper place in the list, but just append at the end of list. Hence the recreate. However i forgot to reevaluate the usefulness of the Update function implementation.
Fixed in ac77bf2.

// DNSServer is registered NB model of DNSServer
ModelDNSServer = models.Register(&DNSServer{}, models.Spec{
Module: ModuleName,
Type: "dnsserver",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would maybe go with type "dnscache" (likewise for proto message name), just to make it clear that this is not actually a proper DNS server.
Version can be "v1" since this is the first version of the model.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 34ea247

Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
Signed-off-by: Filip Gschwandtner <filip.gschwandtner@pantheon.tech>
@ondrej-fabry ondrej-fabry merged commit 3e7d2c9 into ligato:master Feb 3, 2021
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.

3 participants