This PR adds facilities to make it easier to create both components of a Binding
over "Pod Spec"-able resources. Rather than rehashing it all here, please look
at `./pkg/webhook/psbinding/README.md` for more details.
I'm splitting this off of another change that needed them, the three changes are:
1. Give the PostConditions callbacks in TableRow access to the Reconciler
resource. It turns out this is incredibly useful to have the `TableRow`
program an admission controller and then test that programming by calling
`Admit()`.
1. Surface the test resources in our webhook "listers", and add the testing
scheme.
1. Change the `objKey` to only use reflection as a fallback. The existing logic
doesn't work properly when a mix of real resources and unstructured.Unstructured
is used for the same resource.
* Added WaitForPodState to wait a state of a single pod
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Added WaitForServiceEndpoints
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Changes from review
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Change from review
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* #2047 sources-controller can't recover from faulty sink (in eventing)
* #2047 sources-controller can't recover from faulty sink (in eventing)
* add unit test
* change after review
* change after review-2
Co-Authored-By: Victor Agababov <vagababov@gmail.com>
This adds a ToUnstructured method to complement the FromUnstructured method
we have had for some time. The ToUnstructured method is effectively scoped
to Knative-style types since we expect it to implement both kmeta.Accessor
and kmeta.OwnerRefable in order to ensure that the TypeMeta is always
properly populated.
This augments the injection codegen with the capability to produce a duck.InformerFactory
attached to context for each type that we process.
Now a `duck.InformerFactory` for "Addressable" can be produced by "Get"ing it from the context.
This is triggered by placing `// +genduck` on the type that implements `duck.Implementable`.
* mako-stub now writes columns before the message output
mako-stub now REQUIRES the dev.config in the config-mako ConfigMap
mako-stub waits a configurable time for the stdout flush
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* mako-stub serves results with http AFTER the results are received
Added an handy script to read the results with http
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Trailing new line
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Applied suggested changes + fixed read_results.sh script
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Changes from review
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
The original handshake timeout is too short to dial connection
successfully under some situation. So the activator pod can not be
active. And the log message just say "Failed to send ping message to
ws://autoscaler.knative-serving.svc.cluster.local:8080", not easy to
figure out what's the problem underneeth.
The fix switch to websocket default dial, so the default handle shake
time is 45 seconds, and once dial error found, the error will be
reported as error.
* Allow glog to coexist with klog
glog isn't used in our repos with good reason, but performance tests
use it, for now. This commit removes the ability to set klog flags
that aren't shared with glog, in return for the ability of glog to be imported.
* update-codegen
By combining our validation logic into our mutating webhook we were previously allowing for mutating webhooks evaluated after our own to modify our resources into invalid shapes. There are no guarantees around ordering of mutating webhooks (that I could find), so the only way to remedy this properly is to split apart the two into separate webhook configurations:
- `defaulting`: which runs during the mutating admission webhook phase
- `validation`: which runs during the validating admission webhook phase.
The diagram in [this post](https://kubernetes.io/blog/2019/03/21/a-guide-to-kubernetes-admission-controllers/) is very helpful in illustrating the flow of webhooks.
Fixes: https://github.com/knative/pkg/issues/847
In every log we get the ugly string printed:
2019-11-13T08:44:42.421-0800 info logging/config.go:50
Successfully created the logger. {"knative.dev/jsonconfig": "{\n\t
\"level\": \"debug\",\n\t \"encoding\": \"console\",\n\t
\"outputPaths\": [\"stdout\"],\n\t \"errorOutputPaths\":
[\"stderr\"],\n\t \"encoderConfig\": {\n\t \"timeKey\":
\"ts\",\n\t \"messageKey\": \"message\",\n\t \"levelKey\":
\"level\",\n\t \"nameKey\": \"logger\",\n\t \"callerKey\":
\"caller\",\n\t \"messageKey\": \"msg\",\n\t \"stacktraceKey\":
\"stacktrace\",\n\t \"lineEnding\": \"\",\n\t \"levelEncoder\":
\"\",\n\t \"timeEncoder\": \"iso8601\",\n\t \"durationEncoder\":
\"\",\n\t \"callerEncoder\": \"\"\n\t }\n\t}"}
It's all a constant (see test/logging/logging.go:newLogger), except
"level", which is then printed immediately afterward. So just remove
printing this string.
the observability config is used in other packages including
the sample controller. This commit pulls observability config
into knative.dev/pkg similar to logging config for better reusability.
* Add support for Selector in tracker.Reference.
`tracker.Reference` may now optionally replace `Name` with `Selector` to track zero or multiple resources of a particular `apiVersion`, `kind` and `namespace`.
Fixes: https://github.com/knative/pkg/issues/859
* Address code review comments
`TrackReference` is the same as `Track`, but takes a `tracker.Reference` instead. This type has been seeded with the subset of `corev1.ObjectReference` that the tracker currently consumes / supports, but the intention is to expand this type to allow inexact references that (optionally) use label selectors in place of name to reference objects.
See also: https://github.com/knative/pkg/issues/859
Not having this causes the listers to log an annoying log message like
W1108 02:48:54.848573 211995 listers.go:77] can not retrieve list of objects using index : Index with name namespace does not exist
That message doesn't cause the tests to fail because the cache logic works around by doing a "slow indexing". I was very confused by this log though and sunk a bit of time into debugging it, so here we go.
Destination sits in a strange versioned directory without a group under APIs. Destination is in fact part of our duck type space, so it belongs under the `duck` group. This moves the definition (previously v1alpha1) to `v1` because it is referenced from source types that have been designated `v1`.
* marking the metrics as internal as we need to pre-process them to include
pod_name and container_name...
* removing eventSource
* updates
* rollbacking changes to source
* updating changes to source
* minimizing change
* minimizing change