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

[patch] Bug fix on StreamGetObject API and DNS cache expiration / refactor net connection #986

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f4e0ad2
refactor net connection
kpango Feb 5, 2021
47cef3f
close unclosed channel
kpango Feb 5, 2021
e659767
fix
kpango Feb 5, 2021
1c68e4e
fix failing test & add insecure option for user
kpango Feb 5, 2021
58d6c07
bugfix
kpango Feb 5, 2021
ccb25cb
add custom connection dialer to k8s
kpango Feb 5, 2021
8abb1a0
fix
kpango Feb 5, 2021
ab422a4
fix e2e test conparator for v1 API
kpango Feb 6, 2021
91c5c20
fix
kpango Feb 6, 2021
f63c78d
fix
kpango Feb 6, 2021
b480b95
fix useless schema annotation for helm charts
kpango Feb 8, 2021
0c0bf84
Merge branch 'master' into refactor/internal-net/more-controllable-tc…
kpango Feb 8, 2021
44f6197
Merge branch 'master' into refactor/internal-net/more-controllable-tc…
kpango Feb 8, 2021
02f575a
change CreateIndex precondition failure log level to Warn from Error …
kpango Feb 8, 2021
7de5261
Merge branch 'refactor/internal-net/more-controllable-tcp-handshake-a…
kpango Feb 8, 2021
5664078
Merge branch 'master' into refactor/internal-net/more-controllable-tc…
kpango Feb 8, 2021
46e67d1
Merge branch 'master' into refactor/internal-net/more-controllable-tc…
kpango Feb 9, 2021
52cb14e
Merge branch 'master' into refactor/internal-net/more-controllable-tc…
kpango Feb 9, 2021
b5ab14e
add generated test & update helm schema
kpango Feb 9, 2021
22987df
update golang version to 1.15.8 inclueds cgo&net/http bugfixes
kpango Feb 9, 2021
2ea7cff
fix incorrect helm resource path
kpango Feb 9, 2021
c2c6b4b
bugfix: add priorityClass namespace to each gateways
kpango Feb 9, 2021
fc4805b
extend wait duration for e2e deploy test
kpango Feb 9, 2021
2d43482
fix pointed out from vankichi
kpango Feb 9, 2021
f37f012
fix failed test
kpango Feb 9, 2021
d0c1eed
format
kpango Feb 9, 2021
f2385ee
Update internal/tls/option_test.go
kpango Feb 9, 2021
791896d
Merge branch 'master' into refactor/internal-net/more-controllable-tc…
kpango Feb 9, 2021
06aa294
fix failed test
kpango Feb 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions charts/vald/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ tls:
cert: {{ default .default.tls.cert .Values.tls.cert | quote }}
key: {{ default .default.tls.key .Values.tls.key | quote }}
ca: {{ default .default.tls.ca .Values.tls.ca | quote }}
insecure_skip_verify: {{ default .default.tls.insecure_skip_verify .Values.tls.insecure_skip_verify }}
{{- else }}
{{- toYaml .default.tls | nindent 2 }}
{{- end }}
Expand Down Expand Up @@ -551,6 +552,7 @@ dial_option:
cert: {{ default .default.dial_option.tcp.tls.cert .Values.dial_option.tcp.tls.cert | quote }}
key: {{ default .default.dial_option.tcp.tls.key .Values.dial_option.tcp.tls.key | quote }}
ca: {{ default .default.dial_option.tcp.tls.ca .Values.dial_option.tcp.tls.ca | quote }}
insecure_skip_verify: {{ default .default.dial_option.tcp.tls.insecure_skip_verify .Values.dial_option.tcp.tls.insecure_skip_verify }}
{{- else }}
{{- toYaml .default.dial_option.tcp.tls | nindent 6 }}
{{- end }}
Expand All @@ -574,6 +576,7 @@ tls:
cert: {{ default .default.tls.cert .Values.tls.cert | quote }}
key: {{ default .default.tls.key .Values.tls.key | quote }}
ca: {{ default .default.tls.ca .Values.tls.ca | quote }}
insecure_skip_verify: {{ default .default.tls.insecure_skip_verify .Values.tls.insecure_skip_verify }}
{{- else }}
{{- toYaml .default.tls | nindent 2 }}
{{- end }}
Expand Down
173 changes: 139 additions & 34 deletions charts/vald/values.yaml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.15
replace (
cloud.google.com/go => cloud.google.com/go v0.76.0
github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible
github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.37.3
github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.37.6
github.com/boltdb/bolt => github.com/boltdb/bolt v1.3.1
github.com/chzyer/logex => github.com/chzyer/logex v1.1.11-0.20170329064859-445be9e134b2
github.com/coreos/etcd => go.etcd.io/etcd v3.3.25+incompatible
Expand All @@ -21,7 +21,7 @@ replace (
github.com/gophercloud/gophercloud => github.com/gophercloud/gophercloud v0.15.0
github.com/gorilla/websocket => github.com/gorilla/websocket v1.4.2
github.com/hailocab/go-hostpool => github.com/monzo/go-hostpool v0.0.0-20200724120130-287edbb29340
github.com/klauspost/compress => github.com/klauspost/compress v1.11.8-0.20210203154158-6c96f3e2a592
github.com/klauspost/compress => github.com/klauspost/compress v1.11.8-0.20210205131735-b5cd74455ec9
github.com/tensorflow/tensorflow => github.com/tensorflow/tensorflow v2.1.2+incompatible
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
google.golang.org/grpc => google.golang.org/grpc v1.35.0
Expand All @@ -45,7 +45,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.1
github.com/envoyproxy/protoc-gen-validate v0.1.0
github.com/fsnotify/fsnotify v1.4.9
github.com/go-redis/redis/v8 v8.4.11
github.com/go-redis/redis/v8 v8.5.0
github.com/go-sql-driver/mysql v1.5.0
github.com/gocql/gocql v0.0.0-20200131111108-92af2e088537
github.com/gocraft/dbr/v2 v2.7.1
Expand Down Expand Up @@ -78,8 +78,8 @@ require (
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
gonum.org/v1/hdf5 v0.0.0-20200504100616-496fefe91614
gonum.org/v1/plot v0.8.1
google.golang.org/api v0.38.0
google.golang.org/genproto v0.0.0-20210203152818-3206188e46ba
google.golang.org/api v0.39.0
google.golang.org/genproto v0.0.0-20210204154452-deb828366460
google.golang.org/grpc v1.35.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.2
Expand Down
29 changes: 16 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws/aws-sdk-go v1.37.3 h1:1f0groABc4AuapskpHf6EBRaG2tqw0Sx3ebCMwfp1Ys=
github.com/aws/aws-sdk-go v1.37.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.37.6 h1:SWYjRvyZw6DJc3pkZfRWVRD/5wiTDuwOkyb89AAkEBY=
github.com/aws/aws-sdk-go v1.37.6/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down Expand Up @@ -164,8 +164,8 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4=
github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v8 v8.4.11 h1:t2lToev01VTrqYQcv+QFbxtGgcf64K+VUMgf9Ap6A/E=
github.com/go-redis/redis/v8 v8.4.11/go.mod h1:d5yY/TlkQyYBSBHnXUmnf1OrHbyQere5JV4dLKwvXmo=
github.com/go-redis/redis/v8 v8.5.0 h1:L3r1Q3I5WOUdXZGCP6g44EruKh0u3n6co5Hl5xWkdGA=
github.com/go-redis/redis/v8 v8.5.0/go.mod h1:YmEcgBDttjnkbMzDAhDtQxY9yVA7jMN6PCR5HeMvqFE=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
Expand Down Expand Up @@ -296,8 +296,8 @@ github.com/jung-kurt/gofpdf v1.16.2 h1:jgbatWHfRlPYiK85qgevsZTHviWXKwB1TTiKdz5Pt
github.com/jung-kurt/gofpdf v1.16.2/go.mod h1:1hl7y57EsiPAkLbOwzpzqgx1A30nQCk/YmFV8S2vmK0=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.11.8-0.20210203154158-6c96f3e2a592 h1:NmvlF3t5svvdvoaViVoVWQf1Lj1yZK/uIsoAFUmnlEA=
github.com/klauspost/compress v1.11.8-0.20210203154158-6c96f3e2a592/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.8-0.20210205131735-b5cd74455ec9 h1:OAhCmjDqWViQo/ZB+YeKShJ4DFrkmVRWRUGgzzJLs28=
github.com/klauspost/compress v1.11.8-0.20210205131735-b5cd74455ec9/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -379,17 +379,17 @@ github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M=
github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4=
github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.10.4 h1:NiTx7EEvBzu9sFOD1zORteLSt3o8gnlvZZwSE9TnY9U=
github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ=
github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ=
github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
Expand Down Expand Up @@ -678,6 +678,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -737,6 +738,7 @@ golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roY
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
Expand Down Expand Up @@ -772,8 +774,9 @@ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.38.0 h1:vDyWk6eup8eQAidaZ31sNWIn8tZEL8qpbtGkBD4ytQo=
google.golang.org/api v0.38.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.39.0 h1:zHCTXf0NeDdKTgcSQpT+ZflWAqHsEp1GmdpxW09f3YM=
google.golang.org/api v0.39.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
Expand Down Expand Up @@ -807,8 +810,8 @@ google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210202153253-cf70463f6119/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210203152818-3206188e46ba h1:np3A9jnmE/eMtrOwwvUycmQ1XoLyj5nqZ41bAyYLqJ0=
google.golang.org/genproto v0.0.0-20210203152818-3206188e46ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210204154452-deb828366460 h1:pvsg2TgyP8bWrYqyL10tbNHu5KypD5DWJPrCjaTkwZA=
google.golang.org/genproto v0.0.0-20210204154452-deb828366460/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
Expand Down
8 changes: 6 additions & 2 deletions internal/config/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
// Package config providers configuration type and load configuration logic
package config

import "fmt"
import (
"strconv"

"github.com/vdaas/vald/internal/net"
)

type Meta struct {
Host string `json:"host" yaml:"host"`
Expand All @@ -39,7 +43,7 @@ func (m *Meta) Bind() *Meta {
m.Client = newGRPCClientConfig()
}
if len(m.Host) != 0 {
m.Client.Addrs = append(m.Client.Addrs, fmt.Sprintf("%s:%d", m.Host, m.Port))
m.Client.Addrs = append(m.Client.Addrs, net.JoinHostPort(m.Host, strconv.FormatInt(int64(m.Port), 10)))
}
return m
}
3 changes: 3 additions & 0 deletions internal/config/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type TCP struct {
type Dialer struct {
Timeout string `yaml:"timeout" json:"timeout"`
KeepAlive string `yaml:"keep_alive" json:"keep_alive"`
FallbackDelay string `yaml:"fallback_delay" json:"fallback_delay"`
DualStackEnabled bool `yaml:"dual_stack_enabled" json:"dual_stack_enabled"`
}

Expand All @@ -50,6 +51,7 @@ func (d *DNS) Bind() *DNS {
func (d *Dialer) Bind() *Dialer {
d.Timeout = GetActualValue(d.Timeout)
d.KeepAlive = GetActualValue(d.KeepAlive)
d.FallbackDelay = GetActualValue(d.FallbackDelay)
return d
}

Expand Down Expand Up @@ -84,6 +86,7 @@ func (t *TCP) Opts() []tcp.DialerOption {
opts = append(opts,
tcp.WithDialerKeepAlive(t.Dialer.KeepAlive),
tcp.WithDialerTimeout(t.Dialer.Timeout),
tcp.WithDialerFallbackDelay(t.Dialer.FallbackDelay),
)
if t.Dialer.DualStackEnabled {
opts = append(opts,
Expand Down
4 changes: 4 additions & 0 deletions internal/config/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type TLS struct {

// CA represent the CA certificate environment variable key used to start server.
CA string `yaml:"ca" json:"ca"`

// InsecureSkipVerify represent enable/disable skip SSL certificate verification
InsecureSkipVerify bool `yaml:"insecure_skip_verify" json:"insecure_skip_verify"`
}

// Bind returns TLS object whose every value except Enabled is field value of environment value.
Expand All @@ -48,5 +51,6 @@ func (t *TLS) Opts() []tls.Option {
tls.WithCa(t.CA),
tls.WithCert(t.Cert),
tls.WithKey(t.Key),
tls.WithInsecureSkipVerify(t.InsecureSkipVerify),
}
}
2 changes: 2 additions & 0 deletions internal/config/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func TestTLS_Opts(t *testing.T) {
tls.WithCa("ca"),
tls.WithCert("cert"),
tls.WithKey("key"),
tls.WithInsecureSkipVerify(false),
},
},
},
Expand All @@ -189,6 +190,7 @@ func TestTLS_Opts(t *testing.T) {
tls.WithCa(""),
tls.WithCert(""),
tls.WithKey(""),
tls.WithInsecureSkipVerify(false),
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions internal/db/nosql/cassandra/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/scylladb/gocqlx/qb"
"github.com/vdaas/vald/internal/errors"
"github.com/vdaas/vald/internal/log"
"github.com/vdaas/vald/internal/net/tcp"
)

var (
Expand Down Expand Up @@ -156,6 +157,7 @@ type (
connectObserver ConnectObserver
frameHeaderObserver FrameHeaderObserver
defaultIdempotence bool
rawDialer tcp.Dialer
dialer gocql.Dialer
writeCoalesceWaitTime time.Duration

Expand Down Expand Up @@ -305,6 +307,9 @@ func (c *client) Open(ctx context.Context) (err error) {
log.Debugf("failed to create session %#v", c)
return errors.ErrCassandraFailedToCreateSession(err, c.hosts, c.port, c.cqlVersion)
}
if c.rawDialer != nil {
c.rawDialer.StartDialerCache(ctx)
}
return nil
}

Expand Down
5 changes: 5 additions & 0 deletions internal/db/nosql/cassandra/cassandra_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ func (dm *DialerMock) DialContext(ctx context.Context, network, addr string) (ne
return dm.DialContextFunc(ctx, network, addr)
}

func (dm *DialerMock) GetDialer() func(ctx context.Context, network, addr string) (net.Conn, error) {
return dm.DialContextFunc
}
func (dm *DialerMock) StartDialerCache(ctx context.Context) {}

func TestMockClusterConfig_CreateSession(t *testing.T) {
t.Parallel()
type fields struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/db/nosql/cassandra/conviction.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ func (c *convictionPolicy) AddFailure(err error, host *gocql.HostInfo) bool {

// Reset clears the conviction state.
func (c *convictionPolicy) Reset(host *gocql.HostInfo) {
log.Info("cassandra host %s reset detected\t%s", host.HostnameAndPort(), host.String())
log.Infof("cassandra host %s reset detected\t%s", host.HostnameAndPort(), host.String())
}
4 changes: 3 additions & 1 deletion internal/db/nosql/cassandra/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/gocql/gocql"
"github.com/vdaas/vald/internal/errors"
"github.com/vdaas/vald/internal/net/tcp"
"github.com/vdaas/vald/internal/timeutil"
)

Expand Down Expand Up @@ -79,11 +80,12 @@ func WithHosts(hosts ...string) Option {
}

// WithDialer returns the option to set the dialer.
func WithDialer(der gocql.Dialer) Option {
func WithDialer(der tcp.Dialer) Option {
return func(c *client) error {
if der == nil {
return errors.NewErrInvalidOption("dialer", der)
}
c.rawDialer = der
c.dialer = der
return nil
}
Expand Down
6 changes: 4 additions & 2 deletions internal/db/nosql/cassandra/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"github.com/gocql/gocql"
"github.com/vdaas/vald/internal/errors"
"github.com/vdaas/vald/internal/net/tcp"
"github.com/vdaas/vald/internal/test/comparator"
"go.uber.org/goleak"
)
Expand Down Expand Up @@ -147,7 +148,7 @@ func TestWithHosts(t *testing.T) {
func TestWithDialer(t *testing.T) {
type T = client
type args struct {
der gocql.Dialer
der tcp.Dialer
}
type want struct {
obj *T
Expand Down Expand Up @@ -181,7 +182,8 @@ func TestWithDialer(t *testing.T) {
},
want: want{
obj: &T{
dialer: dm,
dialer: dm,
rawDialer: dm,
},
},
}
Expand Down
6 changes: 6 additions & 0 deletions internal/net/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/vdaas/vald/internal/errors"
"github.com/vdaas/vald/internal/log"
"github.com/vdaas/vald/internal/net/grpc/pool"
"github.com/vdaas/vald/internal/net/tcp"
"github.com/vdaas/vald/internal/observability/trace"
"github.com/vdaas/vald/internal/safety"
"github.com/vdaas/vald/internal/singleflight"
Expand Down Expand Up @@ -93,6 +94,7 @@ type gRPCClient struct {
conns grpcConns
hcDur time.Duration
prDur time.Duration
dialer tcp.Dialer
enablePoolRebalance bool
resolveDNS bool
dopts []DialOption
Expand Down Expand Up @@ -138,6 +140,10 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error,
return nil, errors.ErrGRPCTargetAddrNotFound
}

if g.dialer != nil {
g.dialer.StartDialerCache(ctx)
}

ech := make(chan error, len(addrs))
for _, addr := range addrs {
if len(addr) != 0 {
Expand Down
1 change: 1 addition & 0 deletions internal/net/grpc/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ func WithKeepaliveParams(t, to string, permitWithoutStream bool) Option {
func WithDialer(der tcp.Dialer) Option {
return func(g *gRPCClient) {
if der != nil {
g.dialer = der
g.dopts = append(g.dopts,
grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {
return der.GetDialer()(ctx, "tcp", addr)
Expand Down
Loading