Commit Graph

10 Commits

Author SHA1 Message Date
Julian Friedman 7b4093b435
Use annotation rather than label for configmap checksum (#1380) 2020-06-05 04:26:17 -07:00
Markus Thömmes b0dc3661a7
Use a hexadecimal representation for the example checksum. (#1374) 2020-06-03 08:33:18 -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
Markus Thömmes 1b903ad8cc
Fix malformed license headers. (#1258) 2020-04-29 08:38:42 -07:00
Victor Agababov f384223ab1
Make a proper check when checking for spaces. (#1206)
Mostly this covers tabs, but also other strange things, like carriage return :-)
2020-04-08 13:31:02 -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
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
Markus Thömmes b35531d473 Move ExampleKey constant to 'official' package. (#481) 2019-06-23 08:08:57 -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