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>
🐛 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
🧹 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
* Add FieldError#GetErrors to allow downstream reads
* Rename based on PR feedback
* Rename correctly for real
* Also expose `Normalized`
* WrappedErrors = merge(normalized)
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
* 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>
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>
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.
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.
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>
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>
* 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>
* 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>
`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>
* 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
* 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