Commit Graph

694 Commits

Author SHA1 Message Date
Matt Moore a55e24e80c Remove temporary logic to allow shared paths in webhook. (#943)
* Remove temporary logic to allow shared paths in webhook.

* Update webhook/webhook.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>
2019-12-12 11:14:52 -08:00
Markus Thömmes bebd5557fe Turn websocket's handshake timeout down again. (#941) 2019-12-11 07:02:49 -08:00
Zhimin Xiang 9d7b063951 add metrics for recording knative certificate issuance latencies (#940) 2019-12-10 21:09:48 -08:00
Ignacio (Nacho) Cano d5d6ec4697 setting other test data (#933) 2019-12-10 10:44:47 -08:00
Matt Moore c9679c8353 Auto-update dependencies (#939)
Produced via:
  `dep ensure -update knative.dev/test-infra`
/assign n3wscott
2019-12-10 09:36:47 -08:00
Zhimin Xiang 9681cde37b Add Knative Certificate related metrics into Knative Revision metrics (#932)
* add Knative Certificate related metrics into Knative Revision metrics

* fix typo
2019-12-09 21:50:46 -08:00
Joyce Liu 138ab0d10d Propagate the error in prow-cluster-operation actions instead of log.Fatalf (#931)
* Propagate the error in prow-cluster-operation actions instead of log.Fatalf

* log error in the same manner in prow-cluster-operation main
2019-12-09 20:45:46 -08:00
Chi Zhang 0c69403587 remove emit metrics flag (#929) 2019-12-09 07:01:45 -08:00
Victor Agababov 731f943e4f Fix the childname where trimming caused a dash. (#928)
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
2019-12-08 14:12:44 -08:00
Victor Agababov 37bd04dc3e Move generic packages from serving to pkg. (#927)
* 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
2019-12-06 17:57:40 -08:00
Matt Moore eec28e7bbd Auto-update dependencies (#924)
Produced via:
  `dep ensure -update knative.dev/test-infra`
/assign n3wscott
2019-12-05 09:55:38 -08:00
Joyce Liu da3d090aa9 modify boskos in cluster manager to make the boskos resource type customizable (#922) 2019-12-03 16:45:36 -08:00
Yanwei Guo 94a34e416c Upgrade OpenCensus Stackdriver exporter (#865)
* upgrade

* change unit tests

* upgrade os sd again

* change unit tests

* add comment

* add comment

* address comments
2019-12-03 14:12:37 -08:00
Matt Moore 3444316bde Format markdown (#919)
Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
/assign n3wscott
2019-12-03 09:47:35 -08:00
Matt Moore 12b4f0010d Auto-update dependencies (#920)
Produced via:
  `dep ensure -update knative.dev/test-infra`
/assign n3wscott
2019-12-03 09:33:35 -08:00
Joyce Liu c259ed6f2e Moved cluster name check to later so --get can use cluster name in kubeconfig (#918) 2019-12-02 15:50:35 -08:00
Matt Moore 891c2876dd Implement a base library for implementing "Pod Spec"-able bindings. (#915)
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.
2019-12-02 08:58:34 -08:00
Ville Aikas 944655d6cc fix comment, followup to 911 (#912)
* fix comment, followup to 911

* Update webhook/testing/listers.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>
2019-11-28 13:49:22 -08:00
Victor Agababov 8eb13fa842 Some cleanups in the URI tests (#914)
As referenced in the previous PRs

/assign @vaikas mattmoor
2019-11-28 13:42:22 -08:00
Matt Moore 20ef0b737b This has three small table testing changes. (#911)
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.
2019-11-28 11:10:22 -08:00
Matt Moore 1490c68a0c Run ./hack/update-codegen.sh (#910) 2019-11-28 11:03:22 -08:00
Ville Aikas cac31abb7f Change URIFromDestinationV1 to return apis.URL instead of string (#909) 2019-11-27 13:13:22 -08:00
Matt Moore 7fbd5952bb Auto-update dependencies (#908)
Produced via:
  `dep ensure -update knative.dev/test-infra`
/assign n3wscott
2019-11-27 07:54:22 -08:00
Francesco Guardiani 00cee157bd Added test utilities methods (#902)
* 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>
2019-11-27 07:13:21 -08:00
Victor Agababov 06d6b25dd6 Remove panics from the test and use t.Fatalf instead (#906) 2019-11-26 15:21:21 -08:00
grac3gao 46cfce8d99 Add check in informer to make controllers work when process invalid resources (#880)
* #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>
2019-11-26 14:16:21 -08:00
Ville Aikas 9a81fcece3 Resolvev1destination (#905)
* support v1.Destination

* rebase

* remove leftover crud from rebase

* address pr feedback

* moar feedback from pr
2019-11-26 14:00:21 -08:00
Slavomir Kaslev ddf3968b65 Migrate pkg to istio.io/client-go apis (#882)
* Add istio api packages from istio.io/api and istio.io/client-go

* Codegen istio client for apis from istio.io/client-go

* Remove our istio apis
2019-11-26 11:41:21 -08:00
Matt Moore 7325e901c0 Format markdown (#904)
Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
/assign n3wscott
2019-11-26 10:28:21 -08:00
Matt Moore 9f41433241 Add a simple ToUnstructured method for converting our types to unstructured. (#900)
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.
2019-11-26 10:05:21 -08:00
Markus Thömmes 47b250654a Add an -imagetemplate option to allow for more flexible test image locations. (#903) 2019-11-26 06:40:22 -08:00
Matt Moore 6305a6322f Fix the serialized name of the spec field (oops) (#899) 2019-11-25 13:24:21 -08:00
Matt Moore b75a4bf672 This adds a duck type representing the common shape for Bindings. (#898)
For more information, see [here](https://docs.google.com/document/d/1t5WVrj2KQZ2u5s0LvIUtfHnSonBv5Vcv8Gl2k5NXrCQ/edit?ts=5dce0223#heading=h.lnql658xmg9p).
2019-11-25 13:10:21 -08:00
Matt Moore 43ca049cdb Reduce the boilerplate for setting up duck.InformerFactory's. (#896)
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`.
2019-11-25 09:57:10 -08:00
Francesco Guardiani 2ec0f8da50 Mako stub improvements (#868)
* 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>
2019-11-22 11:33:09 -08:00
Matt Moore 8c1fb5fe04 Auto-update dependencies (#893)
Produced via:
  `dep ensure -update knative.dev/test-infra`
/assign n3wscott
2019-11-21 11:11:08 -08:00
Matt Moore cd063fbc21 golang format tools (#892)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign n3wscott
2019-11-21 11:06:08 -08:00
Chi Zhang 0400231005 Add a command package to run command line (#762)
* add Run and RunBatchSequentially

* add RunBatchParallelly

* minor changes

* parallel

* address feedbacks

* add trailing space

* sort import

* address CR feedbacks

* fix unit test

* change to private

* address comments

* nit
2019-11-20 07:35:08 -08:00
JUN JIE NAN 27b3dc39ad Fixed knative activator handshake timeout issue (#836)
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.
2019-11-18 23:19:07 -08:00
Matt Moore d752898438 Make PodSpeccable a real thing (#884) 2019-11-18 08:02:08 -08:00
coryrc d9e3e244a6 Allow glog to coexist with klog (#881)
* 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
2019-11-15 10:57:02 -08:00
Matt Moore 4836f680bb Split the resource semantic webhooks into separate AdmissionControllers (#848)
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
2019-11-14 16:51:02 -08:00
coryrc 3525756c2a Address serving#5949 by putting flag initialization into pkg. (#870)
Created a unit test for flag setup.
Use Subtests for table-driven tests.

Moved from https://github.com/knative/serving/pull/5984
2019-11-14 16:33:02 -08:00
Matt Moore 80da64a31c golang format tools (#879)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign n3wscott
2019-11-14 11:06:31 -08:00
coryrc d3841ea2c3 Remove ugly constant string being printed in every log. (#878)
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.
2019-11-13 19:30:28 -08:00
Matt Moore 0b70cd6820 Auto-update dependencies (#877)
Produced via:
  `dep ensure -update knative.dev/test-infra`
/assign n3wscott
2019-11-13 17:22:28 -08:00
Matt Moore e96196e347 golang format tools (#876)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign n3wscott
2019-11-13 15:49:28 -08:00
Vincent 94911510c3 Skip watching the ConfigMaps if they are missing (#872)
* Skip watching the ConfigMaps if they are missing

* Log the error message
2019-11-13 15:17:29 -08:00
Matt Moore 9283d2c32c Format markdown (#875)
Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
/assign n3wscott
2019-11-13 15:08:28 -08:00
Nima Kaviani 4deb5d83d2 move metrics config to pkg (#786)
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.
2019-11-13 06:52:28 -08:00