If suffix name itself contained dashes, when we append the trimmed suffix
we might end up on the dash, which is a non valid k8s name.
So fix that.
/assign mattmoor
* Move generic packages from serving to pkg.
I was asked to move this to do some re-use in Eventing.
/cc @chizh
/assign mattmoor @tcnghia
* fix the compile error
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.