Skip to content

Commit

Permalink
InsecureConnection can be used in prod builds (#14992)
Browse files Browse the repository at this point in the history
* InsecureConnection can be used in prod builds

* Update core/config/toml/types.go

Co-authored-by: Jordan Krage <[email protected]>

---------

Co-authored-by: Jordan Krage <[email protected]>
  • Loading branch information
patrickhuie19 and jmank88 authored Oct 29, 2024
1 parent 883d993 commit 2f2a529
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/config/toml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1693,11 +1693,8 @@ func (b *Telemetry) ValidateConfig() (err error) {
if b.Endpoint == nil || *b.Endpoint == "" {
err = multierr.Append(err, configutils.ErrMissing{Name: "Endpoint", Msg: "must be set when Telemetry is enabled"})
}
if b.InsecureConnection != nil && *b.InsecureConnection {
if build.IsProd() {
err = multierr.Append(err, configutils.ErrInvalid{Name: "InsecureConnection", Value: true, Msg: "cannot be used in production builds"})
}
} else {
if b.InsecureConnection == nil || !*b.InsecureConnection {
// InsecureConnection is set and false
if b.CACertFile == nil || *b.CACertFile == "" {
err = multierr.Append(err, configutils.ErrMissing{Name: "CACertFile", Msg: "must be set, unless InsecureConnection is used"})
}
Expand Down

0 comments on commit 2f2a529

Please sign in to comment.