Commit Graph

11 Commits

Author SHA1 Message Date
Dave Protasowski ee1db869c7
Update linter config and address lint warnings/failures (#3068)
* fix whitespace linter

* fix usestdlibvars

* fix staticheck

* ignore spancheck warning

* fix linter perfsprint

* fix nolintlint feedback

* fix nilerr lint checks

* fix misspell

* fix mirror lint

* fix intrange linter

* fix gofumpt linter

* fix gosec linter - ignore warning since default min tls version is 1.3

* fix gocritic linter

* fix whitespace

* fix fatcontext linter

* fix errorlint

* fix errname linter

* fix copyloopvar (go1.22) linter

* fix bodyclose linter

* update linter config

* add script to format code

* fix unit test
2024-06-25 14:49:36 +00:00
Dave Protasowski 8535fcc248
gofumpt the repo (#3067)
* gofumpt the repo

* don't prefix numbers with 0 - otherwise they're octal
2024-06-25 07:27:07 +00:00
Victor Agababov a371418524
v2 (#1754) 2020-09-29 13:18:29 -07:00
Markus Thömmes 07fa902e49
Enhance error message on failure to update _example. (#1698)
We still see users frequently struggle with this and the error message seemingly doesn't help them. This gives a more explicit description of what the user can do to fix the situation.
2020-09-10 07:18:51 -07:00
Dave Protasowski caa444033b
use crd & webhook v1 APIs (#1391) 2020-06-19 08:43:25 -07:00
Markus Thömmes f1416d3e62
Only validate ConfigMaps the webhook knows about. (#1395) 2020-06-09 10:29:32 -07:00
Julian Friedman 7b4093b435
Use annotation rather than label for configmap checksum (#1380) 2020-06-05 04:26:17 -07:00
Markus Thömmes f45b641fc2
Check example-checksum label for consistency in ConfigMap webhook. (#1366)
* Check example-hash label for consistency in ConfigMap webhook.

We've seen users try to edit our configuration and falling into the trap of editing the '_example' block a lot. This attempts at guiding the users to do "the right thing" by checking the ConfigMap's '_example' value (if present) against a precomputed hash of the same value (if present). The idea is that we precompute this has using the tool herein in code generation and thus allow us to easily change the example block automatically while making it hard to change it on ppurpose. If the hashes don't match on an upgrade, the webhook will return an error synchronously, guiding the user to the correct behavior.

* Add tests.

* Add hash check to test utilities.

* Add a bit of coverage.

* Rewrite into a table test.

* Rename.

* Reduce test surface.

* Godoc.

* Code nits.

* Docs.

* Use CRC32.

* Nits.
2020-06-02 10:48:17 -07:00
Matt Moore 1893541a0f
Scope the webhook secret informers to the system namespace. (#1158) 2020-03-12 18:29:29 -07:00
Victor Agababov 06d6b25dd6 Remove panics from the test and use t.Fatalf instead (#906) 2019-11-26 15:21:21 -08:00
Matt Moore d4ce001394 This refactors our core webhook logic to be reconciler-based. (#833)
This is the culmination of a large number of changes to refactor our webhook logic, and adopt a reconciler-based approach to make it resilient to unexected system events (e.g. rogue GCs!).

For more details on how this is consumed, see the new `webhook/README.md`.

Fixes: https://github.com/knative/pkg/issues/782
Closes: https://github.com/knative/pkg/issues/529
Fixes: https://github.com/knative/pkg/issues/450
Related: https://github.com/knative/pkg/issues/141
2019-10-31 10:17:13 -07:00