Skip to content

Commit 145b6ee

Browse files
authored
Wire up ChipIngressInsecureConnection config option (#18947)
* bump chainlink-common * chipingress: add ChipIngressInsecureConnection, ChipIngressForceIPV4 config options * fix lint * chipingress: remove ChipIngressForceIPV4 config option * tidy go get github.com/smartcontractkit/chainlink-common/pkg/chipingress@v0.0.1 go get github.com/smartcontractkit/chainlink-common@INFOPLAT-2627-chip-ingress-config-insecure-connection * go get github.com/smartcontractkit/chainlink-common@main * tidy
1 parent 95bbd90 commit 145b6ee

31 files changed

Lines changed: 99 additions & 23 deletions

.changeset/empty-bees-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink": patch
3+
---
4+
5+
#updated chip-ingress client

core/cmd/shell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func initGlobals(cfgProm config.Prometheus, cfgTracing config.Tracing, cfgTeleme
113113
AuthHeaders: beholderAuthHeaders,
114114
ChipIngressEmitterEnabled: cfgTelemetry.ChipIngressEndpoint() != "",
115115
ChipIngressEmitterGRPCEndpoint: cfgTelemetry.ChipIngressEndpoint(),
116-
ChipIngressInsecureConnection: cfgTelemetry.InsecureConnection(),
116+
ChipIngressInsecureConnection: cfgTelemetry.ChipIngressInsecureConnection(),
117117
LogStreamingEnabled: cfgTelemetry.LogStreamingEnabled(),
118118
}
119119
// note: due to the OTEL specification, all histogram buckets

core/config/docs/core.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,9 @@ EmitterBatchProcessor = true # Default
815815
EmitterExportTimeout = '1s' # Default
816816
# ChipIngressEndpoint enables sending custom messages to CHIP Ingress.
817817
ChipIngressEndpoint = '' # Default
818+
# ChipIngressInsecureConnection disables TLS when connecting to CHIP Ingress.
819+
ChipIngressInsecureConnection = false # Default
820+
818821
# HeartbeatInterval is the interval at which a the application heartbeat is sent to telemetry backends.
819822
HeartbeatInterval = '1s' # Default
820823
# LogStreamingEnabled enables log streaming to the OTel log exporter

core/config/telemetry_config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type Telemetry interface {
1212
EmitterBatchProcessor() bool
1313
EmitterExportTimeout() time.Duration
1414
ChipIngressEndpoint() string
15+
ChipIngressInsecureConnection() bool
1516
HeartbeatInterval() time.Duration
1617
LogStreamingEnabled() bool
1718
}

core/config/toml/types.go

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,17 +2269,18 @@ func (t *Tracing) ValidateConfig() (err error) {
22692269
}
22702270

22712271
type Telemetry struct {
2272-
Enabled *bool
2273-
CACertFile *string
2274-
Endpoint *string
2275-
InsecureConnection *bool
2276-
ResourceAttributes map[string]string `toml:",omitempty"`
2277-
TraceSampleRatio *float64
2278-
EmitterBatchProcessor *bool
2279-
EmitterExportTimeout *commonconfig.Duration
2280-
ChipIngressEndpoint *string
2281-
HeartbeatInterval *commonconfig.Duration
2282-
LogStreamingEnabled *bool
2272+
Enabled *bool
2273+
CACertFile *string
2274+
Endpoint *string
2275+
InsecureConnection *bool
2276+
ResourceAttributes map[string]string `toml:",omitempty"`
2277+
TraceSampleRatio *float64
2278+
EmitterBatchProcessor *bool
2279+
EmitterExportTimeout *commonconfig.Duration
2280+
ChipIngressEndpoint *string
2281+
ChipIngressInsecureConnection *bool
2282+
HeartbeatInterval *commonconfig.Duration
2283+
LogStreamingEnabled *bool
22832284
}
22842285

22852286
func (b *Telemetry) setFrom(f *Telemetry) {
@@ -2310,6 +2311,9 @@ func (b *Telemetry) setFrom(f *Telemetry) {
23102311
if v := f.ChipIngressEndpoint; v != nil {
23112312
b.ChipIngressEndpoint = v
23122313
}
2314+
if v := f.ChipIngressInsecureConnection; v != nil {
2315+
b.ChipIngressInsecureConnection = v
2316+
}
23132317
if v := f.HeartbeatInterval; v != nil {
23142318
b.HeartbeatInterval = v
23152319
}

core/scripts/cre/environment/configs/workflow-don.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
Endpoint = 'host.docker.internal:4317'
7777
ChipIngressEndpoint = 'chip-ingress:50051'
7878
InsecureConnection = true
79+
ChipIngressInsecureConnection = true
7980
TraceSampleRatio = 1
8081
HeartbeatInterval = '30s'
8182
@@ -98,6 +99,7 @@
9899
Enabled = true
99100
Endpoint = 'host.docker.internal:4317'
100101
ChipIngressEndpoint = 'chip-ingress:50051'
102+
ChipIngressInsecureConnection = true
101103
InsecureConnection = true
102104
TraceSampleRatio = 1
103105
HeartbeatInterval = '30s'
@@ -121,6 +123,7 @@
121123
Enabled = true
122124
Endpoint = 'host.docker.internal:4317'
123125
ChipIngressEndpoint = 'chip-ingress:50051'
126+
ChipIngressInsecureConnection = true
124127
InsecureConnection = true
125128
TraceSampleRatio = 1
126129
HeartbeatInterval = '30s'
@@ -144,6 +147,7 @@
144147
Enabled = true
145148
Endpoint = 'host.docker.internal:4317'
146149
ChipIngressEndpoint = 'chip-ingress:50051'
150+
ChipIngressInsecureConnection = true
147151
InsecureConnection = true
148152
TraceSampleRatio = 1
149153
HeartbeatInterval = '30s'
@@ -167,6 +171,7 @@
167171
Enabled = true
168172
Endpoint = 'host.docker.internal:4317'
169173
ChipIngressEndpoint = 'chip-ingress:50051'
174+
ChipIngressInsecureConnection = true
170175
InsecureConnection = true
171176
TraceSampleRatio = 1
172177
HeartbeatInterval = '30s'

core/scripts/cre/environment/configs/workflow-gateway-capabilities-don.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
Enabled = true
7373
Endpoint = 'host.docker.internal:4317'
7474
ChipIngressEndpoint = 'chip-ingress:50051'
75+
ChipIngressInsecureConnection = true
7576
InsecureConnection = true
7677
TraceSampleRatio = 1
7778
HeartbeatInterval = '30s'
@@ -117,6 +118,7 @@
117118
Enabled = true
118119
Endpoint = 'host.docker.internal:4317'
119120
ChipIngressEndpoint = 'chip-ingress:50051'
121+
ChipIngressInsecureConnection = true
120122
InsecureConnection = true
121123
TraceSampleRatio = 1
122124
HeartbeatInterval = '30s'
@@ -160,6 +162,7 @@
160162
Enabled = true
161163
Endpoint = 'host.docker.internal:4317'
162164
ChipIngressEndpoint = 'chip-ingress:50051'
165+
ChipIngressInsecureConnection = true
163166
InsecureConnection = true
164167
TraceSampleRatio = 1
165168
HeartbeatInterval = '30s'

core/scripts/cre/environment/configs/workflow-gateway-don.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
Enabled = true
7272
Endpoint = 'host.docker.internal:4317'
7373
ChipIngressEndpoint = 'chip-ingress:50051'
74+
ChipIngressInsecureConnection = true
7475
InsecureConnection = true
7576
TraceSampleRatio = 1
7677
HeartbeatInterval = '30s'
@@ -114,6 +115,7 @@
114115
Enabled = true
115116
Endpoint = 'host.docker.internal:4317'
116117
ChipIngressEndpoint = 'chip-ingress:50051'
118+
ChipIngressInsecureConnection = true
117119
InsecureConnection = true
118120
TraceSampleRatio = 1
119121
HeartbeatInterval = '30s'

core/services/chainlink/config_telemetry.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ func (b *telemetryConfig) ChipIngressEndpoint() string {
8989
return *b.s.ChipIngressEndpoint
9090
}
9191

92+
func (b *telemetryConfig) ChipIngressInsecureConnection() bool {
93+
if b.s.ChipIngressInsecureConnection == nil {
94+
return false
95+
}
96+
return *b.s.ChipIngressInsecureConnection
97+
}
98+
9299
func (b *telemetryConfig) HeartbeatInterval() time.Duration {
93100
if b.s.HeartbeatInterval == nil || b.s.HeartbeatInterval.Duration() <= 0 {
94101
return defaultHeartbeatInterval

core/services/chainlink/config_telemetry_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,24 @@ func TestTelemetryConfig_ChipIngressEndpoint(t *testing.T) {
199199
}
200200
}
201201

202+
func TestTelemetryConfig_ChipIngressInsecureConnection(t *testing.T) {
203+
tests := []struct {
204+
name string
205+
telemetry toml.Telemetry
206+
expected bool
207+
}{
208+
{"ChipIngressInsecureConnectionTrue", toml.Telemetry{ChipIngressInsecureConnection: ptr(true)}, true},
209+
{"ChipIngressInsecureConnectionFalse", toml.Telemetry{ChipIngressInsecureConnection: ptr(false)}, false},
210+
}
211+
212+
for _, tt := range tests {
213+
t.Run(tt.name, func(t *testing.T) {
214+
tc := telemetryConfig{s: tt.telemetry}
215+
assert.Equal(t, tt.expected, tc.ChipIngressInsecureConnection())
216+
})
217+
}
218+
}
219+
202220
func ptrDuration(d time.Duration) *config.Duration {
203221
return config.MustNewDuration(d)
204222
}

0 commit comments

Comments
 (0)