mirror of https://github.com/knative/caching.git
[master] Auto-update dependencies (#249)
Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov
This commit is contained in:
parent
ad9c545be7
commit
02bd776d27
|
@ -966,7 +966,7 @@
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:848ae8fad4b88bbe3e0944f2a68052e14c4e1bb345d7b32f9d0a0ffdc2c90b46"
|
digest = "1:fed37fd81954c07b624d39dbb63b0d7c1208cd26b4427e4e436abc1945f21319"
|
||||||
name = "knative.dev/pkg"
|
name = "knative.dev/pkg"
|
||||||
packages = [
|
packages = [
|
||||||
"apis",
|
"apis",
|
||||||
|
@ -986,7 +986,7 @@
|
||||||
"reconciler",
|
"reconciler",
|
||||||
]
|
]
|
||||||
pruneopts = "T"
|
pruneopts = "T"
|
||||||
revision = "4e57475bc87c1aba3e7fcc0207b593dc7186eb83"
|
revision = "0eed424fa4eeeea60ee42f6676420aa8c51df062"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
@ -997,7 +997,7 @@
|
||||||
"tools/dep-collector",
|
"tools/dep-collector",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "74b24ca44778c3a69ecc193250cdddb5d0e64b88"
|
revision = "9cf64fb1b912898b2934e0e963bf3c61b96d7a2c"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# Development
|
# Development
|
||||||
|
|
||||||
This doc explains how to setup a development environment so you can get started
|
This doc explains how to setup a development environment so you can get started
|
||||||
[contributing](https://github.com/knative/docs/blob/master/community/CONTRIBUTING.md)
|
[contributing](https://knative.dev/community/contributing/) to Knative `pkg`.
|
||||||
to Knative `pkg`. Also take a look at:
|
Also take a look at:
|
||||||
|
|
||||||
- [The pull request workflow](https://github.com/knative/docs/blob/master/community/CONTRIBUTING.md#pull-requests)
|
- [The pull request workflow](https://knative.dev/community/contributing/reviewing/)
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ mkdir -p ${GOPATH}/src/knative.dev
|
||||||
cd ${GOPATH}/src/knative.dev
|
cd ${GOPATH}/src/knative.dev
|
||||||
git clone git@github.com:${YOUR_GITHUB_USERNAME}/pkg.git
|
git clone git@github.com:${YOUR_GITHUB_USERNAME}/pkg.git
|
||||||
cd pkg
|
cd pkg
|
||||||
git remote add upstream git@github.com:knative/pkg.git
|
git remote add upstream https://github.com/knative/pkg.git
|
||||||
git remote set-url --push upstream no_push
|
git remote set-url --push upstream no_push
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1369,14 +1369,14 @@
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:50482e6fd500cf50c4a29d640cda026206145c6716dff72e4368a5e57fdb7095"
|
digest = "1:dc73d65f40ea05b1d0db96ae5491b6ebc162bb59b3ac5a252cdf87848bc7a4b7"
|
||||||
name = "knative.dev/test-infra"
|
name = "knative.dev/test-infra"
|
||||||
packages = [
|
packages = [
|
||||||
"scripts",
|
"scripts",
|
||||||
"tools/dep-collector",
|
"tools/dep-collector",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "193c078363dbb0b817068820dcbe7b238dd2eb02"
|
revision = "74b24ca44778c3a69ecc193250cdddb5d0e64b88"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
||||||
|
|
|
@ -38,7 +38,10 @@ const (
|
||||||
fallbackLoggerName = "fallback-logger"
|
fallbackLoggerName = "fallback-logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errEmptyLoggerConfig = errors.New("empty logger configuration")
|
var (
|
||||||
|
errEmptyLoggerConfig = errors.New("empty logger configuration")
|
||||||
|
errEmptyJSONLogginString = errors.New("json logging string is empty")
|
||||||
|
)
|
||||||
|
|
||||||
// NewLogger creates a logger with the supplied configuration.
|
// NewLogger creates a logger with the supplied configuration.
|
||||||
// In addition to the logger, it returns AtomicLevel that can
|
// In addition to the logger, it returns AtomicLevel that can
|
||||||
|
@ -150,17 +153,21 @@ const defaultZLC = `{
|
||||||
}
|
}
|
||||||
}`
|
}`
|
||||||
|
|
||||||
|
func defaultConfig() *Config {
|
||||||
|
return &Config{
|
||||||
|
LoggingConfig: defaultZLC,
|
||||||
|
LoggingLevel: make(map[string]zapcore.Level),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NewConfigFromMap creates a LoggingConfig from the supplied map,
|
// NewConfigFromMap creates a LoggingConfig from the supplied map,
|
||||||
// expecting the given list of components.
|
// expecting the given list of components.
|
||||||
func NewConfigFromMap(data map[string]string) (*Config, error) {
|
func NewConfigFromMap(data map[string]string) (*Config, error) {
|
||||||
lc := &Config{}
|
lc := defaultConfig()
|
||||||
if zlc, ok := data[loggerConfigKey]; ok {
|
if zlc, ok := data[loggerConfigKey]; ok {
|
||||||
lc.LoggingConfig = zlc
|
lc.LoggingConfig = zlc
|
||||||
} else {
|
|
||||||
lc.LoggingConfig = defaultZLC
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lc.LoggingLevel = make(map[string]zapcore.Level)
|
|
||||||
for k, v := range data {
|
for k, v := range data {
|
||||||
if component := strings.TrimPrefix(k, "loglevel."); component != k && component != "" {
|
if component := strings.TrimPrefix(k, "loglevel."); component != k && component != "" {
|
||||||
if len(v) > 0 {
|
if len(v) > 0 {
|
||||||
|
@ -237,7 +244,7 @@ func ConfigMapName() string {
|
||||||
// Returns a non-nil Config always.
|
// Returns a non-nil Config always.
|
||||||
func JsonToLoggingConfig(jsonCfg string) (*Config, error) {
|
func JsonToLoggingConfig(jsonCfg string) (*Config, error) {
|
||||||
if jsonCfg == "" {
|
if jsonCfg == "" {
|
||||||
return nil, errors.New("json logging string is empty")
|
return nil, errEmptyJSONLogginString
|
||||||
}
|
}
|
||||||
|
|
||||||
var configMap map[string]string
|
var configMap map[string]string
|
||||||
|
@ -248,9 +255,7 @@ func JsonToLoggingConfig(jsonCfg string) (*Config, error) {
|
||||||
cfg, err := NewConfigFromMap(configMap)
|
cfg, err := NewConfigFromMap(configMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Get the default config from logging package.
|
// Get the default config from logging package.
|
||||||
if cfg, err = NewConfigFromMap(nil); err != nil {
|
return NewConfigFromConfigMap(nil)
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return cfg, nil
|
return cfg, nil
|
||||||
}
|
}
|
||||||
|
@ -264,9 +269,5 @@ func LoggingConfigToJson(cfg *Config) (string, error) {
|
||||||
jsonCfg, err := json.Marshal(map[string]string{
|
jsonCfg, err := json.Marshal(map[string]string{
|
||||||
loggerConfigKey: cfg.LoggingConfig,
|
loggerConfigKey: cfg.LoggingConfig,
|
||||||
})
|
})
|
||||||
if err != nil {
|
return string(jsonCfg), err
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
return string(jsonCfg), nil
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue