Skip to content

Commit

Permalink
Merge pull request #2813 from owncloud/config-cleanup-1
Browse files Browse the repository at this point in the history
Cleanup ocis config
  • Loading branch information
wkloucek authored Nov 24, 2021
2 parents d9df490 + 36be70c commit 0d8ef24
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 124 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/ocis-pkg-config-cleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Cleanup ocis-pkg config

Certain values were of no use when configuring the ocis runtime.

https://github.com/owncloud/ocis/pull/2813
63 changes: 0 additions & 63 deletions ocis-pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,6 @@ import (
webdav "github.com/owncloud/ocis/webdav/pkg/config"
)

// Debug defines the available debug configuration.
type Debug struct {
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}

// HTTP defines the available http configuration.
type HTTP struct {
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
}

// GRPC defines the available grpc configuration.
type GRPC struct {
Addr string `ocisConfig:"addr"`
}

// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `ocisConfig:"enabled"`
Expand Down Expand Up @@ -78,9 +59,6 @@ type Config struct {

Registry string `ocisConfig:"registry"`
Log shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
GRPC GRPC `ocisConfig:"grpc"`
Tracing Tracing `ocisConfig:"tracing"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Runtime Runtime `ocisConfig:"runtime"`
Expand Down Expand Up @@ -121,19 +99,6 @@ func New() *Config {

func DefaultConfig() *Config {
return &Config{
Debug: Debug{
Addr: "127.0.0.1:9010",
Token: "",
Pprof: false,
Zpages: false,
},
HTTP: HTTP{
Addr: "127.0.0.1:9000",
Root: "/",
},
GRPC: GRPC{
Addr: "127.0.0.1:9001",
},
Tracing: Tracing{
Enabled: false,
Type: "jaeger",
Expand Down Expand Up @@ -232,34 +197,6 @@ func structMappings(cfg *Config) []shared.EnvBinding {
EnvVars: []string{"OCIS_RUNTIME_HOST"},
Destination: &cfg.Runtime.Host,
},
{
EnvVars: []string{"OCIS_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
{
EnvVars: []string{"OCIS_DEBUG_TOKEN"},
Destination: &cfg.Debug.Token,
},
{
EnvVars: []string{"OCIS_DEBUG_PPROF"},
Destination: &cfg.Debug.Pprof,
},
{
EnvVars: []string{"OCIS_DEBUG_ZPAGES"},
Destination: &cfg.Debug.Zpages,
},
{
EnvVars: []string{"OCIS_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
{
EnvVars: []string{"OCIS_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
{
EnvVars: []string{"OCIS_GRPC_ADDR"},
Destination: &cfg.GRPC.Addr,
},
{
EnvVars: []string{"OCIS_RUN_EXTENSIONS"},
Destination: &cfg.Runtime.Extensions,
Expand Down
55 changes: 0 additions & 55 deletions ocis/pkg/command/health.go

This file was deleted.

6 changes: 0 additions & 6 deletions ocis/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
package command

import (
"strings"

"github.com/owncloud/ocis/ocis-pkg/shared"

"github.com/owncloud/ocis/ocis-pkg/config"
Expand All @@ -21,10 +19,6 @@ func Server(cfg *config.Config) *cli.Command {
Usage: "Start fullstack server",
Category: "Fullstack",
Before: func(c *cli.Context) error {
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}

return ParseConfig(c, cfg)
},
Action: func(c *cli.Context) error {
Expand Down

0 comments on commit 0d8ef24

Please sign in to comment.