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

Always add initial client DNS config to request #1316

Merged

Conversation

NikitaSkrynnik
Copy link
Contributor

@NikitaSkrynnik NikitaSkrynnik commented Jul 1, 2022

Signed-off-by: Nikita Skrynnik nikita.skrynnik@xored.com

Description

Endpoint appends its DNS configs to configs which are already in the connection on first request from a client. Client saves these DNS configs. On Refresh client sends request with saved configs to the endpoint and the endpoint appends its configs again. It leads to duplication of the endpoint's dns configs on refreshes.

Issue link

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionallity
  • Documentation
  • Refactoring
  • CI

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
@NikitaSkrynnik NikitaSkrynnik marked this pull request as ready for review July 1, 2022 12:22
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
Comment on lines 87 to 91
v, _ := metadata.Map(ctx, true).LoadOrStore(dnsContextClientRefreshKey, request.Connection.Context.DnsContext.Configs)
initialClientDNSConfigs := v.([]*networkservice.DNSConfig)

initialClientDNSConfigs = append(initialClientDNSConfigs, c.resolvconfDNSConfig)
request.Connection.Context.DnsContext.Configs = initialClientDNSConfigs
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
v, _ := metadata.Map(ctx, true).LoadOrStore(dnsContextClientRefreshKey, request.Connection.Context.DnsContext.Configs)
initialClientDNSConfigs := v.([]*networkservice.DNSConfig)
initialClientDNSConfigs = append(initialClientDNSConfigs, c.resolvconfDNSConfig)
request.Connection.Context.DnsContext.Configs = initialClientDNSConfigs
initialClientDNSConfigs, _ := metadata.Map(ctx, true).LoadOrStore(dnsContextClientRefreshKey, request.Connection.Context.DnsContext.Configs)
request.Connection.Context.DnsContext.Configs = append(initialClientDNSConfigs.([]*networkservice.DNSConfig,c.resolvconfDNSConfig)

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
@denis-tingaikin denis-tingaikin merged commit 6cf1b72 into networkservicemesh:main Jul 4, 2022
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-admission-webhook-k8s that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-ipam-vl3 that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-map-ip-k8s that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Jul 4, 2022
…k@main

PR link: networkservicemesh/sdk#1316

Commit: 6cf1b72
Author: Nikita Skrynnik
Date: 2022-07-04 23:12:45 +1100
Message:
  - Always add initial client DNS config to request (#1316)
* always add initial client DNS config to request

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix test

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* add proper join for resolvconf and client DNS configs

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* save initial client dns configs in dnsContextClient

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* cleanup

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply review comments

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* apply comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
@NikitaSkrynnik NikitaSkrynnik deleted the fix-dns-config branch August 7, 2023 07:54
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