* Implement RemoveCondition for ConditionManager
This implements RemoveCondition to remove a condition that matches
the condition type. Happy condition is changed appropriately if it
is a terminal and satifies one of the following conditions
1. RemovedCondition is false and happy is false
Happy can change from false to unknown or true
2. RemovedCondition is unknown and happy is unknown
Happy can change from unknown to true
* comment edit
* Addresses review comments
* Support only non terminal conditions
* Fix check
* Improve kmp.ShortDiff when one object is invalid
* Both are invalid throw an error
* If x is invalid and y is valid, add '+' prefix and no '-'
* If x is valid and y is invalid, add '-' prefix and not '+'
* * Extract diffString method for reduce duplicated code
* Add a map with missing key test case
* * Direct return diff string
* Map add a key unit test
* Change 'updater' to 'lastModifier' in webhook
Both eventing and serving curretly use lastModifier. Nothing seems to
implement the pkg 'HasSpec' interface yet so this should be a safe
change. This brings the annotation in-line with currentb behavior
Fixes#511
* Remove unnecessary defer
* Change paths in json patches
* Prevent nil StatsReporter for existing webhook package consumers
* Pass StatsReporter by pointer and have tests test constructor
* Make constructor return error instead of panicking
* Move StatsReporter to ControllerOptions to consolidate constructors
* Add metrics to webhook package
Add metricstest package for shared helper functions for testing metrics
* Address PR
* Cleanup
* Fix import paths to fix build issues
* Fix import package path for test file
* Remove unnecessary formatting from error message
* Remove helper function only used once
* Add metric name to all error messages, make checkRowTags testing helper function
* Add common histogram bucket generator function to metrics package
* Fix CheckStatsNotReported check
* Reset metrics before each test so the tests are idempotent
* Make CheckStatsNotReported conditional clearer
* #457 Duck type user annotation logic
* #457 Duck type user annotation logic - tests
* #457 Revert updater annotation key from lastModifier to updater
* #457 Rename HasSpec#GetSpec() to HasSpec#GetUntypedSpec()
* #457 Fix some indentation
* #457 Get group for user info annotations from the request
* #457 Reduce confusuion in webhook testing by using same group
In our structured logging we use `logger.Errorw(..., zap.Error(err))` to log errors in a structured way. As such, they are not part of the actual log message. They are however of utmost importance when debugging issues so this adds `err={ERROR}` to the logline if the error key is present and not empty.
Stop using `t.Run` to segment things, since they aren't truly independent tests.
Use a longer lease/sleep as I have concerns that slow execution may be a part of the flakiness here.
* Enrich the logs streamed in tests with useful information.
- Level is very useful to spot errors at a glance.
- Time is very helpful to be able to order the statements and notice time gaps.
- Key helps identifying which ressource is being reconciled (could be a child resource).
* Adjust timestamp, reduce level to only the first char.