Skip to content

Commit

Permalink
upgrade to latest dependencies (#10861)
Browse files Browse the repository at this point in the history
bumping knative.dev/networking 088986a...d5e05ad:
  > d5e05ad Update common github actions (# 357)
  > 94bfc01 upgrade to latest dependencies (# 356)
bumping knative.dev/caching 1212288...d1dfa64:
  > d1dfa64 Update common github actions (# 428)
  > daa996f upgrade to latest dependencies (# 427)
bumping knative.dev/pkg 84c98f3...9039dc1:
  > 9039dc1 moved release docs to github.com/knative/release (# 2040)
  > 07b5ddf add demoteFunc controller option (# 2033)
  > 8a8de5f Move IsKProbe to drainer, since it's the only place it's used (# 2038)
  > 5367a43 Fix potential deadlock when k8s client is used (# 2031)
  > b5bf07b adding retry event count metric for source (# 2016)
  > 17a36e7 Format markdown (# 2037)
  > 29be1c1 Add the release badge for all of the repos (# 2035)
  > e90ac15 Remove the system.Clock and it's mock in a different location (# 2034)
  > 8a9bf76 Add symmetric filter helped based on OwnerRefable. (# 2032)
  > 29092fe Format markdown (# 2030)
  > d733bb4 Add nightly badged to release tables (# 2029)
  > 7b5bcc3 Use the constant for UserAgent (# 2028)
  > 86a8236 Format markdown (# 2025)
  > 6c2f94a Unregister views to avoid slow oom issue during meter cleanup (# 2005)
  > 7689cce Update common github actions (# 2024)
  > f4650d8 Add releasability badges for each repo (# 2023)
  > 584933f Format markdown (# 2022)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Mar 1, 2021
1 parent 0282521 commit 527416d
Show file tree
Hide file tree
Showing 30 changed files with 252 additions and 130 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ require (
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 // indirect
k8s.io/kube-openapi v0.0.0-20210113233702-8566a335510f
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 // indirect
knative.dev/caching v0.0.0-20210215030244-1212288570f0
knative.dev/caching v0.0.0-20210216192653-d1dfa6451cd1
knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf
knative.dev/networking v0.0.0-20210215030235-088986a1c2a3
knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a
knative.dev/networking v0.0.0-20210216193011-d5e05ad323f0
knative.dev/pkg v0.0.0-20210226182947-9039dc189ced
sigs.k8s.io/yaml v1.2.0
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1282,16 +1282,16 @@ k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ=
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/caching v0.0.0-20210215030244-1212288570f0 h1:gOZqiYCuEP0CzNFfeaqQmee7dPEk/mKIwl5Ss1lYxZQ=
knative.dev/caching v0.0.0-20210215030244-1212288570f0/go.mod h1:rAPalJe9Lx3jHffJpackk5WjZYl3j2QvXUgw0GPllxQ=
knative.dev/caching v0.0.0-20210216192653-d1dfa6451cd1 h1:0b3wT5a4/3djue61/5i3o1/H9TcL7Q7+YMM2MqZzOMw=
knative.dev/caching v0.0.0-20210216192653-d1dfa6451cd1/go.mod h1:1UeUQ6zQ3vHtZRpfuAW/f5oXb11EBqICfJqIzOeOrqU=
knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf h1:u4cY4jr2LYvhoz/1HBWEPsMiLkm0HMdDTfmmw1RE8zE=
knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/networking v0.0.0-20210215030235-088986a1c2a3 h1:viMEi8ob8FdeiIsiv0ww6eKgamS+YkTP3+u95qF4n/s=
knative.dev/networking v0.0.0-20210215030235-088986a1c2a3/go.mod h1:pmAMQjMqQUxpK0UyjE71KljMs6rwDMVIAlvrZsU3I6Y=
knative.dev/pkg v0.0.0-20210212203835-448ae657fb5f h1:pz+UDOTsCIClHXGM/SgCzkctLxgi3+P0C26x6Ujlqho=
knative.dev/pkg v0.0.0-20210212203835-448ae657fb5f/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY=
knative.dev/networking v0.0.0-20210216193011-d5e05ad323f0 h1:3TwevWoWJ/xlU1Bjzb3vtRRl1NfJWIJTkZb+1eNdW8k=
knative.dev/networking v0.0.0-20210216193011-d5e05ad323f0/go.mod h1:Crdn87hxdFd3Jj6PIyrjzGnr8OGHX35k5xo9jlOrjjA=
knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a h1:Jb8iKzfqhqwYoK9xHulmFdoscUBPLlXmBQMb2grTa78=
knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY=
knative.dev/pkg v0.0.0-20210226182947-9039dc189ced h1:OCtTbXsJhiR35qCDxFj9Xc8sU3i87ePbc7YlHCt0al4=
knative.dev/pkg v0.0.0-20210226182947-9039dc189ced/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY=
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/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ func NewImpl(ctx {{.contextContext|raw}}, r Interface{{if .hasClass}}, classValu
rec.skipStatusUpdates = true
}
{{- end}}
if opts.DemoteFunc != nil {
rec.DemoteFunc = opts.DemoteFunc
}
}
rec.Recorder = createRecorder(ctx, agentName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ func NewReconciler(ctx {{.contextContext|raw}}, logger *{{.zapSugaredLogger|raw}
rec.skipStatusUpdates = true
}
{{- end}}
if opts.DemoteFunc != nil {
rec.DemoteFunc = opts.DemoteFunc
}
}
return rec
Expand Down
7 changes: 7 additions & 0 deletions vendor/knative.dev/pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ func FilterControllerGK(gk schema.GroupKind) func(obj interface{}) bool {
}
}

// FilterController makes it simple to create FilterFunc's for use with
// cache.FilteringResourceEventHandler that filter based on the
// controlling resource.
func FilterController(r kmeta.OwnerRefable) func(obj interface{}) bool {
return FilterControllerGK(r.GetGroupVersionKind().GroupKind())
}

// FilterWithName makes it simple to create FilterFunc's for use with
// cache.FilteringResourceEventHandler that filter based on a name.
func FilterWithName(name string) func(obj interface{}) bool {
Expand Down
3 changes: 3 additions & 0 deletions vendor/knative.dev/pkg/controller/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ type Options struct {
// SkipStatusUpdates configures this reconciler to either do automated status
// updates (default) or skip them if this is set to true.
SkipStatusUpdates bool

// DemoteFunc configures the demote function this reconciler uses
DemoteFunc func(b reconciler.Bucket)
}

// OptionsFn is a callback method signature that accepts an Impl and returns
Expand Down
68 changes: 33 additions & 35 deletions vendor/knative.dev/pkg/metrics/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"errors"
"fmt"
"strings"
"sync"

"go.opencensus.io/resource"
"go.opencensus.io/stats/view"
Expand All @@ -32,9 +31,14 @@ import (
var (
curMetricsExporter view.Exporter
curMetricsConfig *metricsConfig
metricsMux sync.RWMutex
mWorker *metricsWorker
)

func init() {
mWorker = newMetricsWorker()
go mWorker.start()
}

// SecretFetcher is a function (extracted from SecretNamespaceLister) for fetching
// a specific Secret. This avoids requiring global or namespace list in controllers.
type SecretFetcher func(string) (*corev1.Secret, error)
Expand Down Expand Up @@ -154,28 +158,14 @@ func UpdateExporter(ctx context.Context, ops ExporterOptions, logger *zap.Sugare

// Updating the metrics config and the metrics exporters needs to be atomic to
// avoid using an outdated metrics config with new exporters.
metricsMux.Lock()
defer metricsMux.Unlock()

if isNewExporterRequired(newConfig) {
logger.Info("Flushing the existing exporter before setting up the new exporter.")
flushGivenExporter(curMetricsExporter)
e, f, err := newMetricsExporter(newConfig, logger)
if err != nil {
logger.Errorw("Failed to update a new metrics exporter based on metric config", zap.Error(err), "config", newConfig)
return err
}
existingConfig := curMetricsConfig
curMetricsExporter = e
if err := setFactory(f); err != nil {
logger.Errorw("Failed to update metrics factory when loading metric config", zap.Error(err), "config", newConfig)
return err
}
logger.Infof("Successfully updated the metrics exporter; old config: %v; new config %v", existingConfig, newConfig)
updateCmd := &updateMetricsConfigWithExporter{
ctx: ctx,
newConfig: newConfig,
done: make(chan error),
}

setCurMetricsConfigUnlocked(newConfig)
return nil
mWorker.c <- updateCmd
err = <-updateCmd.done
return err
}

// isNewExporterRequired compares the non-nil newConfig against curMetricsConfig. When backend changes,
Expand Down Expand Up @@ -228,27 +218,35 @@ func newMetricsExporter(config *metricsConfig, logger *zap.SugaredLogger) (view.
}

func getCurMetricsExporter() view.Exporter {
metricsMux.RLock()
defer metricsMux.RUnlock()
return curMetricsExporter
readCmd := &readExporter{done: make(chan *view.Exporter)}
mWorker.c <- readCmd
e := <-readCmd.done
return *e
}

func setCurMetricsExporter(e view.Exporter) {
metricsMux.Lock()
defer metricsMux.Unlock()
curMetricsExporter = e
setCmd := &setExporter{
newExporter: &e,
done: make(chan struct{}),
}
mWorker.c <- setCmd
<-setCmd.done
}

func getCurMetricsConfig() *metricsConfig {
metricsMux.RLock()
defer metricsMux.RUnlock()
return curMetricsConfig
readCmd := &readMetricsConfig{done: make(chan *metricsConfig)}
mWorker.c <- readCmd
cfg := <-readCmd.done
return cfg
}

func setCurMetricsConfig(c *metricsConfig) {
metricsMux.Lock()
defer metricsMux.Unlock()
setCurMetricsConfigUnlocked(c)
setCmd := &setMetricsConfig{
newConfig: c,
done: make(chan struct{}),
}
mWorker.c <- setCmd
<-setCmd.done
}

func setCurMetricsConfigUnlocked(c *metricsConfig) {
Expand Down
Loading

0 comments on commit 527416d

Please sign in to comment.