* Testing an idea for field errors.
* wrap other tests for webhook.
* move FieldError to Error, FieldErrors to FieldError
* Rename files to reflect their type.
* Reworked this to require no changes externally.
* test also.
* gotta cover those tests.
* nil check
* Adding Also.
* Clean up comments.
* Don't delete the tests.
* Null check test the clear.
* Fix nits.
* FieldError is now non-mutating.
* More errorf formatting fixes.
* I can make this even simpiler
* I can make this even MORE simpiler
* Add comment to make flow of also clear.
* fix comment, optimize make errors
* Prune the GenericCRD spec to what is used.
Encapsulate our change detection slightly.
* Support common spec mutations via duck typing.
This adds support for performing common mutations to objects via duck types and JSON patching.
Fixes: https://github.com/knative/pkg/issues/76
* Eliminate getSpecJSON thru schemaless duck typing.
This leverages a one-off trick to get the JSON of the spec field from arbitrary types.
* Adding common condition status.
* Saw another test that could be useful to have. added.
* ran hack/update-codegen.sh
* added ConditionSucceeded.
* moving the interface to just wrap the Condition[] object.
* checkpoint.
* Starting to reintegrate the work done in serving.
* Fixed up the unit tests.
* improve the test coverage on MarkTrue
* Moving conditionals to duck api.
* Adding more tests.
* Adding get/set tests.
* Some final nits for this ducking class.
* Adding .ViaIndex(1). to make spec.param[1] easier to do.
* Adding ViaKey
* fix order of bag example.
* Add code coverage to missed line.
* Adding ViaFieldIndex helper
* cleaning up.
* compress more.
* more cleanup
* test name
* Introduce an OwnerRefable interface
An OwnerRefable type provides sufficient information that we can
construct a metav1.OwnerReference from it, e.g. for
kmeta.NewOwnerReference, which does just that.
* Move interface to kmeta
This bootstraps this package with a useful collection of label methods for managing sub-resources. I'd initially written this as a way of managing versioned DaemonSet resources as part of WarmImage ([see here](62cad8045a/pkg/reconciler/warmimage/resources/meta.go (L28))).
I am upstreaming this here because I want to take advantage of it in Build for managing Image cache subresources of [Cluster]BuildTemplate resources.
* Few changes to the configmap package
- New* methods return concrete types
- defaultImpl is now InformedWatcher
- fixedImpl is now StaticWatcher
- Included a new ManualWatcher that mimics the InformedWatcher
in behaviour. ie. allows updates - making this a true 'mock'
* Include note about embedding the ManualWatcher in the InformedWatcher
* Update static_watcher.go
Fix some godoc
* shared scripts from test-infra live in //vendor/github.com/knative/test-infra/scripts;
* update `update-deps.sh` to keep only the scripts folder;
* all bash scripts were updated to use the vendored scripts;
Part of knative/test-infra#30.
This adds a logkey.Key for attaching the key being reconciled to a logger we embed into the context passed to Reconcile. The point of this is to enable us to eliminate [this](928d580756/pkg/reconciler/v1alpha1/service/service.go (L101-L104)) boilerplate from each of the Reconcilers.
These aren't identical, this has the form:
knative.dev/key: foo/bar
What it's replacing has the form:
knative.dev/namespace: foo
serving.knative.dev/service: bar
However, the type information present in the latter is redundant with the controller type that [should already be embedded](928d580756/pkg/reconciler/reconciler.go (L80)) in the logger.
In order to have a single webhook support multiple domain contexts, this reworks the `Handlers` argument to embed the `schema.GroupVersion` by wrapping the existing keys with it as a `schema.GroupVersionKind`.
This is mostly straightforward, but one oddity is that I discovered that `AdmissionRequest` gets this same tuple as the less capable `metav1.GroupVersionKind`, so there's a silly conversion we have to do.
I tried this manually vendored in serving with KPA and things worked great.
* Add Istio client from knative/serving
- Add Istio types in 'apis/istio/v1alpha3'
- Update codegen scripts
- Generate client in 'client'
- Add @tcnghia as owner for 'apis/istio'
Fixes#1
* nix linguring serving package dep
* cleanup vendor cache
* Mark /client as generated
* Fix verify-codegen script
* Run verify-codegen.sh via presubmit-tests.sh
* Remove Gatewaies -> Gateway hack
Looks like we don't need it anymore
The `controller.go` is from: https://github.com/knative/serving/pull/1770, however, this adds 100% coverage of `controller.go`, which we have been missing in `knative/serving`.
This also adds a `context.Context` to the `Reconcile` signature, to enable better sharing of logger setup across controllers.
Fixes: https://github.com/knative/pkg/issues/8
This pulls the Knative webhook logic (oriented around the interfaces in `knative/pkg/apis`) into `knative/pkg`.
The code is largely copied as-is, with `keep.go` excluded. The main changes are to the test code, which in `knative/serving` still operate in terms of the serving types.
Fixes: https://github.com/knative/pkg/issues/9
* Initial set of files for //test
Currently there are no tests, but this will enable finishing setup Prow.
* Add build and unit tests
* Update README with instruction on how to run the unit tests