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

move internal/net/tcp package to internal/net package and support unix domain socket #1010

Conversation

kpango
Copy link
Collaborator

@kpango kpango commented Feb 16, 2021

Signed-off-by: kpango kpango@vdaas.org

Description:

This PR includes 6 changes

  1. merge internal/net/tcp package to internal/net
  2. create new package internal/net/control for socket configuration
  3. unix domain socket support
  4. change helm chart related to 1&2&3
  5. update Go version 1.16 for checking tcp connectivity for future go update
  6. patch update k8s dependencies

Related Issue:

How Has This Been Tested?:

I executed make e2e command and checked all existing test has been passed.

Environment:

  • Go Version: 1.15.8
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.12.3

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@kpango kpango force-pushed the refactor/internal-net-tcp/move-tcp-package-to-net-package-and-support-unix-domain-socket branch from c3d60a7 to d51abb9 Compare February 16, 2021 17:56
@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - add changelog comment
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase master
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@vdaas-ci
Copy link
Collaborator

[WARNING:INTCFG] Changes in interal/config may require you to change Helm charts. Please check.

@codecov
Copy link

codecov bot commented Feb 16, 2021

Codecov Report

Merging #1010 (8a20261) into master (878059d) will decrease coverage by 0.63%.
The diff coverage is 17.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1010      +/-   ##
==========================================
- Coverage   14.90%   14.26%   -0.64%     
==========================================
  Files         497      494       -3     
  Lines       28400    28284     -116     
==========================================
- Hits         4232     4034     -198     
- Misses      23910    24000      +90     
+ Partials      258      250       -8     
Impacted Files Coverage Δ
hack/helm/schema/gen/main.go 0.00% <0.00%> (ø)
internal/client/v1/client/discoverer/discover.go 0.00% <0.00%> (ø)
internal/config/cassandra.go 0.00% <0.00%> (ø)
internal/config/client.go 0.00% <0.00%> (ø)
internal/config/discoverer.go 0.00% <0.00%> (ø)
internal/config/grpc.go 0.00% <0.00%> (ø)
internal/config/meta.go 0.00% <0.00%> (ø)
internal/config/redis.go 0.00% <0.00%> (ø)
internal/config/server.go 0.00% <0.00%> (ø)
internal/db/kvs/redis/option.go 90.39% <ø> (ø)
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 878059d...4d93b47. Read the comment docs.

@kpango kpango force-pushed the refactor/internal-net-tcp/move-tcp-package-to-net-package-and-support-unix-domain-socket branch from d51abb9 to a6a1398 Compare February 17, 2021 08:59
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
charts/vald/README.md Show resolved Hide resolved
@kpango kpango force-pushed the refactor/internal-net-tcp/move-tcp-package-to-net-package-and-support-unix-domain-socket branch 3 times, most recently from ff60577 to 1b49bc2 Compare February 18, 2021 05:04
…x domain socket

Signed-off-by: kpango <kpango@vdaas.org>
@kpango kpango force-pushed the refactor/internal-net-tcp/move-tcp-package-to-net-package-and-support-unix-domain-socket branch 2 times, most recently from 41dde2c to eed9588 Compare February 18, 2021 06:03
hack/helm/schema/gen/main.go Outdated Show resolved Hide resolved
internal/net/dialer.go Show resolved Hide resolved
internal/net/dialer.go Show resolved Hide resolved
internal/net/net.go Show resolved Hide resolved
internal/net/dialer_test.go Show resolved Hide resolved
internal/net/control/control.go Show resolved Hide resolved
internal/net/grpc/option.go Show resolved Hide resolved
internal/db/rdb/mysql/mysql.go Outdated Show resolved Hide resolved
Signed-off-by: kpango <kpango@vdaas.org>
@kpango kpango force-pushed the refactor/internal-net-tcp/move-tcp-package-to-net-package-and-support-unix-domain-socket branch from eed9588 to ec820cb Compare February 18, 2021 06:28
internal/net/net.go Show resolved Hide resolved
localHost = "localhost"
defaultPort = 80

Unknown NetworkType = iota
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
exported const Unknown should have comment (or a comment on this block) or be unexported (golint)

internal/net/net.go Show resolved Hide resolved
internal/net/net.go Show resolved Hide resolved
internal/net/dialer.go Show resolved Hide resolved
internal/net/dialer_test.go Show resolved Hide resolved
internal/net/dialer_test.go Show resolved Hide resolved
internal/net/net_test.go Show resolved Hide resolved
internal/net/dialer_test.go Show resolved Hide resolved
internal/net/option_test.go Show resolved Hide resolved
@kpango kpango changed the title [WIP] move internal/net/tcp package to internal/net package and support unix domain socket move internal/net/tcp package to internal/net package and support unix domain socket Feb 18, 2021
@kpango
Copy link
Collaborator Author

kpango commented Feb 18, 2021

@vdaas/core @vdaas/sre @vdaas/set This pr is now ready for review, please review this PR

Signed-off-by: kpango <kpango@vdaas.org>
@kpango kpango requested review from a team February 18, 2021 07:52
@kpango kpango requested review from rinx, kevindiu, vankichi, datelier and hlts2 and removed request for a team February 18, 2021 07:52
internal/net/option_test.go Show resolved Hide resolved
internal/net/option_test.go Show resolved Hide resolved
internal/net/dialer.go Show resolved Hide resolved
internal/net/dialer.go Show resolved Hide resolved
internal/net/dialer.go Show resolved Hide resolved
internal/servers/server/option_test.go Show resolved Hide resolved
internal/servers/server/option_test.go Show resolved Hide resolved
internal/servers/server/option_test.go Show resolved Hide resolved
internal/servers/server/server.go Show resolved Hide resolved
internal/db/rdb/mysql/mysql.go Show resolved Hide resolved
internal/db/rdb/mysql/mysql.go Outdated Show resolved Hide resolved
internal/net/net_test.go Outdated Show resolved Hide resolved
Signed-off-by: kpango <kpango@vdaas.org>
internal/servers/server/option.go Show resolved Hide resolved
internal/servers/server/option.go Show resolved Hide resolved
internal/servers/server/option.go Show resolved Hide resolved
internal/servers/server/option.go Show resolved Hide resolved
internal/servers/server/option.go Show resolved Hide resolved
internal/net/grpc/pool/pool.go Show resolved Hide resolved
Signed-off-by: kpango <kpango@vdaas.org>
@kpango kpango force-pushed the refactor/internal-net-tcp/move-tcp-package-to-net-package-and-support-unix-domain-socket branch from 8a20261 to 3a0646b Compare February 19, 2021 02:58
@@ -830,7 +830,7 @@ func TestWithDialer(t *testing.T) {
// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
der tcp.Dialer
der net.Dialer
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
der is unused (structcheck)

}
}

func (ctrl *control) GetControl() func(network, addr string, c syscall.RawConn) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
Function 'GetControl' is too long (78 > 60) (funlen)

Copy link
Contributor

@vankichi vankichi left a comment

Choose a reason for hiding this comment

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

Thx ! Gread Job!
LGTM

Copy link
Contributor

@rinx rinx left a comment

Choose a reason for hiding this comment

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

checked.

…-to-net-package-and-support-unix-domain-socket
@kpango kpango merged commit 27752bd into master Feb 19, 2021
@kpango kpango deleted the refactor/internal-net-tcp/move-tcp-package-to-net-package-and-support-unix-domain-socket branch February 19, 2021 04:10
//

// Package control provides network socket option
package control
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
package should be control_test instead of control (testpackage)

@vdaas-ci vdaas-ci mentioned this pull request Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants