* Start the webhook before informers sync.
Some webhooks (e.g. conversion) are required to list resources, so by delaying those until after informers have synced, we create a deadlock when they run in the same process. This change has two key parts:
1. Start the webhook immediately when our process starts, and issue a callback from sharedmain when the informers have synced.
2. Block `Admit` calls until informers have synced (all conversions are exempt), unless they have been designated by implementing `webhook.StatelessAdmissionController`.
Our built-in admission controllers (defaulting, validation, configmap validation) have all been marked as stateless, the main case where we want to block `Admit` calls is when we require the informer to have synchronized to populate indices for Bindings.
* Add missing err declaration
* update go-cmpt to work with 1.14.
Mostly to fix https://github.com/google/go-cmp/issues/167, but we also pinned at some
random commit, rather than at a release version.
* add new pkg
* Make sure we use same versions in pkg and serving
* genreconciler:nonNamespaced
* Adding a force-kinds flag to the reconciler generator to allow us to generate reconcilers for non-owned types.
* force-kinds --> force-genreconciler-kinds
* some minor nits with the generators for non-knative types needed to be removed.
* remove whitespace
Co-authored-by: Nacho Cano <nachoacano@gmail.com>
* update go-cmpt to work with 1.14.
Mostly to fix https://github.com/google/go-cmp/issues/167, but we also pinned at some
random commit, rather than at a release version.
* add new pkg
* Add MarkTrueWithReason function to ConditionManager
When using `MarkTrue()` function, it does not allow us to add the reason and message.
Also, if we use `SetCondition()` instead, it does not update the happy condtion.
So, this PR adds new `MarkTrueWithReason(reason, message)` function.
* Make test better
* Add unit test for MarkTrueWithReason
* Rename markHappy with recomputeHappiness
* add a function to parse all env config set by Prow
* fix unit tests
* address comments
* address comments again
* address comments2
* address comments
In general, imo, it's prettier to return things as is, rather than the pattern that was
there.
Also handle one more error case, which was kind of ignored before (probably in practice
impossible, but idk)
* Add leader election config and to sharedmain
* Add new dependencies
* Extract method for RunLeaderElected
* Make leader election config constructor validate
* Rename leader election files
* Always start profiling server whether component has LE lock or not
* Fix entering unreachable section when leader election is disabled
* Address PR feedback
* Revert "Add support for client TLS to pkg/metrics (#1045)"
This reverts commit 945b556708.
* Roll forward "Add support for client TLS to pkg/metrics (#1045)"
Adds support for client TLS certs for opencensus export
* Switch sharedmain to only pass a getter rather than an all-namespace lister.
* Add a TODO about using a cached copy if this generates undue load
* Update deps per build failure.
* Refactor per @anniefu suggestion
* An oversight left the gen test client around and it is causing issues with other automation that did not gen the test client because of deps changes.
* new better way to test codegen
* Renews a webhook cert before it expires
* Moved checks out of webhook and into certificate
* Updated error messages and others from review
* Updated error messages and changed time comparison
* Added two tests cases for checking expiration
* Fixed issue with missing "." in webhook.go
* Realized a corner case on ordering and False > Unknown states.
* add test with unknown fall through.
* I guess some integartions allow nil happy
* add unit tests for GetMessage and GetReason
* all conditons can be nil.
* Search for unhappy dependents.
* update codegen
* Remove KResource from v1alpha1 ducks.
* Create TLogger, bringing leveled logging to tests
Inspired heavily by go-logr, brings leveled logging to tests while
using the highly reliable zap logger backend to fulfill writing to
multiple log files.
Now that metrics logger has been removed, SetupLoggingFlags() is redundant. Moved to test/logging
* Cleanup TLogger and document
Add TLogger.Collect() to support collecting outcomes (either positive
strings or error types) which will be processed in a subtest upon
completion of the currently-running (sub-)test.
StructuredError prints its output in a more-readable form now.
Call-site should now work for .Log/.Logf-using functions.
Use cancel from NewTLogger instead of t.CleanUp()
Use a zapcore SpewEncoder when writing to testing.T
Means even non-json-encodable structs will get printed to the test log
output, while preserving encodable structured output for other log files.
Removed timestamp from printing to t.Log
* Fix the automatically-detected issues
Spelling, codegen, some coverage (coverage of memory_encoder.go should
not be necessary but the coverage tool is broken and needs to be fixed).
* Increase unit test coverage slightly and fix tiny comment
* Set attribute the way the coverage program wants
* Cleanup based on notes
* Comment cleanup and privitize var
* Mistake; left purposely-failing tests enabled
* Reduce long lines
* Consolidate cleanup code; make variable expressive
* Cleanup and bugfix
Failing functions now tested by having an internal constructor
option to skip calls to t.Fail()/t.FailNow().
Fixed some bugs with internal method errorWithRuntimeCheck and added
tests for it.
Address minor typos from comments.
* Tiny name/optimization fixes