Commit Graph

1827 Commits

Author SHA1 Message Date
Roland Huß e6e3cf03d7
Adding code of conduct to reference knative/community's CoC (#2470) 2022-03-18 11:55:21 -07:00
knative-automation 26a8fea3a5
Update community files (#2468)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-18 11:33:19 -07:00
Dave Protasowski 7f16595277
bump k8s deps to v0.23.4 (#2458) 2022-03-18 06:34:18 -07:00
Nghia Tran 3a4cc56708
Add configmap informer factory (#2466) 2022-03-15 17:29:59 -07:00
Nader Ziada 13bdd74cbd
add popany to bucketer (#2445) 2022-03-15 08:28:03 -07:00
Ville Aikas 616f1ab878
Add genreconcile for NetworkPolicy. (#2465)
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
2022-03-15 02:56:03 -07:00
Enrique Encalada 721abec0a3
Bump prometheus/client_golang to v1.11.1 (#2450)
In order to address CVE [CVE-2022-21698](https://github.com/advisories/GHSA-cg3q-j54f-5p7p)
2022-03-14 10:07:18 -07:00
knative-automation a5ba81d7a9
Update community files (#2461)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-14 09:56:18 -07:00
Pierangelo Di Pilato 3c4dec9b9f
Take pointer to map in AsOptionalMap for consistency (#2460)
* Take pointer to map in AsOptionalMap for consistency

- Other `As*` functions take pointers.
- It avoids having to initialize the map passed to the function

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Remove double pointer

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* AsOptionalMap -> CollectMapEntriesWithPrefix

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-03-14 09:45:18 -07:00
Pierangelo Di Pilato ce6f2877ce
Initialize prefix remapping map to avoid panic (#2453)
A `nil` `target` passed to `AsOptionalMap` causes a panic.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-03-10 10:24:48 -08:00
knative-automation 78fdd53826
Update community files (#2456)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-10 10:12:48 -08:00
Pierangelo Di Pilato a850b9e047
Use t.Setenv instead of os.Setenv in tests (#2454)
Go 1.17 introduced a new handy API for setting env vars scoped for
a single test so we can avoid the hard to read set and reset env
loops.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-03-10 10:00:48 -08:00
knative-automation d2cdc682d9
Update community files (#2451)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-02 05:46:43 -08:00
knative-automation 2fdd5f232e
Update actions (#2449)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-01 10:19:42 -08:00
Dave Protasowski 76a28b066d
set git user name/email prior to merging upstream (#2448) 2022-03-01 07:09:41 -08:00
Pierangelo Di Pilato fe26417344
Allow overriding lease name for a reconciler (#2435)
Add a `map-lease-prefix` prefix for config keys for
`config-leader-election` that is a map from a generated lease prefix
to a new prefix:

```yaml
map-lease-prefix.<component>.<package>.<reconciler_type_name>: <new_prefix>
map-lease-prefix.<component-x>.<package-x>.<reconciler_type_name-x>: <new_prefix>
```

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-02-28 11:55:09 -08:00
Todd 9b5c41135d
allow overriding the default grace period of 45 seconds (#2423)
This allows users to configure a faster restart of their
webhook if desired while retaining the current behavior.
2022-02-28 11:40:09 -08:00
Pierangelo Di Pilato 4c2331f26a
Bump golang.org/x/crypto (#2444)
Run:
```
go get -u golang.org/x/crypto/...
./hack/update-deps.sh
```

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-02-28 11:21:10 -08:00
knative-automation 708dc1cc48
Update community files (#2443)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-25 08:11:42 -08:00
knative-automation 062ca30c05
upgrade to latest dependencies (#2433)
bumping knative.dev/hack 0456e8b...e178598:
  > e178598 Update community files (# 157)
  > cf8cbc0 Fix the regex used for matching GitHub Actions files (# 156)
  > a8ef7b6 Skip presubmit tests for .github updates (# 154)

Signed-off-by: Knative Automation <automation@knative.team>
2022-02-24 18:16:41 -08:00
knative-automation 4fcbc1bc12
Update actions (#2434)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-23 10:09:40 -08:00
Dave Protasowski 80c511aa34
Wait for reconciler/controllers to return prior to exiting the process (#2437) 2022-02-22 13:12:04 -08:00
knative-automation d481724519
Update community files (#2428)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-17 07:51:12 -08:00
knative-automation 9ea81766b5
Update actions (#2430)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-17 07:39:13 -08:00
knative-automation 0caafcbeb0
upgrade to latest dependencies (#2429)
bumping knative.dev/hack 7331bb1...0456e8b:
  > 0456e8b Update community files (# 152)
  > b9cb198 Update community files (# 151)
  > 0e30607 Update kntest path after https://github.com/knative/test-infra/pull/3087 (# 150)

Signed-off-by: Knative Automation <automation@knative.team>
2022-02-17 07:28:20 -08:00
Billy Lynch 3b550aff99
changeset: Look in packed-refs file if ref file not found. (#2425)
If you have a lot of refs in a repo, git will eventually start
condensing them into a single file instead of letting them sprawl out in
separate directories on the filesystem. This change lets the changeset
package use the packed-refs file as a fall back in the event that the
ref file is not found.

See https://git-scm.com/docs/git-pack-refs for more details on packed
refs.
2022-02-17 07:28:13 -08:00
Chunyi Lyu 5e98acda85
Make URL compatible with controller-gen (#2431)
- add kubebuilder marker so CRDs using URL could be
generated with controller-gen
- same change but on VolatileTime: https://github.com/knative/pkg/pull/2104
2022-02-17 06:50:12 -08:00
knative-automation 3c00bb0157
Update community files (#2426)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-15 07:34:00 -08:00
knative-automation fc93ac76d0
upgrade to latest dependencies (#2424)
bumping knative.dev/hack 51a42b2...7331bb1:
  > 7331bb1 rename function (# 149)
  > 9b303d6 Update community files (# 148)
  > 82bfca1 Update community files (# 147)

Signed-off-by: Knative Automation <automation@knative.team>
2022-02-10 12:19:07 -08:00
knative-automation 51be315ed1
Update community files (#2419)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-02 18:09:20 -08:00
knative-automation b619c92456
Update actions (#2417)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-02 05:26:33 -08:00
knative-automation bab3d0d472
Update actions (#2413)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-01 08:39:33 -08:00
Matthias Wessendorf 671e46d0cc
💫 we must use `flags` instead of `pflags`, since this is not working. It seems like pflag.* adds the var to its own flag set, not the one package flag uses, and it doesn't expose the internal flag.Var externally - hence this fix. (#2414)
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
2022-02-01 08:28:38 -08:00
knative-automation 7880fb407b
Update community files (#2412)
Signed-off-by: Knative Automation <automation@knative.team>
2022-02-01 08:28:32 -08:00
Martin Gencur 8681fe2035
Continual tests logging within test scope (#2293)
* Continual tests logging within test scope

* Make ThreadSafeBuffer unexported

* logBuffer private on BackgroundContext

* log the buffer in Setup phase on success as well

* Use AddCaller and Development for actual (non-test) logging

* Highlight background logs

* Initial newline for background logs

* Remove space before Background log end

* Style

* Pass LogConfig instead of Log

* Introduce new typ Configuration.LogConfig that is accepted by the Execute function. This
  type holds the zap logger configuration and a custom build function for producing
  the resulting logger.
* The zap Config can be reused to produce the internal logger for background tests. This
  way the background logger can share most configuration with the main framework logger.
* Keep the Configuration.Log variable for backwards compatibility reasons. It's used when
  no Configuration.LogConfig is defined.
* Modify tests to use a background test logger in Continual/Background tests
  so that we can verify those tests are executed correctly.

* Review changes

* Wrapping logs back to testing.T

* Write background logs before AND after Verify phase

* To prevent losing background logs when the Verify phase calls t.Fail
or t.Skip

* Use InMemoryLogger in setup phase as well

* that's where the logger is passed to tests and its background
operations (e.g. prober)

* Verify background logs for skipped test

* Add TestFailAtBackgroundVerification and rename the test file

* the file now includes more tests for the background verification
phase, not just "skip"

* Simplify verifyBackgroundLogs and remove redundant suffix for logs

* Better zap Config default value

* Override output paths if set to default value

* Do not pass zap.Config by reference

* Trigger checks

Co-authored-by: Chris Suszyński <ksuszyns@redhat.com>
2022-02-01 05:20:31 -08:00
Pierangelo Di Pilato f4b57aef00
Fix invalid creator or lastModifier annotations on core resources (#2409)
When the admission request is for a resource with an empty string as
group, which happens on core resources, the `creator` or `lastModifier`
annotations are invalid since they become `/creator` or
`/lastModifier`.

This patch removes the `/` when group = `""`.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-01-31 06:49:30 -08:00
knative-automation 21b467ba3f
upgrade to latest dependencies (#2406)
bumping knative.dev/hack 9b2ed84...51a42b2:
  > 51a42b2 Update community files (# 146)
  > 81ef5cc Update community files (# 145)
  > cfb3eb8 Enable opting out Preemptible/Spot GKE Worker Nodes (# 144)
  > 9dd1ec1 Look at package name when checking whether the shell package can be used (# 142)
  > f1822b1 Disable Logs/Metrics on GKE and Run Preemptible Nodes (# 138)
  > 32375dc remove clusteradmin grant (# 141)
  > 987528e Temporarily fix the unit tests for library.sh (# 143)
  > da09733 print commit hash (# 140)

Signed-off-by: Knative Automation <automation@knative.team>
2022-01-31 06:38:30 -08:00
knative-automation ca64d3b3ea
Update community files (#2404)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-29 08:01:48 -08:00
Kenjiro Nakayama 2783cd8cfa
Do not block NotFound error during patching resources (#2403)
storage-version-migration-serving crashes if ksvc deleted during
migration.

Please refer to the following error especially
`services.serving.knative.dev \"receiver261\" not found` message.

```
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.840090884Z","caller":"logging/config.go:116","message":"Successfully created the logger."}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.840350704Z","caller":"logging/config.go:117","message":"Logging level set to: info"}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.840399959Z","caller":"logging/config.go:79","message":"Fetch GitHub commit ID from kodata failed","error":"\"KO_DATA_PATH\" does not exist or is empty"}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.854296148Z","logger":"storage-migrator","caller":"migrate/main.go:60","message":"Migrating 4 group resources"}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.85439718Z","logger":"storage-migrator","caller":"migrate/main.go:63","message":"Migrating group resource services.serving.knative.dev"}
{"severity":"EMERGENCY","timestamp":"2022-01-25T14:17:47.601002153Z","logger":"storage-migrator","caller":"migrate/main.go:65","message":"Failed to migrate: unable to patch resource kc-broker-newsubs-kn-0/receiver261 (gvr: serving.knative.dev/v1, Resource=services) - services.serving.knative.dev \"receiver261\" not found","stacktrace":"main.main\n\t/opt/app-root/src/go/src/knative.dev/serving/vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate/main.go:65\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:255"}
```

It could be a rare case but it happens when an user delete their
resource during storage-version-migration-serving is running.

This patch fixes the issue by ignoring the NotFound error during
patching resources.
2022-01-28 06:59:47 -08:00
Chris Suszynski d7b329c360
🐛 Update required Go version to 1.17 to fix #2399 (#2400)
* Update required Go version to fix #2399

* Running `hack/update-deps.sh`
2022-01-26 13:42:46 -08:00
Pierangelo Di Pilato 3ba5d72e31
Don't discard addressable resolver original errors (#2395)
Errors from the tracker or the addressable resolver factory
are discarded which isn't helpful for debugging since the
error is generic `kafkachannels "Lister" not found`.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-01-21 01:23:05 -08:00
knative-automation 77555ea48c
upgrade to latest dependencies (#2398)
bumping knative.dev/hack 59b0cf1...9b2ed84:
  > 9b2ed84 Update community files (# 139)

Signed-off-by: Knative Automation <automation@knative.team>
2022-01-18 08:05:32 -08:00
Dave Protasowski 768f44f3fc
bump our min version to 1.21 (#2397) 2022-01-18 07:11:32 -08:00
knative-automation e989c22732
Update community files (#2393)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-17 18:57:32 -08:00
Pierangelo Di Pilato 0a429cba1c
Allow Unstructured callback from Defaulting Webhook (#2363)
* Add support for callback defaults

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Put unstr object in ctx and set user info

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Move get callback at the top

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Panic when using delete verb

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Split tests and add callback ctx tests

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Set user info annotations

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Register Webhook Rules from callbacks

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>

* Adapt unstructured objects to apis.HasSpec

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Change json tag name to match struct field name

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-01-14 06:18:42 -08:00
knative-automation c0e1594c2f
Update actions (#2392)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-12 20:59:12 -08:00
Evan Anderson 1db74d0a18
Adjust leaderelection defaults, add documentation. (#2391) 2022-01-12 20:43:12 -08:00
Pierangelo Di Pilato 2b23ad111b
Simplify URI creation in source validation tests (#2389)
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-01-12 10:19:51 -08:00
Dave Protasowski c568527ffc
Fixes #2308 TestSpoofingClient_WaitForEndpointState flake (#2387) 2022-01-11 23:42:50 -08:00
knative-automation b90b853c52
upgrade to latest dependencies (#2388)
bumping knative.dev/hack f08cb0d...59b0cf1:
  > 59b0cf1 Proper search for tags in Go files only (# 135)

Signed-off-by: Knative Automation <automation@knative.team>
2022-01-11 19:13:50 -08:00