Commit Graph

19 Commits

Author SHA1 Message Date
Victor Agababov 73daad6e47 Ignore idempotent updates and other cleanups (#598)
* Ignore idempotent updates and other cleanups

This makes sure we don't call the configmap update on the idempotent updates, which we get now and
that causes us lots of global resyncs. (┛◉Д◉)┛彡┻━┻.

In addition I went ahead and applied some nitpicking to the code.

/assign mattmoor

* fix races

* resync to zero
2019-08-26 07:04:14 -07:00
Martin Gencur 366ab85660 Profiling support (#562)
* Profiling support

* Move ProfilingPort to profiling package

* Fix golint errors

* Refactor watcher to accept variable length observers

* Cleaner happy path

* Remove profiling handlers argument

* use :8008 string as const

* Make the profiling port package private

* Make UpdateFromConfigMap member of profiling handler

* use mutex when accessing the enabled flag
* test the server as well

* Fixes

* Initialize profiling from configMap at startup

* Use httptest.ResponseRecorder to make the test more lightweight

* Fixes

* Do not initialize from configmap at startup
2019-08-22 08:17:33 -07:00
Matt Moore 6785699dc3 Revert "Remove reflection from generic store code. (#583)" (#585)
This reverts commit d6f38dd906.
2019-08-20 19:17:32 -07:00
Markus Thömmes d6f38dd906 Remove reflection from generic store code. (#583) 2019-08-20 10:38:31 -07:00
Victor Agababov 12ee58e32c Fix licence to have spaces and comment to match the function (#580) 2019-08-17 16:18:34 -07:00
Victor Agababov 4f3cebba76 This prints better log when CM is loaded. (#548)
Now we just print a struct, which is unparseable.
With this change in hand each field will have a name.

/assign @mattmoor
2019-07-29 15:23:42 -07:00
Victor Agababov 74c5d67ea0 Fix the issues pointed out by staticcheck (#541)
* Fix the issues pointed out by staticcheck

* review fix
2019-07-23 13:13:36 -07:00
mattmoor-sockpuppet 1864f499dc golang format tools (#497)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign @mattmoor
2019-06-27 07:37:08 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Matt Moore 35a6f90d16 Sprinkle more ClearAll around to enabled -count=N (#485) 2019-06-23 19:24:02 -07:00
Markus Thömmes b35531d473 Move ExampleKey constant to 'official' package. (#481) 2019-06-23 08:08:57 -07:00
Adriano Cunha c0132d9dde Update OWNERS to use OWNERS_ALIASES (#422) 2019-05-29 20:04:33 -07:00
mattmoor-sockpuppet 34792a92ce golang format tools (#419)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
2019-05-18 10:35:26 -07:00
Adam Harwayne 5548112eb7 Defaulting watcher (#415)
* Add configmap.DefaultingWatcher that allows watched ConfigMaps to be defaulted in code.

* Add a test where the real K8s CM is deleted.

* Remove unused cmName.

* WatchWithDefault after start panics.

* cfgs -> defaults

* Initialize defaults in NewInformedWatcherFromFactory.

* Remove unneeded error in panic.
2019-05-16 07:09:18 -07:00
Scott Nichols 418e675f88 Moving reconcile/testing from serving to pkg. (#387)
* Moving reconcile/testing from serving to pkg.

* add clock.

* Update clock cw.

* move testing/configmap.go to configmap/

* wire in a setable context.

* need to export example key.
2019-04-17 08:19:28 -07:00
Ivan Mikushin 62bcfe912f Prepare for global resync on ConfigMap changes (#132)
* Prepare for global resync on ConfigMap changes

- Add GlobalResync(cache.SharedInformer) method to *controller.Impl
- Move UntypedStore from serving/pkg/config to pkg/configmap
- Add onAfterStore callbacks to UntypedStore
- Add TypeFilter to enable composable construction of such callbacks

* Address review

- Unit test GlobalResync()
- Reimpl GlobalResync() using ListKeys()

* Update comments

* Add test for onAfterStore

* Update godoc comment for Logger
2018-10-18 09:47:28 -07:00
Matt Moore 1f153817b2 Extend the resync period for `configmap`. (#115)
Fixes: https://github.com/knative/pkg/issues/114
2018-10-07 04:26:25 -07:00
Dave Protasowski 8fc80deb20 Few changes to the configmap package (#59)
* Few changes to the configmap package

- New* methods return concrete types
- defaultImpl is now InformedWatcher
- fixedImpl is now StaticWatcher
- Included a new ManualWatcher that mimics the InformedWatcher
  in behaviour. ie. allows updates - making this a true 'mock'

* Include note about embedding the ManualWatcher in the InformedWatcher

* Update static_watcher.go

Fix some godoc
2018-09-12 07:42:16 -07:00
Matt Moore f8e84c0d02
Copy `pkg/configmap` over from `knative/serving`. (#11) 2018-07-25 14:56:29 -07:00