[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:
Matt Moore 2020-04-15 07:46:47 -07:00 committed by GitHub
parent ad9c545be7
commit 02bd776d27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 23 deletions

6
Gopkg.lock generated
View File

@ -966,7 +966,7 @@
[[projects]]
branch = "master"
digest = "1:848ae8fad4b88bbe3e0944f2a68052e14c4e1bb345d7b32f9d0a0ffdc2c90b46"
digest = "1:fed37fd81954c07b624d39dbb63b0d7c1208cd26b4427e4e436abc1945f21319"
name = "knative.dev/pkg"
packages = [
"apis",
@ -986,7 +986,7 @@
"reconciler",
]
pruneopts = "T"
revision = "4e57475bc87c1aba3e7fcc0207b593dc7186eb83"
revision = "0eed424fa4eeeea60ee42f6676420aa8c51df062"
[[projects]]
branch = "master"
@ -997,7 +997,7 @@
"tools/dep-collector",
]
pruneopts = "UT"
revision = "74b24ca44778c3a69ecc193250cdddb5d0e64b88"
revision = "9cf64fb1b912898b2934e0e963bf3c61b96d7a2c"
[[projects]]
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"

View File

@ -1,10 +1,10 @@
# Development
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)
to Knative `pkg`. Also take a look at:
[contributing](https://knative.dev/community/contributing/) to Knative `pkg`.
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
@ -59,7 +59,7 @@ mkdir -p ${GOPATH}/src/knative.dev
cd ${GOPATH}/src/knative.dev
git clone git@github.com:${YOUR_GITHUB_USERNAME}/pkg.git
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
```

4
vendor/knative.dev/pkg/Gopkg.lock generated vendored
View File

@ -1369,14 +1369,14 @@
[[projects]]
branch = "master"
digest = "1:50482e6fd500cf50c4a29d640cda026206145c6716dff72e4368a5e57fdb7095"
digest = "1:dc73d65f40ea05b1d0db96ae5491b6ebc162bb59b3ac5a252cdf87848bc7a4b7"
name = "knative.dev/test-infra"
packages = [
"scripts",
"tools/dep-collector",
]
pruneopts = "UT"
revision = "193c078363dbb0b817068820dcbe7b238dd2eb02"
revision = "74b24ca44778c3a69ecc193250cdddb5d0e64b88"
[[projects]]
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"

View File

@ -38,7 +38,10 @@ const (
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.
// 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,
// expecting the given list of components.
func NewConfigFromMap(data map[string]string) (*Config, error) {
lc := &Config{}
lc := defaultConfig()
if zlc, ok := data[loggerConfigKey]; ok {
lc.LoggingConfig = zlc
} else {
lc.LoggingConfig = defaultZLC
}
lc.LoggingLevel = make(map[string]zapcore.Level)
for k, v := range data {
if component := strings.TrimPrefix(k, "loglevel."); component != k && component != "" {
if len(v) > 0 {
@ -237,7 +244,7 @@ func ConfigMapName() string {
// Returns a non-nil Config always.
func JsonToLoggingConfig(jsonCfg string) (*Config, error) {
if jsonCfg == "" {
return nil, errors.New("json logging string is empty")
return nil, errEmptyJSONLogginString
}
var configMap map[string]string
@ -248,9 +255,7 @@ func JsonToLoggingConfig(jsonCfg string) (*Config, error) {
cfg, err := NewConfigFromMap(configMap)
if err != nil {
// Get the default config from logging package.
if cfg, err = NewConfigFromMap(nil); err != nil {
return nil, err
}
return NewConfigFromConfigMap(nil)
}
return cfg, nil
}
@ -264,9 +269,5 @@ func LoggingConfigToJson(cfg *Config) (string, error) {
jsonCfg, err := json.Marshal(map[string]string{
loggerConfigKey: cfg.LoggingConfig,
})
if err != nil {
return "", err
}
return string(jsonCfg), nil
return string(jsonCfg), err
}