Auto-update dependencies (#130)

Produced via:
  `dep ensure -update knative.dev/test-infra knative.dev/pkg`
/assign n3wscott
This commit is contained in:
Matt Moore 2019-11-14 11:05:31 -08:00 committed by Knative Prow Robot
parent 0fc39123e1
commit 4276980149
6 changed files with 38 additions and 27 deletions

4
Gopkg.lock generated
View File

@ -933,7 +933,7 @@
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:0b3cb53ae4d837bb424680941581ec7a2828c9d530db0b11e0cf365ead4e6403" digest = "1:ff0b6b2483ef9341cc0c524f1e5bdbba37b56dde366791986e098a01de81dcac"
name = "knative.dev/pkg" name = "knative.dev/pkg"
packages = [ packages = [
"apis", "apis",
@ -952,7 +952,7 @@
"metrics/metricskey", "metrics/metricskey",
] ]
pruneopts = "T" pruneopts = "T"
revision = "4deb5d83d26170faeef8e54e9ae4cd9b04ed81f8" revision = "d3841ea2c3cb7246076d771abd5cef8b94ef9031"
[[projects]] [[projects]]
branch = "master" branch = "master"

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

@ -1260,14 +1260,14 @@
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:5299d75a2b08a91c54ffb8b76afe21eb5f1ecf7bc4d67b859fc081f9415452bc" digest = "1:e4a2fd481bd2d6dcac5ae03c55d6104a0953d0a78cb45fdd4d20a116ed2a5218"
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 = "6c8da588aaa3d2bff76a9c37fd6ac5c9a6c02c09" revision = "e381f11dc722330fe082158e2f22cd39f8fe8375"
[[projects]] [[projects]]
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"

View File

@ -164,12 +164,22 @@ func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, cto
profilingHandler := profiling.NewHandler(logger, false) profilingHandler := profiling.NewHandler(logger, false)
// Watch the logging config map and dynamically update logging levels. // Watch the logging config map and dynamically update logging levels.
if _, err := kubeclient.Get(ctx).CoreV1().ConfigMaps(system.Namespace()).Get(logging.ConfigMapName(),
metav1.GetOptions{}); err == nil {
cmw.Watch(logging.ConfigMapName(), logging.UpdateLevelFromConfigMap(logger, atomicLevel, component)) cmw.Watch(logging.ConfigMapName(), logging.UpdateLevelFromConfigMap(logger, atomicLevel, component))
} else if !apierrors.IsNotFound(err) {
logger.Fatalw("Error reading ConfigMap: " + logging.ConfigMapName(), zap.Error(err))
}
// Watch the observability config map // Watch the observability config map
if _, err := kubeclient.Get(ctx).CoreV1().ConfigMaps(system.Namespace()).Get(metrics.ConfigMapName(),
metav1.GetOptions{}); err == nil {
cmw.Watch(metrics.ConfigMapName(), cmw.Watch(metrics.ConfigMapName(),
metrics.UpdateExporterFromConfigMap(component, logger), metrics.UpdateExporterFromConfigMap(component, logger),
profilingHandler.UpdateFromConfigMap) profilingHandler.UpdateFromConfigMap)
} else if !apierrors.IsNotFound(err) {
logger.Fatalw("Error reading ConfigMap: " + metrics.ConfigMapName(), zap.Error(err))
}
if err := cmw.Start(ctx.Done()); err != nil { if err := cmw.Start(ctx.Done()); err != nil {
logger.Fatalw("failed to start configuration manager", zap.Error(err)) logger.Fatalw("failed to start configuration manager", zap.Error(err))

View File

@ -105,7 +105,7 @@ func newLoggerFromConfig(configJSON string, levelOverride string, opts []zap.Opt
return nil, zap.AtomicLevel{}, err return nil, zap.AtomicLevel{}, err
} }
logger.Info("Successfully created the logger.", zap.String(logkey.JSONConfig, configJSON)) logger.Info("Successfully created the logger.")
logger.Sugar().Infof("Logging level set to %v", loggingCfg.Level) logger.Sugar().Infof("Logging level set to %v", loggingCfg.Level)
return logger, loggingCfg.Level, nil return logger, loggingCfg.Level, nil
} }

View File

@ -27,8 +27,8 @@ import (
"strings" "strings"
"time" "time"
"go.uber.org/zap"
"go.opencensus.io/stats" "go.opencensus.io/stats"
"go.uber.org/zap"
"knative.dev/pkg/metrics/metricskey" "knative.dev/pkg/metrics/metricskey"
) )

View File

@ -1,17 +1,17 @@
## Knative Webhooks ## Knative Webhooks
Knative provides infrastructure for authoring webhooks under Knative provides infrastructure for authoring webhooks under
`knative.dev/pkg/webhook` and has a few built-in helpers for certain `knative.dev/pkg/webhook` and has a few built-in helpers for certain common
common admission control scenarios. The built-in admission controllers admission control scenarios. The built-in admission controllers are:
are:
1. Resource validation and defaulting (builds around `apis.Validatable` 1. Resource validation and defaulting (builds around `apis.Validatable` and
and `apis.Defaultable` under `knative.dev/pkg/apis`). `apis.Defaultable` under `knative.dev/pkg/apis`).
2. ConfigMap validation, which builds around similar patterns from 2. ConfigMap validation, which builds around similar patterns from
`knative.dev/pkg/configmap` (in particular the `store` concept) `knative.dev/pkg/configmap` (in particular the `store` concept)
To illustrate standing up the webhook, let's start with one of these To illustrate standing up the webhook, let's start with one of these built-in
built-in admission controllers and then talk about how you can write admission controllers and then talk about how you can write your own admission
your own admission controller. controller.
## Standing up a Webhook from an Admission Controller ## Standing up a Webhook from an Admission Controller
@ -81,9 +81,10 @@ There is also a config map validation admission controller built in under
## Writing new Admission Controllers ## Writing new Admission Controllers
To implement your own admission controller akin to the resource defaulting and To implement your own admission controller akin to the resource defaulting and
validation controller above, you implement a `knative.dev/pkg/controller.Reconciler` as with validation controller above, you implement a
any you would with any other type of controller, but the `Reconciler` that gets `knative.dev/pkg/controller.Reconciler` as with any you would with any other
embedded in the `*controller.Impl` should *also* implement: type of controller, but the `Reconciler` that gets embedded in the
`*controller.Impl` should _also_ implement:
```go ```go
// AdmissionController provides the interface for different admission controllers // AdmissionController provides the interface for different admission controllers
@ -96,6 +97,6 @@ type AdmissionController interface {
} }
``` ```
The `Reconciler` part is responsible for the mutating or validating webhook configuration. The `Reconciler` part is responsible for the mutating or validating webhook
The `AdmissionController` part is responsible for guiding request dispatch (`Path()`) and configuration. The `AdmissionController` part is responsible for guiding request
handling admission requests (`Admit()`). dispatch (`Path()`) and handling admission requests (`Admit()`).