-
Notifications
You must be signed in to change notification settings - Fork 124
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
Conversation
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>
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
proto/ligato/vpp/dns/models.go
Outdated
// DNSServer is registered NB model of DNSServer | ||
ModelDNSServer = models.Register(&DNSServer{}, models.Spec{ | ||
Module: ModuleName, | ||
Type: "dnsserver", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
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)).