* 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
* 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
* 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'
* 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
* 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
* 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>
* 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
* 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>
* 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
* 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
* 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
* 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.
* 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
* 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