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

fix(config): fix default booleans not being overriden by env vars #1112

Merged
merged 2 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Deprecated both `db.migrations.path` and `db.migrations_path` [#1096](https://github.com/flipt-io/flipt/pull/1096)

### Fixed

- Propogating OpenTelemetry spans through Flipt [#1112](https://github.com/flipt-io/flipt/pull/1112)

## [v1.13.0](https://github.com/markphelps/flipt/releases/tag/v1.13.0) - 2022-10-17

### Added
Expand Down
3 changes: 2 additions & 1 deletion cmd/flipt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import (
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/jaeger"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
tracesdk "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
Expand Down Expand Up @@ -462,7 +463,7 @@ func run(ctx context.Context, logger *zap.Logger) error {
}

otel.SetTracerProvider(tracingProvider)

otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
{
// forward internal gRPC logging to zap
grpcLogLevel, err := zapcore.ParseLevel(cfg.Log.GRPCLevel)
Expand Down
1 change: 1 addition & 0 deletions internal/config/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type CacheConfig struct {

func (c *CacheConfig) setDefaults(v *viper.Viper) (warnings []string) {
v.SetDefault("cache", map[string]any{
"enabled": false,
"backend": CacheMemory,
"ttl": 1 * time.Minute,
"redis": map[string]any{
Expand Down
1 change: 1 addition & 0 deletions internal/config/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type CorsConfig struct {

func (c *CorsConfig) setDefaults(v *viper.Viper) []string {
v.SetDefault("cors", map[string]any{
"enabled": false,
"allowed_origins": "*",
})

Expand Down
7 changes: 4 additions & 3 deletions internal/config/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ type JaegerTracingConfig struct {
// TracingConfig contains fields, which configure tracing telemetry
// output destinations.
type TracingConfig struct {
Jaeger JaegerTracingConfig `json:"jaeger,omitempty"`
Jaeger JaegerTracingConfig `json:"jaeger,omitempty" mapstructure:"jaeger"`
}

func (c *TracingConfig) setDefaults(v *viper.Viper) []string {
v.SetDefault("tracing", map[string]any{
"jaeger": map[string]any{
"host": "localhost",
"port": 6831,
"enabled": false,
"host": "localhost",
"port": 6831,
},
})

Expand Down