Commit Graph

2098 Commits

Author SHA1 Message Date
Vincent Demeester dc1fae1337
changeset: allow override the revision through ldflags (#2601)
The main reason for this is to support cases where the `go build`
happens on a non git folder but we want to pass a revision anyway.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2022-11-02 20:10:08 +00:00
Matt Moore 92ed919344
Fix: Mute the linter on error return values. (#2627)
🐛 My previous change has revive/stylecheck warnings because I made the `warn` return value `[]error` and it wants the `error` last, which is kind of silly.

This mutes the linter on this signature, since it hits both revive and stylecheck

/kind bug
2022-11-02 19:46:06 +00:00
Dave Protasowski 8fa1a3f55b
CmpOpts overrides should be passed through (#2621) 2022-11-01 14:38:11 +00:00
Dave Protasowski 64fc3e502d
ListPointer flag should also apply to filtered informers (#2620) 2022-11-01 14:38:05 +00:00
Matt Moore 2f194914a4
Feature: Implement Apply codegen. (#2624)
🎁 Now that the K8s client libraries have an Apply method for the dynamic client, plumb it through the client code generation.

/kind feature
2022-10-31 20:24:13 +00:00
knative-automation 6eb8f1845a
Update community files (#2626)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-31 13:22:15 +00:00
Evan Anderson 5cbee02332
Filter reactor FieldErrors on validation to only error-level alerts. (#2611) 2022-10-29 20:00:09 +00:00
Matt Moore 198b463706
Cleanup: Turn multiple warnings into multiple warnings. (#2619)
🧹 Previously we lacked a public method for turning our `apis.FieldError` multi-error into a list of constituent error messages, so when we turned things into a webhook warning we simply used the combined serialization of all of the warnings.  Thanks to Nghia's recent change, we can now access the list of warnings to return as a list of errors.

/kind cleanup
2022-10-27 17:34:07 +00:00
Nghia Tran 728dfd8e28
Add FieldError#WrappedErrors to allow dependent code to have access (readonly) (#2618)
* Add FieldError#GetErrors to allow downstream reads

* Rename based on PR feedback

* Rename correctly for real

* Also expose `Normalized`

* WrappedErrors = merge(normalized)
2022-10-27 14:30:07 +00:00
Jonathan Innis 6ce976ce92
Default observability config if nil (#2614) 2022-10-25 20:08:56 +00:00
Dave Protasowski ff956846a1
make METRICS_DOMAIN optional when backend is not OpenCensus (#2617) 2022-10-25 18:42:56 +00:00
knative-automation b2a3a39d92
upgrade to latest dependencies (#2616)
bumping knative.dev/hack 3fdc50b...9d2ae47:
  > 9d2ae47 Update community files (# 241)
  > cf1a127 🎁 Use Knative ls-tags tool (# 238)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-25 16:07:56 +00:00
knative-automation 9823d960ed
Update community files (#2615)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-24 01:37:16 +00:00
Dave Protasowski 5dd89c68db
Support istio *List types where Items is an array of pointer types (#2613)
Generally K8s types have a list type where the 'Items' member is an
array of structs.

ie. https://pkg.go.dev/k8s.io/api@v0.25.3/apps/v1#DeploymentList

type DeploymentList struct {
	...
	// Items is the list of Deployments.
	Items []Deployment `json:"items" protobuf:"bytes,2,rep,name=items"`
}

Istio is an exception where the list contains pointers to structs

type GatewayList struct {
	...
	Items       []*Gateway `json:"items" protobuf:"bytes,2,rep,name=items"`
}

To hint that the list types are pointers you can now pass the flag
'--lister-has-pointer-elem'.

Ideally we could infer this info by inspecting the types but
unfortunately the generator doesn't load this information
2022-10-20 14:09:13 +00:00
Kenny Leung b812affa38
Support fetching observability from ctx. (#2610)
* add option to load observability config from ctx

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* comments and tests

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* undo

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* move observability setup logic into function to match logger

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* fix arg

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

Signed-off-by: Kenny Leung <kleung@chainguard.dev>
2022-10-14 16:45:53 +00:00
knative-automation 714b7630a8
upgrade to latest dependencies (#2609)
bumping knative.dev/hack 52a87e1...3fdc50b:
  > 3fdc50b Remove Signing Feature Gate (# 236)
  > 2d67db5 generate provenances (# 237)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-11 17:58:52 +00:00
knative-automation 21d3b47e2e
upgrade to latest dependencies (#2608)
bumping knative.dev/hack 7556452...52a87e1:
  > 52a87e1 Update community files (# 235)
  > 92a65f1 don't quote vars referencing files (# 234)
  > b3c9790 Notarize Mac binaries (# 231)
  > 0198902 Format go code (# 226)
  > 7dff557 Update community files (# 233)
  > 6887217 Update community files (# 232)
  > 9b76387 output certificate as well (# 229)
  > d1317b0 errexit and pipefail should remain off until downstream is fixed (# 228)
  > df80419 🐛 Fix for test failures of knative/serving# 13292 (# 227)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-10 14:30:36 +00:00
Nader Ziada 8178c38717
update k8s to 1.25.2 (#2599) 2022-10-07 21:10:32 +00:00
Pierangelo Di Pilato fb2e4fbaa4
Preserve webhook namespaceSelector.matchLabels (#2605)
* Preserve webhook namespaceSelector.matchLabels

I have a webhook with this definition and the reconciler is
removing the matchLabels field:

Current resource:
```
				  namespaceSelector:
				    matchExpressions:
				    - key: webhooks.knative.dev/exclude
				      operator: DoesNotExist
				  objectSelector:
				    matchLabels:
				      app.kubernetes.io/component: kafka-dispatcher

```

Applied resource:
```
				    namespaceSelector:
				      matchExpressions: [ ]
				      matchLabels:
				        app.kubernetes.io/name: knative-eventing
				    objectSelector:
				      matchLabels:
				        app.kubernetes.io/component: kafka-dispatcher
```

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

* Optimize cases that don't need ensureLabelSelectorRequirements

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

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-10-06 21:14:31 +00:00
knative-automation 5c5da2835a
Update actions (#2607)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-06 19:02:31 +00:00
knative-automation 1fb3e679f6
Update community files (#2606)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-06 01:36:30 +00:00
Paul Schweigert bc93b0add9
bump min kubernetes to v1.23 (#2595)
Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>

Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>
2022-10-05 16:45:29 +00:00
knative-automation 8cacac2ea6
upgrade to latest dependencies (#2604)
bumping knative.dev/hack b3c9790...92a65f1:
  > 92a65f1 don't quote vars referencing files (# 234)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-05 14:14:29 +00:00
knative-automation 158538cc46
upgrade to latest dependencies (#2603)
bumping knative.dev/hack 0198902...b3c9790:
  > b3c9790 Notarize Mac binaries (# 231)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-10-03 15:38:27 +00:00
knative-automation 7c4fef1af5
upgrade to latest dependencies (#2593)
bumping knative.dev/hack 7556452...0198902:
  > 0198902 Format go code (# 226)
  > 7dff557 Update community files (# 233)
  > 6887217 Update community files (# 232)
  > 9b76387 output certificate as well (# 229)
  > d1317b0 errexit and pipefail should remain off until downstream is fixed (# 228)
  > df80419 🐛 Fix for test failures of knative/serving# 13292 (# 227)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-09-30 12:47:18 +00:00
knative-automation 2b8e4ad44f
Update community files (#2602)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-09-29 01:39:17 +00:00
knative-automation 6d718681cd
Update community files (#2600)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-09-28 01:40:15 +00:00
Matt Moore d1d5c84907
Define a global for `reconciler.DefaultTimeout`. (#2597)
Serving currently uses a fixed constant for the context timeout on reconciliation, which is causing some bad interactions with certain policy webhooks.

Based on feedback on https://github.com/knative/serving/pull/13323 I am hoisting this into a shared variable, so that folks can turn it into a flag, so it is configurable.
2022-09-21 02:44:09 +00:00
Matt Moore df29e2a20a
Avoid second lister fetch during finalizer reconciliation. (#2596)
I noticed that the finalizer manipulation code was performing a second fetch of the resource from the lister cache to determine the differences in finalizers when the finalizers are being modify immediately above each callsite.

This changes both call sites to simply pass through the "desired finalizers" as a new parameter (instead of assigning them), which lets us use the unmodified resource and avoid the redundant lister cache fetch.
2022-09-20 22:43:09 +00:00
Sascha Schwarze 5f66ecf267
Allow configuration of threads-per-controller (#2567) 2022-09-14 15:47:04 +00:00
Pierangelo Di Pilato 717747b6ba
Register webhook GVKs for validating callbacks (#2590)
When a callback is registered for a gvk that isn't part of the
handlers that callback is never called since there is no webhook
rule associated with that GVK.

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

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-09-14 07:19:48 +00:00
knative-automation 501fbd54de
upgrade to latest dependencies (#2592)
bumping knative.dev/hack 36b2b3c...7556452:
  > 7556452 🎁 Use modscope tool to get info about Go modules (# 223)
  > 103cdb3 Default `SIGN_IMAGES` variable to `false` (# 225)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-09-13 15:04:50 +00:00
Dave Protasowski 3d24b8416b
fix lint warnings (#2589)
* resolve deprecation warnings

* drop use of ioutil

* fix license

* run hack/update-codegen.sh
2022-09-12 18:15:45 +00:00
knative-automation cc6e435120
upgrade to latest dependencies (#2587)
bumping knative.dev/hack 8d1e4cc...36b2b3c:
  > 36b2b3c add flag (# 224)
  > 547a2ca Start Signing our Releases (# 198)
  > 6c30196 🧹 Rewrite unit tests in Golang (# 215)
  > f9dc722 Format go code (# 218)
  > 664eac5 Fixing go.mod foreach (# 217)
  > 97fd663 🎁 Support multiple Golang modules in a single project (# 205)
  > f472a96 fix go run invocation of github hub cli (# 212)
  > 7d3bed1 go run... (# 210)
  > e81d63a Update community files (# 209)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-09-12 14:04:33 +00:00
Jonathan Innis 20aabd56be
Bump to k8s v0.24.4 client packages (#2586) 2022-09-09 15:07:30 +00:00
Paul Schweigert 2a05469a57
updates boilerplate action to use go v1.18 (#2588)
Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>

Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com>
2022-09-09 14:42:30 +00:00
Kenny Leung 93b66e6a87
Update: report stats for request (#2584)
* report stats for request

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* fix ref

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* fix import

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* update

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* gofmt

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* fix test

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

* fix boiler

Signed-off-by: Kenny Leung <kleung@chainguard.dev>

Signed-off-by: Kenny Leung <kleung@chainguard.dev>
2022-08-26 16:29:20 +00:00
Andrés Torres a650186419
Make request body available in admission context (#2583)
* Make request body available in admission context

Signed-off-by: Andrés Torres <andrest@vmware.com>

* Add newline at the end of file

Signed-off-by: Andrés Torres <andrest@vmware.com>

Signed-off-by: Andrés Torres <andrest@vmware.com>
2022-08-26 15:50:19 +00:00
Ville Aikas a6afcab5bd
Fix #2115, allow selective verbs / subresources for webhooks. (#2547)
* WIP: just one option exploration.

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>

* Another option. New signature and new type for configuration.

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>

* Use interfaces and type assertions.

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>

* log custom config with debug.

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>

* Address PR feedback.

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
2022-08-24 01:10:17 +00:00
Ville Aikas da7191979f
split warnings. Fix issue: 2581 (#2582)
* split warnings. Fix issue: 2581

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>

* Add tests for splits. Simplify.

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
2022-08-23 19:52:18 +00:00
knative-automation 0a3c1d6f19
upgrade to latest dependencies (#2580)
bumping knative.dev/hack d35c718...8d1e4cc:
  > 8d1e4cc fix go run invocation of github hub cli (# 213)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-08-23 14:36:17 +00:00
knative-automation 5fbe0c3f01
upgrade to latest dependencies (#2579)
bumping knative.dev/hack e9a8475...d35c718:
  > d35c718 [release-1.7] go run... (# 211)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-08-23 13:26:17 +00:00
knative-automation 2f06d64eed
Update community files (#2578)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-08-23 01:37:18 +00:00
Pierangelo Di Pilato 2e08ca63a9
WaitForServiceEndpoints doesn't take into account not found endpoint (#2576)
`Endpoints` are created asynchronously so it might not exists as soon
as a sertvice is created.

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

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-08-19 09:00:49 +00:00
Dave Protasowski 766f70d9cb
fix double close of channel (#2574) 2022-08-17 23:38:48 +00:00
knative-automation f78a006943
upgrade to latest dependencies (#2573)
bumping knative.dev/hack 782bbaa...e9a8475:
  > e9a8475 Update community files (# 208)
  > 4621ee6 Update community files (# 207)
  > 9dabf7c Update community files (# 206)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-08-16 15:35:47 +00:00
Dave Protasowski d02dcd0b03
allow drainer to be reset (#2572)
* allow drainer to be reset

* ensure Reset can be called multiple times

* add comment explaining the use of the channel

* bump tolerance as it flaked in actions

* update godoc

* fix linting and comments
2022-08-15 21:52:48 +00:00
Martin Gencur 894c2f20c9
SetupStaticPublishing and SetupDynamicPublishing returns Tracer with Shutdown function (#2566)
* SetupStaticPublishing and SetupDynamicPublishing returns OpenCensusTracer

* The caller can then call Finish() to properly flush buffered Spans
before shutdown

* Make sure the WithExporterFull checks if the config is nil

* Parse cfg.Backend only if config is not nil

Otherwise proceed futher and let globalOct.closer to be closed which
actually flushes the remaining Spans.

* Provide Tracer type with Shutdown function

* Provide backwards compatible API

* Never return nil Tracer

* Provide SetupPublishingWithDynamicConfigAndInitialValue

* Remove SetupDynamicPublishingWithInitialValue
2022-08-15 21:25:47 +00:00
Jason Hall 4f6a7753d1
Remove pkg/pool (#2568) 2022-08-15 21:08:48 +00:00
knative-automation 9a1245b7ec
Update actions (#2571)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-08-15 14:19:31 +00:00