Commit Graph

915 Commits

Author SHA1 Message Date
Matt Moore 8c3cf6f2ee
Fix the webhook workqueue names (#1245) 2020-04-25 10:08:49 -07:00
Victor Agababov 8ddda31a35
Some fixes we did in server upstream to pkg (#1244)
* Some fixes we did in server upstream to pkg

- reduce formatting calls where they are not necessary
- remove casts where they are not necessary
- switch to consts where possible.

* nit

* 1more
2020-04-24 15:03:49 -07:00
Matthew Broomfield c13917eb25
Use loggers when emitting count messages (#1239)
Fixes #1225
2020-04-24 10:55:50 -07:00
Markus Thömmes e983887dc4
Change default port in webhook test to 8443. (#1242)
A lot of systems have something running that responds on 443, i.e. a local test environment or a webserver.
2020-04-24 10:49:49 -07:00
Matt Moore 412c27930a
[master] Auto-update dependencies (#1243)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-24 10:32:50 -07:00
Markus Thömmes 3a2ec57c2c
Add specific callback for the tracker to delete items eagerly. (#1235)
* Add specific callback for the tracker to delete items eagerly.

* Rename to OnDeletedObserver.

* Enhance FakeTracker and add tests.
2020-04-24 09:17:50 -07:00
Shashwathi 4945766b29
Manually print all elements of response object (#1241)
Signed-off-by: Shash Reddy <shashwathireddy@gmail.com>

Co-authored-by: Andrew Su <asu@pivotal.io>
2020-04-23 13:03:31 -07:00
Victor Agababov 31657d4f05
Fix the logging to be a sentence (#1236)
Also it seems in the test logs this is manifested as 'returned an event' and nothing else...
but I blame it to the testing log configuration, perhaps.
2020-04-23 10:56:31 -07:00
Markus Thömmes 7fbf4b0edc
Add finalizer option and default to test code too. (#1238) 2020-04-23 10:02:31 -07:00
Matt Moore bc77bbc25e
[master] Auto-update dependencies (#1237)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-23 09:55:31 -07:00
Markus Thömmes 6103dd9b71
Add a controller option to specify a custom finalizer name. (#1230) 2020-04-22 14:55:40 -07:00
Francesco Guardiani edb546bf7a
Tracing configuration json marshal/unmarshal (#1228)
* Tracing configuration json marshal/unmarshal

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Suggestions

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-04-22 08:53:40 -07:00
Markus Thömmes 5036c917e5
Drop 'no longer exist' line to DEBUG. (#1234) 2020-04-22 07:34:40 -07:00
Markus Thömmes 8aa4090a02
Release leader election lock as soon as we exit. (#1229) 2020-04-21 13:44:35 -07:00
Lukas Berk 0e31d66795
Sinkbinding Webhook should label namespace for inclusion (#1208)
* First hack at getting the namespaces of interest to the ps

* Have the webhook label the namespace for inclusion

* Fix unit tests

* Update with feedback

* Add namespace lister, use constants

* Add one more err logging statement
2020-04-21 09:29:36 -07:00
Matt Moore 909bf65c46
[master] Auto-update dependencies (#1231)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-21 08:16:50 -07:00
Antoine Cotten 9320e44d1b
Allow retry of informer cache init upon error (#1221)
* Make informer cache initializations retriable on error

If the first initialization fails, allow the informer cache
initialization to get retried at a later point instead of caching the
error.

* Update cache tests

* Rename 'result' type to 'informerCache'
2020-04-17 09:02:48 -07:00
whaught 9d7c06b6ab
Allow Delete verb on validation callbacks (#1219)
* Create IsInDelete context

* Set up context with WithinDelete

* Test for callback delete

* fix subresource update

* Return oldObj for deletes

* include delete in webhook config

* include delete in unit test

* don't log on delete
2020-04-16 18:30:48 -07:00
Kenjiro Nakayama f68639f04b
Shorten object name to avoid DNS issue defined (RFC 1035) (#1224)
* Shorten object name to avoid DNS issue defined (RFC 1035)

In serving, when running e2e test after changing the domainTempalte to
`{{.Name}}-{{.Namespace}}.{{Domain}}`, some tests failed with
following error:

```
Retrying for DNS error: Get http://service-to-service-call-via-activator-a-disabled-qgoluwzd-serving-tests.apps.ci-op-y42hx5lj-23b3e.origin-ci-int-aws.dev.rhcloud.com: dial tcp: lookup service-to-service-call-via-activator-a-disabled-qgoluwzd-serving-tests.apps.ci-op-y42hx5lj-23b3e.origin-ci-int-aws.dev.rhcloud.com: no such host
```

This is because DNS
label(`service-to-service-call-via-activator-a-disabled-qgoluwzd-serving-tests`)
became longer than 63 characters (RFC 1035).

To fix it, this patch changes the object name to less than 35
characters.

Note, the `35` is estimated by `Max(63) - (namespace(23) + buffer(5))`.

* Use kmeta.ChildName
2020-04-15 19:14:48 -07:00
Victor Agababov 0eed424fa4
Cleanup the logging CM handling. (#1223)
Raise test coverage, improve code flow, etc.
2020-04-14 16:31:46 -07:00
Ville Aikas 26f2ef4f11
use https style vs. ssh (#1202)
* use https style vs. ssh

* fix the b0rk3d contributing link.

* Appease the robot.
2020-04-14 12:04:16 -07:00
Matt Moore e247dc308d
[master] Auto-update dependencies (#1220)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-13 09:49:12 -07:00
Ville Aikas 4e57475bc8
add EnqueueNamespaceOf (#1217)
* add EnqueueNamespaceOf

* correct log error msg
2020-04-10 18:11:07 -07:00
Scott Nichols e7a4ea9ad7
update the run book for releases in pkg to include the test-infra lock (#1215) 2020-04-10 08:34:05 -07:00
Victor Agababov 9147309d53
Properly productionize tracing config map (#1209)
- raise test coverage
- add validation for floats to be in the proper region
- normalize code around
2020-04-09 15:55:05 -07:00
Victor Agababov 2dab1c49bd
Normalize CM owners across CM directories (#1210)
Make sure they're uniform more or less.
Also add myself for CM approvers, given I've rewrote most of them recently.
2020-04-09 15:44:04 -07:00
Victor Agababov f384223ab1
Make a proper check when checking for spaces. (#1206)
Mostly this covers tabs, but also other strange things, like carriage return :-)
2020-04-08 13:31:02 -07:00
Matt Moore 83b38ce178
[master] Auto-update dependencies (#1205)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-08 08:30:02 -07:00
Victor Agababov fdb7691d92
Brush up the observability config (#1204)
- add proper defaulting
- cleanup test (was pretty shaggy with wrong variable names and such)
- raised coverage a bit
2020-04-07 16:50:00 -07:00
Evan Anderson 0c36abbff9
Move duck typing document to markdown (#1184) 2020-04-07 07:59:00 -07:00
Matt Moore db0702fc7c
[master] Auto-update dependencies (#1201)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-07 07:54:00 -07:00
Dave Protasowski 466c676678
Include utility to migrate a CRD's storage version (#1197)
* include utility to migrate a CRD's storage version

* fix godoc function name

* godoc updates

* drop use of fmt.Sprintf

* Update apiextensions/storageversion/cmd/migrate/main.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update apiextensions/storageversion/migrator_test.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update apiextensions/storageversion/migrator_test.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* test formatting

Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-04-06 16:14:59 -07:00
Chi Zhang 064b156ab7
Update and fixes to the cluster management lib (#1196)
* fix project in e2e cluster manager

* delete async for boskos

* use the right quota in the GKE requests

* update google cloud api

* update

* fix unit tests

* fix unit tests

* fix unit tests

* acquire always creates new

* support resolving GKE version

* go fmt

* delete version.go

* add more unit tests
2020-04-06 14:52:59 -07:00
whaught d22642244e
Allow Unstructured callback from Validating Webhook (#1172)
* Add new callback pattern to pkg

* include the context

* typo

* Remove the empty instance of unstructured

* initialize the unstructured var

* Eliminate the unneeded pointer

* Pass a pointer to unstructured callback

* Create a validation specific context struct

* Move callback tests to own unit test case

* Switch from converting to decoding

* Update webhook/resourcesemantics/validation/validation.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* don't wrap context and include params

* split validation files

* include 2020 copyright

* include unit test for WithKubeClient

* Don't bother updating copyright date

* Inclue a unit test for panic

* Move dryRun to context

* Include context dry run unit test

* put the request operation in the context

* eliminate circular dep

* move kubeclient test out of context_test

* dont bother iterating callback map

* Callback takes a list of supported verbs

* Remove extra type

* Ensure Callback interface is public

* Alias Operation into validation

* alias Operation right in Webhook

* Update webhook/resourcesemantics/validation/validation_admit.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update webhook/resourcesemantics/validation/validation_admit_test.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update webhook/resourcesemantics/validation/validation_admit_test.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update webhook/resourcesemantics/validation/validation_admit.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update webhook/resourcesemantics/validation/validation_admit.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update webhook/resourcesemantics/validation/validation_admit_test.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* correct parens

* minor style fixes

* Rename Callback to Func

* Fix build error

* Switch callback to take a list with a factory

* keep descriptive names

* update comment

* Drop pointer, correct comments

* Add a unit test to disallow duplicate verbs

* fix comments, struct{} for set

* switch to variadic arg for NewCallback

Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-04-06 12:22:19 -07:00
Markus Thömmes 3506048289
t.Fatal must not be called in a goroutine. (#1194)
* t.Fatal must not be called in a goroutine.

* Add early return statements.
2020-04-06 08:27:19 -07:00
Markus Thömmes 83edd9f30d
Add augmented logger to the context to pass it down. (#1192) 2020-04-06 08:21:27 -07:00
Markus Thömmes c09083a601
Fix a few simple linter warnings: unused code, govet warnings etc. (#1191) 2020-04-06 08:21:20 -07:00
Markus Thömmes 689dff7dc0
Replace deprecated 'Track' with 'TrackReference'. (#1198) 2020-04-06 08:15:19 -07:00
Markus Thömmes 92cdec5b35
Actually use the subtest names in recorder test. (#1193) 2020-04-04 11:17:34 -07:00
Markus Thömmes 9b70d057b1
Allow a 'None' metrics backend, to basically do nothing. (#1190) 2020-04-04 11:17:27 -07:00
Kenjiro Nakayama 08b31df9e6
Retry to get logging configmap when failed (#1189)
* Retry to get logging configmap when failed

When deploying pods with Istio sidecar, it takes a few seconds until
network is configured. In fact, Serving's system pods always fail when
Istio sidecar is enbled.

To fix it, this patch changes to retry to get logging configmap for 5
seconds.

* Add IsNotFound error check

* Remove if error condition
2020-04-04 11:17:18 -07:00
Kenjiro Nakayama fcff978f32
Do not set to unknown status when all dependents passed happy check (#1187)
* Do not set to unknown status when all dependents passed unhappy check

`accessor.GetConditions()` in `findUnhappyDependent()` gets status
filed from runtime. So, if an object has following status:

```
  status:
    address:
      url: http://hello-example.default.svc.cluster.local
    conditions:
    - lastTransitionTime: "2020-04-02T09:49:03Z"
      status: "True"
      type: AllTrafficAssigned
    - lastTransitionTime: "2020-04-02T09:49:03Z"
      message: autoTLS is not enabled
      reason: AutoTLSNotEnabled
      severity: Info
      status: "True"
      type: CertificateProvisioned
    - lastTransitionTime: "2020-04-02T09:49:05Z"
      status: "True"
      type: IngressReady
    - lastTransitionTime: "2020-04-02T09:49:05Z"
      status: "True"
      type: Ready
```

`accessor.GetConditions()` returns AllTrafficAssigned,
CertificateProvisioned, IngressReady (and Ready).

Then, current code (`len(r.dependents) != len(conditions)`) sets to
Unknown if all conditions are not unhappy. However, it does not work
if we added a new dependent and downgraded the cluster because
the number of dependents is less than current status conditions.

If all dependents are verified, it should not set to unknown
status. So, this patch changed it.

* Add unit test
2020-04-04 11:10:18 -07:00
Chi Zhang 7727cb37e0
Retry cluster creation if there's an error (#1186)
* retry cluster creation if there's an error

* nit renaming

* go fmt

* delete cluster async

* clean up the code a bit

* nits

* address comments

* fix unit tests

* nits

* go fmt

* fix unit tests
2020-04-03 09:23:18 -07:00
Matt Moore 0cf29f826c
[master] Auto-update dependencies (#1188)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-02 15:49:18 -07:00
Chi Zhang 55250e6aab
move libs from test-infra (#1171) 2020-04-01 11:43:17 -07:00
Matt Moore ce05a3de31
[master] Auto-update dependencies (#1185)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-04-01 07:12:18 -07:00
Matt Moore 94b2b6aaaf
[master] Auto-update dependencies (#1183)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-03-31 07:50:51 -07:00
Victor Agababov 59d2b06f3e
Fix the defaulting for the leader election config map (#1182)
* update go-cmpt to work with 1.14.

Mostly to fix https://github.com/google/go-cmp/issues/167, but we also pinned at some
random commit, rather than at a release version.

* add new pkg

* Make sure we use same versions in pkg and serving

* Fix the defaulting for the leader election cm

This was missing, but now we can provide the default values.

* Fix the defaulting for the leader election cm

This was missing, but now we can provide the default values.
2020-03-31 07:23:51 -07:00
Matt Moore e2ee5bed78
Start the webhook before informers sync. (#1180)
* Start the webhook before informers sync.

Some webhooks (e.g. conversion) are required to list resources, so by delaying those until after informers have synced, we create a deadlock when they run in the same process.  This change has two key parts:
1. Start the webhook immediately when our process starts, and issue a callback from sharedmain when the informers have synced.
2. Block `Admit` calls until informers have synced (all conversions are exempt), unless they have been designated by implementing `webhook.StatelessAdmissionController`.

Our built-in admission controllers (defaulting, validation, configmap validation) have all been marked as stateless, the main case where we want to block `Admit` calls is when we require the informer to have synchronized to populate indices for Bindings.

* Add missing err declaration
2020-03-30 18:14:50 -07:00
Victor Agababov f40c61abc6
update the yaml library to new version (#1178)
* update go-cmpt to work with 1.14.

Mostly to fix https://github.com/google/go-cmp/issues/167, but we also pinned at some
random commit, rather than at a release version.

* add new pkg

* Make sure we use same versions in pkg and serving
2020-03-30 16:02:50 -07:00