From 182712b22364a2d01ea80ff61ca6b77d7faff9e6 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 10:24:59 +0100 Subject: [PATCH 01/10] fix tracing config --- accounts/pkg/config/config.go | 6 +++--- accounts/pkg/config/parser/parse.go | 11 +++++++++++ .../monitoring_tracing/docker-compose-additions.yml | 1 + .../monitoring_tracing/docker-compose-additions.yml | 1 + .../monitoring_tracing/docker-compose-additions.yml | 1 + .../monitoring_tracing/docker-compose-additions.yml | 1 + .../monitoring_tracing/docker-compose-additions.yml | 1 + .../monitoring_tracing/docker-compose-additions.yml | 1 + .../monitoring_tracing/docker-compose-additions.yml | 1 + glauth/pkg/config/config.go | 6 +++--- glauth/pkg/config/parser/parse.go | 11 +++++++++++ graph-explorer/pkg/config/config.go | 6 +++--- graph-explorer/pkg/config/parser/parse.go | 11 +++++++++++ graph/pkg/config/config.go | 6 +++--- graph/pkg/config/parser/parse.go | 11 +++++++++++ idp/pkg/config/config.go | 6 +++--- idp/pkg/config/parser/parse.go | 11 +++++++++++ ocis-pkg/tracing/tracing.go | 4 ++-- ocs/pkg/config/config.go | 6 +++--- ocs/pkg/config/parser/parse.go | 11 +++++++++++ proxy/pkg/config/config.go | 6 +++--- proxy/pkg/config/parser/parse.go | 11 +++++++++++ settings/pkg/config/config.go | 6 +++--- settings/pkg/config/parser/parse.go | 11 +++++++++++ store/pkg/config/config.go | 6 +++--- store/pkg/config/parser/parse.go | 11 +++++++++++ thumbnails/pkg/config/config.go | 6 +++--- thumbnails/pkg/config/parser/parse.go | 11 +++++++++++ web/pkg/config/config.go | 6 +++--- web/pkg/config/parser/parse.go | 11 +++++++++++ webdav/pkg/config/config.go | 6 +++--- webdav/pkg/config/parser/parse.go | 11 +++++++++++ 32 files changed, 177 insertions(+), 38 deletions(-) diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index e210736161..305fa5e219 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` GRPC GRPC `ocisConfig:"grpc"` diff --git a/accounts/pkg/config/parser/parse.go b/accounts/pkg/config/parser/parse.go index dee2dc13b7..92cba79b5f 100644 --- a/accounts/pkg/config/parser/parse.go +++ b/accounts/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/deployments/examples/oc10_ocis_parallel/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/oc10_ocis_parallel/monitoring_tracing/docker-compose-additions.yml index a077eda65d..8abdf4e838 100644 --- a/deployments/examples/oc10_ocis_parallel/monitoring_tracing/docker-compose-additions.yml +++ b/deployments/examples/oc10_ocis_parallel/monitoring_tracing/docker-compose-additions.yml @@ -6,6 +6,7 @@ services: environment: # tracing OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_TYPE: "jaeger" OCIS_TRACING_ENDPOINT: jaeger-agent:6831 # metrics APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165 diff --git a/deployments/examples/ocis_hello/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_hello/monitoring_tracing/docker-compose-additions.yml index a077eda65d..8abdf4e838 100644 --- a/deployments/examples/ocis_hello/monitoring_tracing/docker-compose-additions.yml +++ b/deployments/examples/ocis_hello/monitoring_tracing/docker-compose-additions.yml @@ -6,6 +6,7 @@ services: environment: # tracing OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_TYPE: "jaeger" OCIS_TRACING_ENDPOINT: jaeger-agent:6831 # metrics APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165 diff --git a/deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml index a077eda65d..8abdf4e838 100644 --- a/deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml +++ b/deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml @@ -6,6 +6,7 @@ services: environment: # tracing OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_TYPE: "jaeger" OCIS_TRACING_ENDPOINT: jaeger-agent:6831 # metrics APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165 diff --git a/deployments/examples/ocis_ldap/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_ldap/monitoring_tracing/docker-compose-additions.yml index a077eda65d..8abdf4e838 100644 --- a/deployments/examples/ocis_ldap/monitoring_tracing/docker-compose-additions.yml +++ b/deployments/examples/ocis_ldap/monitoring_tracing/docker-compose-additions.yml @@ -6,6 +6,7 @@ services: environment: # tracing OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_TYPE: "jaeger" OCIS_TRACING_ENDPOINT: jaeger-agent:6831 # metrics APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165 diff --git a/deployments/examples/ocis_s3/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_s3/monitoring_tracing/docker-compose-additions.yml index a077eda65d..8abdf4e838 100644 --- a/deployments/examples/ocis_s3/monitoring_tracing/docker-compose-additions.yml +++ b/deployments/examples/ocis_s3/monitoring_tracing/docker-compose-additions.yml @@ -6,6 +6,7 @@ services: environment: # tracing OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_TYPE: "jaeger" OCIS_TRACING_ENDPOINT: jaeger-agent:6831 # metrics APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165 diff --git a/deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml index a077eda65d..8abdf4e838 100644 --- a/deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml +++ b/deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml @@ -6,6 +6,7 @@ services: environment: # tracing OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_TYPE: "jaeger" OCIS_TRACING_ENDPOINT: jaeger-agent:6831 # metrics APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165 diff --git a/deployments/examples/ocis_wopi/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_wopi/monitoring_tracing/docker-compose-additions.yml index a077eda65d..8abdf4e838 100644 --- a/deployments/examples/ocis_wopi/monitoring_tracing/docker-compose-additions.yml +++ b/deployments/examples/ocis_wopi/monitoring_tracing/docker-compose-additions.yml @@ -6,6 +6,7 @@ services: environment: # tracing OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_TYPE: "jaeger" OCIS_TRACING_ENDPOINT: jaeger-agent:6831 # metrics APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165 diff --git a/glauth/pkg/config/config.go b/glauth/pkg/config/config.go index 3d687319cd..7de14cf687 100644 --- a/glauth/pkg/config/config.go +++ b/glauth/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` Ldap Ldap `ocisConfig:"ldap"` Ldaps Ldaps `ocisConfig:"ldaps"` diff --git a/glauth/pkg/config/parser/parse.go b/glauth/pkg/config/parser/parse.go index b2a18b2a90..540bf80d3e 100644 --- a/glauth/pkg/config/parser/parse.go +++ b/glauth/pkg/config/parser/parse.go @@ -27,6 +27,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/graph-explorer/pkg/config/config.go b/graph-explorer/pkg/config/config.go index d84c239fde..2d70fd664a 100644 --- a/graph-explorer/pkg/config/config.go +++ b/graph-explorer/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/graph-explorer/pkg/config/parser/parse.go b/graph-explorer/pkg/config/parser/parse.go index be113e4598..cb463eecf8 100644 --- a/graph-explorer/pkg/config/parser/parse.go +++ b/graph-explorer/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/graph/pkg/config/config.go b/graph/pkg/config/config.go index 523bcfdb04..d094cf54f9 100644 --- a/graph/pkg/config/config.go +++ b/graph/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/graph/pkg/config/parser/parse.go b/graph/pkg/config/parser/parse.go index 8856821543..bfb1302bbf 100644 --- a/graph/pkg/config/parser/parse.go +++ b/graph/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/idp/pkg/config/config.go b/idp/pkg/config/config.go index 7c16b9b1bf..4e5e4b0d13 100644 --- a/idp/pkg/config/config.go +++ b/idp/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/idp/pkg/config/parser/parse.go b/idp/pkg/config/parser/parse.go index de98f42d68..faa1ea1665 100644 --- a/idp/pkg/config/parser/parse.go +++ b/idp/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/ocis-pkg/tracing/tracing.go b/ocis-pkg/tracing/tracing.go index f12664b9dd..7d76e63524 100644 --- a/ocis-pkg/tracing/tracing.go +++ b/ocis-pkg/tracing/tracing.go @@ -21,7 +21,7 @@ var Propagator = propagation.NewCompositeTextMapPropagator( // GetTraceProvider returns a configured open-telemetry trace provider. func GetTraceProvider(agentEndpoint, collectorEndpoint, serviceName, traceType string) (*sdktrace.TracerProvider, error) { switch t := traceType; t { - case "jaeger": + case "", "jaeger": var ( exp *jaeger.Exporter err error @@ -66,7 +66,7 @@ func GetTraceProvider(agentEndpoint, collectorEndpoint, serviceName, traceType s case "zipkin": fallthrough default: - return nil, fmt.Errorf("invalid trace configuration") + return nil, fmt.Errorf("unknown trace type %s", traceType) } } diff --git a/ocs/pkg/config/config.go b/ocs/pkg/config/config.go index bfad75d860..2c9693adca 100644 --- a/ocs/pkg/config/config.go +++ b/ocs/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/ocs/pkg/config/parser/parse.go b/ocs/pkg/config/parser/parse.go index 9a50e535b3..48f8e51a2d 100644 --- a/ocs/pkg/config/parser/parse.go +++ b/ocs/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/proxy/pkg/config/config.go b/proxy/pkg/config/config.go index c525421e80..277b7dff2d 100644 --- a/proxy/pkg/config/config.go +++ b/proxy/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/proxy/pkg/config/parser/parse.go b/proxy/pkg/config/parser/parse.go index 65921b31cf..493ed0bca6 100644 --- a/proxy/pkg/config/parser/parse.go +++ b/proxy/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/settings/pkg/config/config.go b/settings/pkg/config/config.go index fce3b34d5f..8e9e5f1eff 100644 --- a/settings/pkg/config/config.go +++ b/settings/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` GRPC GRPC `ocisConfig:"grpc"` diff --git a/settings/pkg/config/parser/parse.go b/settings/pkg/config/parser/parse.go index 551d44108c..5ceb37a1ff 100644 --- a/settings/pkg/config/parser/parse.go +++ b/settings/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/store/pkg/config/config.go b/store/pkg/config/config.go index 46855d55da..585fd7424a 100644 --- a/store/pkg/config/config.go +++ b/store/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` GRPC GRPC `ocisConfig:"grpc"` diff --git a/store/pkg/config/parser/parse.go b/store/pkg/config/parser/parse.go index f3789eecbf..29e2efa292 100644 --- a/store/pkg/config/parser/parse.go +++ b/store/pkg/config/parser/parse.go @@ -27,6 +27,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/thumbnails/pkg/config/config.go b/thumbnails/pkg/config/config.go index 8ab2d5bfd2..527f94a50e 100644 --- a/thumbnails/pkg/config/config.go +++ b/thumbnails/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` GRPC GRPC `ocisConfig:"grpc"` diff --git a/thumbnails/pkg/config/parser/parse.go b/thumbnails/pkg/config/parser/parse.go index 3591aea8a5..e621f53d07 100644 --- a/thumbnails/pkg/config/parser/parse.go +++ b/thumbnails/pkg/config/parser/parse.go @@ -27,6 +27,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/web/pkg/config/config.go b/web/pkg/config/config.go index 13f67adfef..d403136e18 100644 --- a/web/pkg/config/config.go +++ b/web/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/web/pkg/config/parser/parse.go b/web/pkg/config/parser/parse.go index 71870c8ce6..766c4d6e81 100644 --- a/web/pkg/config/parser/parse.go +++ b/web/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { diff --git a/webdav/pkg/config/config.go b/webdav/pkg/config/config.go index 7c48724c22..04fb193e56 100644 --- a/webdav/pkg/config/config.go +++ b/webdav/pkg/config/config.go @@ -12,9 +12,9 @@ type Config struct { Service Service - Tracing Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/webdav/pkg/config/parser/parse.go b/webdav/pkg/config/parser/parse.go index 66341b0992..e6e0246aff 100644 --- a/webdav/pkg/config/parser/parse.go +++ b/webdav/pkg/config/parser/parse.go @@ -28,6 +28,17 @@ func ParseConfig(cfg *config.Config) error { } else if cfg.Log == nil && cfg.Commons == nil { cfg.Log = &config.Log{} } + // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. + if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil { + cfg.Tracing = &config.Tracing{ + Enabled: cfg.Commons.Tracing.Enabled, + Type: cfg.Commons.Tracing.Type, + Endpoint: cfg.Commons.Tracing.Endpoint, + Collector: cfg.Commons.Tracing.Collector, + } + } else if cfg.Tracing == nil && cfg.Commons == nil { + cfg.Tracing = &config.Tracing{} + } // load all env variables relevant to the config in the current context. if err := envdecode.Decode(cfg); err != nil { From c915fa757135081bfceffa709b7f36efa3da1963 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 10:29:39 +0100 Subject: [PATCH 02/10] fix tracing configuration --- changelog/unreleased/fix-tracing-config.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/fix-tracing-config.md diff --git a/changelog/unreleased/fix-tracing-config.md b/changelog/unreleased/fix-tracing-config.md new file mode 100644 index 0000000000..62b15cf6ab --- /dev/null +++ b/changelog/unreleased/fix-tracing-config.md @@ -0,0 +1,6 @@ +Bugfix: Fix the default tracing provider + +We've fixed the default tracing provider which was no longer configured after [owncloud/ocis#2818](https://github.com/owncloud/ocis/pull/2818). + +https://github.com/owncloud/ocis/pull/2952 +https://github.com/owncloud/ocis/pull/2818 From a3df3f9119cdcf52bfd65ede715bcd8305904d5b Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 10:56:02 +0100 Subject: [PATCH 03/10] remove default tracing config from indiviual packages --- glauth/pkg/config/defaultconfig.go | 6 ------ graph-explorer/pkg/config/defaultconfig.go | 6 ------ graph/pkg/config/defaultconfig.go | 6 ------ idp/pkg/config/defaultconfig.go | 6 ------ ocs/pkg/config/defaultconfig.go | 7 +------ proxy/pkg/config/defaultconfig.go | 6 ------ settings/pkg/config/defaultconfig.go | 6 ------ store/pkg/config/defaultconfig.go | 6 ------ thumbnails/pkg/config/defaultconfig.go | 6 ------ web/pkg/config/defaultconfig.go | 6 ------ webdav/pkg/config/defaultconfig.go | 6 ------ 11 files changed, 1 insertion(+), 66 deletions(-) diff --git a/glauth/pkg/config/defaultconfig.go b/glauth/pkg/config/defaultconfig.go index becff0bb9d..503321d8ee 100644 --- a/glauth/pkg/config/defaultconfig.go +++ b/glauth/pkg/config/defaultconfig.go @@ -11,12 +11,6 @@ func DefaultConfig() *Config { Debug: Debug{ Addr: "127.0.0.1:9129", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, Service: Service{ Name: "glauth", }, diff --git a/graph-explorer/pkg/config/defaultconfig.go b/graph-explorer/pkg/config/defaultconfig.go index 7ea4908193..454cb239a6 100644 --- a/graph-explorer/pkg/config/defaultconfig.go +++ b/graph-explorer/pkg/config/defaultconfig.go @@ -16,12 +16,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "graph-explorer", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, GraphExplorer: GraphExplorer{ ClientID: "ocis-explorer.js", Issuer: "https://localhost:9200", diff --git a/graph/pkg/config/defaultconfig.go b/graph/pkg/config/defaultconfig.go index 5879b9487a..3bb022786e 100644 --- a/graph/pkg/config/defaultconfig.go +++ b/graph/pkg/config/defaultconfig.go @@ -14,12 +14,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "graph", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, Reva: Reva{ Address: "127.0.0.1:9142", }, diff --git a/idp/pkg/config/defaultconfig.go b/idp/pkg/config/defaultconfig.go index 21e59a3391..823291596b 100644 --- a/idp/pkg/config/defaultconfig.go +++ b/idp/pkg/config/defaultconfig.go @@ -22,12 +22,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "idp", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, Asset: Asset{}, IDP: Settings{ Iss: "https://localhost:9200", diff --git a/ocs/pkg/config/defaultconfig.go b/ocs/pkg/config/defaultconfig.go index 59cbfb8f1f..0ed8378ba4 100644 --- a/ocs/pkg/config/defaultconfig.go +++ b/ocs/pkg/config/defaultconfig.go @@ -22,12 +22,7 @@ func DefaultConfig() *Config { Service: Service{ Name: "ocs", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, + TokenManager: TokenManager{ JWTSecret: "Pive-Fumkiu4", }, diff --git a/proxy/pkg/config/defaultconfig.go b/proxy/pkg/config/defaultconfig.go index 136cf28b98..12bcbe806d 100644 --- a/proxy/pkg/config/defaultconfig.go +++ b/proxy/pkg/config/defaultconfig.go @@ -23,12 +23,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "proxy", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, OIDC: OIDC{ Issuer: "https://localhost:9200", Insecure: true, diff --git a/settings/pkg/config/defaultconfig.go b/settings/pkg/config/defaultconfig.go index a667c0c251..7f72e50a30 100644 --- a/settings/pkg/config/defaultconfig.go +++ b/settings/pkg/config/defaultconfig.go @@ -33,12 +33,6 @@ func DefaultConfig() *Config { Addr: "127.0.0.1:9191", Namespace: "com.owncloud.api", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, DataPath: path.Join(defaults.BaseDataPath(), "settings"), Asset: Asset{ Path: "", diff --git a/store/pkg/config/defaultconfig.go b/store/pkg/config/defaultconfig.go index 66e44044d3..c2d42f4301 100644 --- a/store/pkg/config/defaultconfig.go +++ b/store/pkg/config/defaultconfig.go @@ -21,12 +21,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "store", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, Datapath: path.Join(defaults.BaseDataPath(), "store"), } } diff --git a/thumbnails/pkg/config/defaultconfig.go b/thumbnails/pkg/config/defaultconfig.go index ac2da94d29..8f59db53e3 100644 --- a/thumbnails/pkg/config/defaultconfig.go +++ b/thumbnails/pkg/config/defaultconfig.go @@ -21,12 +21,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "thumbnails", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, Thumbnail: Thumbnail{ Resolutions: []string{"16x16", "32x32", "64x64", "128x128", "1920x1080", "3840x2160", "7680x4320"}, FileSystemStorage: FileSystemStorage{ diff --git a/web/pkg/config/defaultconfig.go b/web/pkg/config/defaultconfig.go index 42f22beda3..018cac2d0a 100644 --- a/web/pkg/config/defaultconfig.go +++ b/web/pkg/config/defaultconfig.go @@ -17,12 +17,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "web", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, Asset: Asset{ Path: "", }, diff --git a/webdav/pkg/config/defaultconfig.go b/webdav/pkg/config/defaultconfig.go index dcd3c04f9e..3bf74acd25 100644 --- a/webdav/pkg/config/defaultconfig.go +++ b/webdav/pkg/config/defaultconfig.go @@ -22,12 +22,6 @@ func DefaultConfig() *Config { Service: Service{ Name: "webdav", }, - Tracing: Tracing{ - Enabled: false, - Type: "jaeger", - Endpoint: "", - Collector: "", - }, OcisPublicURL: "https://127.0.0.1:9200", WebdavNamespace: "/users/{{.Id.OpaqueId}}", RevaGateway: "127.0.0.1:9142", From 0a3adfe8e1a9524818b71fdf02f4f94e5db90369 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 11:06:12 +0100 Subject: [PATCH 04/10] fix proxy test tracing setting --- proxy/pkg/proxy/proxy_integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/pkg/proxy/proxy_integration_test.go b/proxy/pkg/proxy/proxy_integration_test.go index 0137b4413e..1491933ad4 100644 --- a/proxy/pkg/proxy/proxy_integration_test.go +++ b/proxy/pkg/proxy/proxy_integration_test.go @@ -216,7 +216,7 @@ func testConfig(policy []config.Policy) *config.Config { Log: &config.Log{}, Debug: config.Debug{}, HTTP: config.HTTP{}, - Tracing: config.Tracing{}, + Tracing: &config.Tracing{}, Policies: policy, OIDC: config.OIDC{}, PolicySelector: nil, From fde89005b70ad91313f720230e3b7600cd8f4518 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 11:18:36 +0100 Subject: [PATCH 05/10] test parallel deployment on freshly baked ocis instead on latest tag --- .drone.star | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.drone.star b/.drone.star index 5315f4fc40..e855c47ace 100644 --- a/.drone.star +++ b/.drone.star @@ -1969,13 +1969,14 @@ def parallelDeployAcceptancePipeline(ctx): "os": "linux", "arch": "amd64", }, - "steps": cloneCoreRepos() + + "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + + cloneCoreRepos() + copyConfigs() + waitForServices() + - oC10Server() + + parallelDeploymentOC10Server() + owncloudLog() + fixSharedDataPermissions() + - latestOcisServer() + + parallelDeploymentOcisServer() + parallelAcceptance(environment) + failEarly(ctx, early_fail), "services": oc10DbService() + @@ -2041,7 +2042,7 @@ def parallelAcceptance(env): ], }] -def latestOcisServer(): +def parallelDeploymentOcisServer(): environment = { # Keycloak IDP specific configuration "PROXY_OIDC_ISSUER": "https://keycloak/auth/realmsowncloud", @@ -2114,11 +2115,12 @@ def latestOcisServer(): return [ { "name": "ocis", - "image": OC_OCIS, + "image": OC_CI_ALPINE, "environment": environment, "detach": True, "commands": [ - "ocis server", + "apk add mailcap", # install /etc/mime.types + "ocis/bin/ocis server", ], "volumes": [ stepVolumeOC10OCISData, @@ -2137,7 +2139,7 @@ def latestOcisServer(): }, ] -def oC10Server(): +def parallelDeploymentOC10Server(): return [ { "name": "oc10", From 2f8d63b38081b4c856e1ee73fdb3b90a4eb9dc60 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 11:38:28 +0100 Subject: [PATCH 06/10] fix depends_on and user --- .drone.star | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.star b/.drone.star index e855c47ace..86feec2d09 100644 --- a/.drone.star +++ b/.drone.star @@ -1990,6 +1990,7 @@ def parallelDeployAcceptancePipeline(ctx): pipeOCISConfigVol, pipelineVolumeOC10Tests, ], + "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]), "trigger": {}, } @@ -2119,14 +2120,13 @@ def parallelDeploymentOcisServer(): "environment": environment, "detach": True, "commands": [ - "apk add mailcap", # install /etc/mime.types "ocis/bin/ocis server", ], "volumes": [ stepVolumeOC10OCISData, stepVolumeOCISConfig, ], - "user": "33:33", + "user": "33:33", # same user as oC10 "depends_on": ["fix-permissions"], }, { From 6ef6d1117c484babfe6e824a0c3dd1a886bc9236 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 12:38:41 +0100 Subject: [PATCH 07/10] fix condition for nil pointer in common config --- accounts/pkg/config/parser/parse.go | 4 ++-- glauth/pkg/config/parser/parse.go | 4 ++-- graph-explorer/pkg/config/parser/parse.go | 4 ++-- graph/pkg/config/parser/parse.go | 4 ++-- idp/pkg/config/parser/parse.go | 4 ++-- ocis-pkg/config/parser/parse.go | 2 +- ocs/pkg/config/parser/parse.go | 4 ++-- proxy/pkg/config/parser/parse.go | 4 ++-- settings/pkg/config/parser/parse.go | 4 ++-- storage/pkg/command/gateway.go | 2 +- store/pkg/config/parser/parse.go | 4 ++-- thumbnails/pkg/config/parser/parse.go | 4 ++-- web/pkg/config/parser/parse.go | 4 ++-- webdav/pkg/config/parser/parse.go | 4 ++-- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/accounts/pkg/config/parser/parse.go b/accounts/pkg/config/parser/parse.go index 92cba79b5f..fb801aed28 100644 --- a/accounts/pkg/config/parser/parse.go +++ b/accounts/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/glauth/pkg/config/parser/parse.go b/glauth/pkg/config/parser/parse.go index 540bf80d3e..de91a18232 100644 --- a/glauth/pkg/config/parser/parse.go +++ b/glauth/pkg/config/parser/parse.go @@ -24,7 +24,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -35,7 +35,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/graph-explorer/pkg/config/parser/parse.go b/graph-explorer/pkg/config/parser/parse.go index cb463eecf8..c9127c292f 100644 --- a/graph-explorer/pkg/config/parser/parse.go +++ b/graph-explorer/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/graph/pkg/config/parser/parse.go b/graph/pkg/config/parser/parse.go index bfb1302bbf..367089f852 100644 --- a/graph/pkg/config/parser/parse.go +++ b/graph/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/idp/pkg/config/parser/parse.go b/idp/pkg/config/parser/parse.go index faa1ea1665..d5561337e5 100644 --- a/idp/pkg/config/parser/parse.go +++ b/idp/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/ocis-pkg/config/parser/parse.go b/ocis-pkg/config/parser/parse.go index a0870d17c7..ba75a411c0 100644 --- a/ocis-pkg/config/parser/parse.go +++ b/ocis-pkg/config/parser/parse.go @@ -23,7 +23,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &shared.Log{} } diff --git a/ocs/pkg/config/parser/parse.go b/ocs/pkg/config/parser/parse.go index 48f8e51a2d..96f4205dfc 100644 --- a/ocs/pkg/config/parser/parse.go +++ b/ocs/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/proxy/pkg/config/parser/parse.go b/proxy/pkg/config/parser/parse.go index 493ed0bca6..55105cfcbc 100644 --- a/proxy/pkg/config/parser/parse.go +++ b/proxy/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/settings/pkg/config/parser/parse.go b/settings/pkg/config/parser/parse.go index 5ceb37a1ff..f1c7c94362 100644 --- a/settings/pkg/config/parser/parse.go +++ b/settings/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/storage/pkg/command/gateway.go b/storage/pkg/command/gateway.go index 0de42d2b91..b3a3cf4828 100644 --- a/storage/pkg/command/gateway.go +++ b/storage/pkg/command/gateway.go @@ -423,7 +423,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config, storageExtension string) er Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &shared.Log{} } diff --git a/store/pkg/config/parser/parse.go b/store/pkg/config/parser/parse.go index 29e2efa292..a0f532c9e1 100644 --- a/store/pkg/config/parser/parse.go +++ b/store/pkg/config/parser/parse.go @@ -24,7 +24,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -35,7 +35,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/thumbnails/pkg/config/parser/parse.go b/thumbnails/pkg/config/parser/parse.go index e621f53d07..5fa62fb15e 100644 --- a/thumbnails/pkg/config/parser/parse.go +++ b/thumbnails/pkg/config/parser/parse.go @@ -24,7 +24,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -35,7 +35,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/web/pkg/config/parser/parse.go b/web/pkg/config/parser/parse.go index 766c4d6e81..2151f613e4 100644 --- a/web/pkg/config/parser/parse.go +++ b/web/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } diff --git a/webdav/pkg/config/parser/parse.go b/webdav/pkg/config/parser/parse.go index e6e0246aff..33c893db4a 100644 --- a/webdav/pkg/config/parser/parse.go +++ b/webdav/pkg/config/parser/parse.go @@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error { Color: cfg.Commons.Log.Color, File: cfg.Commons.Log.File, } - } else if cfg.Log == nil && cfg.Commons == nil { + } else if cfg.Log == nil { cfg.Log = &config.Log{} } // provide with defaults for shared tracing, since we need a valid destination address for BindEnv. @@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error { Endpoint: cfg.Commons.Tracing.Endpoint, Collector: cfg.Commons.Tracing.Collector, } - } else if cfg.Tracing == nil && cfg.Commons == nil { + } else if cfg.Tracing == nil { cfg.Tracing = &config.Tracing{} } From 0757fd191acafd6f0b7386093913171b7b00fc41 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 13:42:09 +0100 Subject: [PATCH 08/10] change ocis data path for rootless setup --- .drone.star | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.star b/.drone.star index 86feec2d09..2583c4e3f8 100644 --- a/.drone.star +++ b/.drone.star @@ -2105,6 +2105,7 @@ def parallelDeploymentOcisServer(): "OCIS_LOG_LEVEL": "error", "OCIS_URL": OCIS_URL, "PROXY_TLS": "true", + "OCIS_BASE_DATA_PATH": "./ocis-data", # this is only needed since we use a binary not intended to be run in a rootless docker container # change default secrets "OCIS_JWT_SECRET": "Pive-Fumkiu4", "STORAGE_TRANSFER_SECRET": "replace-me-with-a-transfer-secret", From 67180bb773d7fc7878683020d7f3650c9dc503ff Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 12 Jan 2022 13:54:33 +0100 Subject: [PATCH 09/10] fix data directory --- .drone.star | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.drone.star b/.drone.star index 2583c4e3f8..63b5be5d7e 100644 --- a/.drone.star +++ b/.drone.star @@ -2115,6 +2115,14 @@ def parallelDeploymentOcisServer(): } return [ + { + "name": "ocis-data-dir-permissions", + "image": OC_CI_ALPINE, + "commands": [ + "mkdir ./ocis-data", + "chmod 777 ./ocis-data", # make writable for 33:33 + ], + }, { "name": "ocis", "image": OC_CI_ALPINE, From d63661f7891d16a1acd81f03f1d83686c4a9ba51 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 13 Jan 2022 08:12:50 +0100 Subject: [PATCH 10/10] revert ci changes --- .drone.star | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.drone.star b/.drone.star index 63b5be5d7e..5315f4fc40 100644 --- a/.drone.star +++ b/.drone.star @@ -1969,14 +1969,13 @@ def parallelDeployAcceptancePipeline(ctx): "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + - cloneCoreRepos() + + "steps": cloneCoreRepos() + copyConfigs() + waitForServices() + - parallelDeploymentOC10Server() + + oC10Server() + owncloudLog() + fixSharedDataPermissions() + - parallelDeploymentOcisServer() + + latestOcisServer() + parallelAcceptance(environment) + failEarly(ctx, early_fail), "services": oc10DbService() + @@ -1990,7 +1989,6 @@ def parallelDeployAcceptancePipeline(ctx): pipeOCISConfigVol, pipelineVolumeOC10Tests, ], - "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]), "trigger": {}, } @@ -2043,7 +2041,7 @@ def parallelAcceptance(env): ], }] -def parallelDeploymentOcisServer(): +def latestOcisServer(): environment = { # Keycloak IDP specific configuration "PROXY_OIDC_ISSUER": "https://keycloak/auth/realmsowncloud", @@ -2105,7 +2103,6 @@ def parallelDeploymentOcisServer(): "OCIS_LOG_LEVEL": "error", "OCIS_URL": OCIS_URL, "PROXY_TLS": "true", - "OCIS_BASE_DATA_PATH": "./ocis-data", # this is only needed since we use a binary not intended to be run in a rootless docker container # change default secrets "OCIS_JWT_SECRET": "Pive-Fumkiu4", "STORAGE_TRANSFER_SECRET": "replace-me-with-a-transfer-secret", @@ -2115,27 +2112,19 @@ def parallelDeploymentOcisServer(): } return [ - { - "name": "ocis-data-dir-permissions", - "image": OC_CI_ALPINE, - "commands": [ - "mkdir ./ocis-data", - "chmod 777 ./ocis-data", # make writable for 33:33 - ], - }, { "name": "ocis", - "image": OC_CI_ALPINE, + "image": OC_OCIS, "environment": environment, "detach": True, "commands": [ - "ocis/bin/ocis server", + "ocis server", ], "volumes": [ stepVolumeOC10OCISData, stepVolumeOCISConfig, ], - "user": "33:33", # same user as oC10 + "user": "33:33", "depends_on": ["fix-permissions"], }, { @@ -2148,7 +2137,7 @@ def parallelDeploymentOcisServer(): }, ] -def parallelDeploymentOC10Server(): +def oC10Server(): return [ { "name": "oc10",