mirror of https://github.com/knative/caching.git
[master] Auto-update dependencies (#276)
Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov
This commit is contained in:
parent
d0a9c943a8
commit
43a93f3573
4
go.mod
4
go.mod
|
@ -16,8 +16,8 @@ require (
|
||||||
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
||||||
k8s.io/code-generator v0.18.0
|
k8s.io/code-generator v0.18.0
|
||||||
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
|
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
|
||||||
knative.dev/pkg v0.0.0-20200517014302-3c29a1ce8906
|
knative.dev/pkg v0.0.0-20200518174206-60f4ae1dbe6f
|
||||||
knative.dev/test-infra v0.0.0-20200515184601-7a28f47cdbcb
|
knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9
|
||||||
)
|
)
|
||||||
|
|
||||||
replace (
|
replace (
|
||||||
|
|
8
go.sum
8
go.sum
|
@ -1375,8 +1375,8 @@ knative.dev/pkg v0.0.0-20200514052058-c75d324f8b8b h1:lM0uwBgNcS9S4cWLqIS6Fvjt3k
|
||||||
knative.dev/pkg v0.0.0-20200514052058-c75d324f8b8b/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY=
|
knative.dev/pkg v0.0.0-20200514052058-c75d324f8b8b/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY=
|
||||||
knative.dev/pkg v0.0.0-20200515002500-16d7b963416f h1:kcpAMvYUqftHMA69wZ7g83zEW4y8cdnqfdJsSPOlrJQ=
|
knative.dev/pkg v0.0.0-20200515002500-16d7b963416f h1:kcpAMvYUqftHMA69wZ7g83zEW4y8cdnqfdJsSPOlrJQ=
|
||||||
knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY=
|
knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY=
|
||||||
knative.dev/pkg v0.0.0-20200517014302-3c29a1ce8906 h1:Xo/FFyVEZic+75UZJ0MJMuXgdfh+99YixIMAd3nCVys=
|
knative.dev/pkg v0.0.0-20200518174206-60f4ae1dbe6f h1:f2eK5+z0/l2S431UCezMG9W4FzktuNbD0OB1gezSoMs=
|
||||||
knative.dev/pkg v0.0.0-20200517014302-3c29a1ce8906/go.mod h1:GinFtW8LEi9rzCkzCMHAIlAnZjP1RzauxwhRAI3rimI=
|
knative.dev/pkg v0.0.0-20200518174206-60f4ae1dbe6f/go.mod h1:GinFtW8LEi9rzCkzCMHAIlAnZjP1RzauxwhRAI3rimI=
|
||||||
knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ=
|
knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ=
|
||||||
knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55 h1:Ajn44+eHHjPQL/BQicj8LMy8VTD2ypMCfHJuZVGEtew=
|
knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55 h1:Ajn44+eHHjPQL/BQicj8LMy8VTD2ypMCfHJuZVGEtew=
|
||||||
knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU=
|
knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU=
|
||||||
|
@ -1384,8 +1384,8 @@ knative.dev/test-infra v0.0.0-20200513011557-d03429a76034 h1:JxqONCZVS7or+Fv3ebV
|
||||||
knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE=
|
knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE=
|
||||||
knative.dev/test-infra v0.0.0-20200514223200-ef4fd3ad398f h1:2j9xK15xMRz5h+yXIHt19iBAhWoEzRlZjSNurXzp4Nc=
|
knative.dev/test-infra v0.0.0-20200514223200-ef4fd3ad398f h1:2j9xK15xMRz5h+yXIHt19iBAhWoEzRlZjSNurXzp4Nc=
|
||||||
knative.dev/test-infra v0.0.0-20200514223200-ef4fd3ad398f/go.mod h1:+uml4upluwrnWHRSezi4WVcKJ0OJHynF16Ot7fu0ky4=
|
knative.dev/test-infra v0.0.0-20200514223200-ef4fd3ad398f/go.mod h1:+uml4upluwrnWHRSezi4WVcKJ0OJHynF16Ot7fu0ky4=
|
||||||
knative.dev/test-infra v0.0.0-20200515184601-7a28f47cdbcb h1:g1NE1OdGOh8vgLaKhi6O/fXFhlewq7wnL2EQNLKe+bE=
|
knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9 h1:kKfV3QWsxugwXsqgjFd72MjZeAHJ381dWqAxH2KMknc=
|
||||||
knative.dev/test-infra v0.0.0-20200515184601-7a28f47cdbcb/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE=
|
knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE=
|
||||||
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
|
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
|
||||||
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
|
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
|
||||||
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
|
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
|
||||||
|
|
|
@ -17,9 +17,12 @@ limitations under the License.
|
||||||
package configmap
|
package configmap
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParseFunc is a function taking ConfigMap data and applying a parse operation to it.
|
// ParseFunc is a function taking ConfigMap data and applying a parse operation to it.
|
||||||
|
@ -51,7 +54,7 @@ func AsInt32(key string, target *int32) ParseFunc {
|
||||||
if raw, ok := data[key]; ok {
|
if raw, ok := data[key]; ok {
|
||||||
val, err := strconv.ParseInt(raw, 10, 32)
|
val, err := strconv.ParseInt(raw, 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to parse %q: %w", key, err)
|
||||||
}
|
}
|
||||||
*target = int32(val)
|
*target = int32(val)
|
||||||
}
|
}
|
||||||
|
@ -65,7 +68,7 @@ func AsInt64(key string, target *int64) ParseFunc {
|
||||||
if raw, ok := data[key]; ok {
|
if raw, ok := data[key]; ok {
|
||||||
val, err := strconv.ParseInt(raw, 10, 64)
|
val, err := strconv.ParseInt(raw, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to parse %q: %w", key, err)
|
||||||
}
|
}
|
||||||
*target = val
|
*target = val
|
||||||
}
|
}
|
||||||
|
@ -79,7 +82,7 @@ func AsFloat64(key string, target *float64) ParseFunc {
|
||||||
if raw, ok := data[key]; ok {
|
if raw, ok := data[key]; ok {
|
||||||
val, err := strconv.ParseFloat(raw, 64)
|
val, err := strconv.ParseFloat(raw, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to parse %q: %w", key, err)
|
||||||
}
|
}
|
||||||
*target = val
|
*target = val
|
||||||
}
|
}
|
||||||
|
@ -93,7 +96,7 @@ func AsDuration(key string, target *time.Duration) ParseFunc {
|
||||||
if raw, ok := data[key]; ok {
|
if raw, ok := data[key]; ok {
|
||||||
val, err := time.ParseDuration(raw)
|
val, err := time.ParseDuration(raw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to parse %q: %w", key, err)
|
||||||
}
|
}
|
||||||
*target = val
|
*target = val
|
||||||
}
|
}
|
||||||
|
@ -101,6 +104,16 @@ func AsDuration(key string, target *time.Duration) ParseFunc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AsStringSet parses the value at key as a sets.String (split by ',') into the target, if it exists.
|
||||||
|
func AsStringSet(key string, target *sets.String) ParseFunc {
|
||||||
|
return func(data map[string]string) error {
|
||||||
|
if raw, ok := data[key]; ok {
|
||||||
|
*target = sets.NewString(strings.Split(raw, ",")...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Parse parses the given map using the parser functions passed in.
|
// Parse parses the given map using the parser functions passed in.
|
||||||
func Parse(data map[string]string, parsers ...ParseFunc) error {
|
func Parse(data map[string]string, parsers ...ParseFunc) error {
|
||||||
for _, parse := range parsers {
|
for _, parse := range parsers {
|
||||||
|
|
|
@ -18,10 +18,10 @@ package metrics
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
texttemplate "text/template"
|
texttemplate "text/template"
|
||||||
|
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
|
cm "knative.dev/pkg/configmap"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -71,32 +71,23 @@ func defaultConfig() *ObservabilityConfig {
|
||||||
// NewObservabilityConfigFromConfigMap creates a ObservabilityConfig from the supplied ConfigMap
|
// NewObservabilityConfigFromConfigMap creates a ObservabilityConfig from the supplied ConfigMap
|
||||||
func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*ObservabilityConfig, error) {
|
func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*ObservabilityConfig, error) {
|
||||||
oc := defaultConfig()
|
oc := defaultConfig()
|
||||||
if evlc, ok := configMap.Data["logging.enable-var-log-collection"]; ok {
|
|
||||||
oc.EnableVarLogCollection = strings.EqualFold(evlc, "true")
|
if err := cm.Parse(configMap.Data,
|
||||||
|
cm.AsBool("logging.enable-var-log-collection", &oc.EnableVarLogCollection),
|
||||||
|
cm.AsString("logging.revision-url-template", &oc.LoggingURLTemplate),
|
||||||
|
cm.AsString("logging.request-log-template", &oc.RequestLogTemplate),
|
||||||
|
cm.AsBool("logging.enable-probe-request-log", &oc.EnableProbeRequestLog),
|
||||||
|
cm.AsString("metrics.request-metrics-backend-destination", &oc.RequestMetricsBackend),
|
||||||
|
cm.AsBool("profiling.enable", &oc.EnableProfiling),
|
||||||
|
); err != nil {
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if rut, ok := configMap.Data["logging.revision-url-template"]; ok {
|
if oc.RequestLogTemplate != "" {
|
||||||
oc.LoggingURLTemplate = rut
|
|
||||||
}
|
|
||||||
|
|
||||||
if rlt, ok := configMap.Data["logging.request-log-template"]; ok {
|
|
||||||
// Verify that we get valid templates.
|
// Verify that we get valid templates.
|
||||||
if _, err := texttemplate.New("requestLog").Parse(rlt); err != nil {
|
if _, err := texttemplate.New("requestLog").Parse(oc.RequestLogTemplate); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
oc.RequestLogTemplate = rlt
|
|
||||||
}
|
|
||||||
|
|
||||||
if eprl, ok := configMap.Data["logging.enable-probe-request-log"]; ok {
|
|
||||||
oc.EnableProbeRequestLog = strings.EqualFold(eprl, "true")
|
|
||||||
}
|
|
||||||
|
|
||||||
if mb, ok := configMap.Data["metrics.request-metrics-backend-destination"]; ok {
|
|
||||||
oc.RequestMetricsBackend = mb
|
|
||||||
}
|
|
||||||
|
|
||||||
if prof, ok := configMap.Data["profiling.enable"]; ok {
|
|
||||||
oc.EnableProfiling = strings.EqualFold(prof, "true")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return oc, nil
|
return oc, nil
|
||||||
|
|
|
@ -656,7 +656,7 @@ k8s.io/kube-openapi/pkg/util/sets
|
||||||
k8s.io/utils/buffer
|
k8s.io/utils/buffer
|
||||||
k8s.io/utils/integer
|
k8s.io/utils/integer
|
||||||
k8s.io/utils/trace
|
k8s.io/utils/trace
|
||||||
# knative.dev/pkg v0.0.0-20200517014302-3c29a1ce8906
|
# knative.dev/pkg v0.0.0-20200518174206-60f4ae1dbe6f
|
||||||
knative.dev/pkg/apis
|
knative.dev/pkg/apis
|
||||||
knative.dev/pkg/apis/duck
|
knative.dev/pkg/apis/duck
|
||||||
knative.dev/pkg/apis/duck/v1
|
knative.dev/pkg/apis/duck/v1
|
||||||
|
@ -676,7 +676,7 @@ knative.dev/pkg/metrics
|
||||||
knative.dev/pkg/metrics/metricskey
|
knative.dev/pkg/metrics/metricskey
|
||||||
knative.dev/pkg/reconciler
|
knative.dev/pkg/reconciler
|
||||||
knative.dev/pkg/tracker
|
knative.dev/pkg/tracker
|
||||||
# knative.dev/test-infra v0.0.0-20200515184601-7a28f47cdbcb
|
# knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9
|
||||||
knative.dev/test-infra/scripts
|
knative.dev/test-infra/scripts
|
||||||
knative.dev/test-infra/tools/dep-collector
|
knative.dev/test-infra/tools/dep-collector
|
||||||
# sigs.k8s.io/yaml v1.1.0
|
# sigs.k8s.io/yaml v1.1.0
|
||||||
|
|
Loading…
Reference in New Issue