Commit Graph

392 Commits

Author SHA1 Message Date
Dan Gerdesmeier 4ce60b7cde Allow endpoint polling to take request options (#469)
Adds RequestOption and WithHeader functions that allow users to customize
the request options when taking polling actions.

This unblocks Knative Serving to pass user set headers through
in conformance testing.
2019-06-17 18:11:46 -07:00
mattmoor-sockpuppet 13b093adc2 Update github.com/knative/test-infra dependency (#468)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @adrcunha
2019-06-17 07:24:47 -07:00
mattmoor-sockpuppet b328e2d3f5 Update github.com/knative/test-infra dependency (#466)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-06-15 11:57:43 -07:00
Matt Moore 139b81e637 Make a small adjustment to hack/update-deps.sh (#465)
This form should be more hospitable to running things to auto-update `knative/pkg` and `knative/test-infra`.

I canaried this change in `knative/sample-controller`, and was able to produce: https://github.com/knative/sample-controller/pull/11
2019-06-14 22:06:44 -07:00
Matt Moore 8b0108fa0a Add fancier PR templates to knative/pkg (#461) 2019-06-14 13:40:44 -07:00
Scott Nichols 68737b1b4e Adding Batch v1 Job to injection client. (#459)
* adding Batch v1 Job to injection client.

* damn lock file.
2019-06-12 14:55:43 -07:00
Victor Agababov c2f344436b Better for loop for iterating over the channel (#458) 2019-06-12 13:40:44 -07:00
Scott Nichols 28f181241c Remove GCP default auth. (#455)
* Remove default remote gcp auth from pkg.

* update deps.
2019-06-10 08:39:41 -07:00
Scott Nichols f48815f454 Add injection for ServiceAccount and RoleBinding (#453)
* Adding ServiceAccount.

* Adding RoleBinding.

* update gen.
2019-06-10 07:34:41 -07:00
mattmoor-sockpuppet d01d3b0112 golang format tools (#454)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
2019-06-10 07:17:42 -07:00
Scott Nichols 4dec36bd68 Adding namespaces to injeciton, eventing uses this. (#452) 2019-06-08 14:12:41 -07:00
Matt Moore 2353d3bfc0 Add a pod informer and fakes. (#451) 2019-06-08 07:49:41 -07:00
Scott Nichols afdedebb9e Adding Api Extensions to client injection in pkg. (#449)
* Adding Api Extensions to client injection in pkg.

* Moving to logger.panicf when the thing you ask for is not in the context.
2019-06-07 18:54:40 -07:00
mattmoor-sockpuppet 463df98531 Format markdown (#448)
Produced via: `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
2019-06-07 09:39:41 -07:00
Matt Moore d8a2a739d6 Eliminate controller registration in favor of passing a list to the shared main. (#447) 2019-06-06 18:17:41 -07:00
mattmoor-sockpuppet 5d105b46d3 golang format tools (#444)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
2019-06-06 09:54:40 -07:00
mattmoor-sockpuppet 586a88ecb8 Format markdown (#445)
Produced via: `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
2019-06-06 09:16:40 -07:00
Matt Moore c6f03fa600 Push the event recorder stuff into knative/pkg (#443) 2019-06-06 07:35:40 -07:00
Matt Moore 262650b2c0 Incorporate the sub-resource context into the context state populated by the webhook. (#442) 2019-06-05 20:36:39 -07:00
Matt Moore 4d86f3ad6f Access a logger and Fatalf when Get would return nil. (#439) 2019-06-05 09:06:38 -07:00
Matt Moore 35bb0fc83b Add code-generation for the various injection stubs. (#438)
This is largely based on work by @n3wscott
2019-06-05 08:50:38 -07:00
Matt Moore 4c630bb1bb Create a library for Reconciler dependency injection. (#423)
This creates a base library that enables us to leverage the dependency
graph to convey injection dependencies.  Our controllers will start
to get their informers off of a `context.Context` via `fooinformers.Get(ctx)`.

By simply linking `fooinformers` to access the informer in this way, we trigger
a cascade of `init`-time registrations for the informer, and its transitive
dependencies (e.g. shared informer factory, client).

The `ctx` is infused with these informers in `package main` by linking the
appropriate reconcilers (transitively registering everything) and then calling
`sharedmain.Main()` (from `github.com/knative/pkg/injection/sharedmain`).
2019-06-05 07:37:38 -07:00
Adriano Cunha 678bb6612d Remove OWNERS under /vendor (#432)
These are unnecessary.
2019-06-04 07:44:41 -07:00
mattmoor-sockpuppet 17ec1ed50d golang format tools (#437)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
2019-05-31 11:11:32 -07:00
Adam Harwayne 67d95db076 Logging config parses all components, rather than just a list passed in. (#436)
* Logging config pares all components, rather than just a list passed in.

* Simplify the prefix checking logic.

* PR comment - ignore empty string.

* Unit test.
2019-05-30 15:23:31 -07:00
Matt Moore 5fe2b490af Add a GetURL helper for consuming Addressable. (#434)
* Add a GetURL helper for consuming Addressable.

* Update apis/duck/v1alpha1/addressable_types_test.go

fix the copyright header

Co-Authored-By: mattmoor-sockpuppet <mattmoor+sockpuppet@google.com>
2019-05-30 07:09:32 -07:00
Adriano Cunha c0132d9dde Update OWNERS to use OWNERS_ALIASES (#422) 2019-05-29 20:04:33 -07:00
Ville Aikas 15b1aa79be change metav1.Object to runtime.Object so we can test moar objects (#433) 2019-05-28 17:11:30 -07:00
Matt Moore 985bff446d Simplify the default controller.Impl constructor. (#427)
A while back we added a "StatsReporter" argument to `controller.NewImpl`,
but in serving every callsite of this is passing:
```
controller.NewImpl(r, logger, "my-string", MustNewStatsReporter("my-string", logger))
```

Where `MustNewStatsReporter` is just a form of knative/pkg's `controller.NewStatsReporter`
that logs fatally when an error is returned.  It is notable that Serving's logic has been
duplicated to both Build and Eventing.

There are a handful of changes here:
1. Move MustNewStatsReporter into knative/pkg
2. Expose the current interface as NewImplWithStats
3. Drop the StatsReporter from NewImpl and default to `MustNewStatsReporter()`

This is a breaking change for downstream repositories, but should make their callsites universally simpler.
2019-05-28 13:16:31 -07:00
Chi Zhang d66945c363 Move common helper functions to pkg test (#424)
* move common functions to pkg test

* add unit test cases

* fix CR issues
2019-05-28 11:09:31 -07:00
Matt Moore 523d91657b Add a testing package to setup metrics.Domain() (#429)
This mirrors what we do for system.Namespace() today.
2019-05-28 08:01:41 -07:00
Matt Moore d1ccfd6652 This upstreams a useful helper from serving. (#428)
In serving we have `reconciler.Handler` that wraps a handler function
(e.g. `Enqueue`) in the `cache.ResourceEventHandlerFuncs`.  This pattern
was becoming pervasive, so this simpler handler dramatically reduced our
boilerplate.
2019-05-27 23:21:29 -07:00
Matt Moore 2923ca42d9 Share the configmap name logic for Logging and Metrics. (#425)
This also adds a way to fetch the metrics "domain" following a similar pattern to `system.Namespace()`.
2019-05-27 18:41:29 -07:00
Matt Moore aae68ba9e0 Add methods for attaching resync duration to context. (#426)
Also adds a method for tracker leases, which should be a multiple of the resync period.
2019-05-26 23:44:29 -07:00
Matt Moore 365d80ec5b Add a new method to wrap the signal channel in a context. (#420)
* Add a new method to wrap the signal channel in a context.

* Adjust the Deadline and Err implementations based on feedback.
2019-05-24 06:35:28 -07:00
mattmoor-sockpuppet 34792a92ce golang format tools (#419)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
2019-05-18 10:35:26 -07:00
chaodaiG 837d0c61aa Update test-infra: get rid of Unbound variable running update-deps warning (#421) 2019-05-18 10:28:26 -07:00
leo james 7b196cff46 add trace id (#405)
* add trace id

* using with list

* add comment
2019-05-16 07:14:22 -07:00
Adam Harwayne 5548112eb7 Defaulting watcher (#415)
* Add configmap.DefaultingWatcher that allows watched ConfigMaps to be defaulted in code.

* Add a test where the real K8s CM is deleted.

* Remove unused cmName.

* WatchWithDefault after start panics.

* cfgs -> defaults

* Initialize defaults in NewInformedWatcherFromFactory.

* Remove unneeded error in panic.
2019-05-16 07:09:18 -07:00
chaodaiG 685ca5f33a Update test-infra to the latest version (#416) 2019-05-16 07:04:18 -07:00
Ville Aikas 5e4512dcb2 Add Filter function by name/namespace (#414) 2019-05-14 13:53:32 -07:00
Victor Agababov 9e0db8f0a7 Int32 is cool too (#410)
* add addafter method that permits enqueueing the objects themselves

* Also add int32 as possible type
2019-05-10 16:37:38 -07:00
Victor Agababov c3f131538a add addafter method that permits enqueueing the objects themselves (#408) 2019-05-08 16:14:37 -07:00
Akash Verenkar c0f06c32f1 Move serving/pkg/tracing to pkg/tracing, so that eventing can start using it (#407)
* Move serving/pkg/tracing to pkg/tracing - initial version before testing

* Disabling TestInterlevedExporters. Refer to https://github.com/knative/pkg/issues/406
2019-05-08 11:43:37 -07:00
Spellar Bot 8777a2e1d5 @SpellarBot fixed 1 typo for you :) (#403) 2019-05-06 15:03:36 -07:00
Matt Moore 868008d0f8 Implement Addressable v1beta1 to use URL. (#401)
Fixes: https://github.com/knative/pkg/issues/395
2019-05-02 17:46:34 -07:00
Victor Agababov f23f58d373 Expose the EnqueueKeyAfter function on the controller (#402)
This is needed for the positive handoff, so that we can enqueue
the KPA after we received the positive answer from the activator
but still want to have buffer time to make sure the network
changes propagate everywhere.
2019-05-02 17:16:34 -07:00
Matt Moore 57fd07886b Add support for a structured URL type. (#400)
* Add support for a structured URL type.

This type can be used to accept `url: http://asdf.com` where in code we
get a `url.URL` to interact with.

* Propagate errors parsing, cast pointer instead of copying.
2019-05-01 18:40:33 -07:00
chaodaiG 3998dc50e8 Update test-infra: some fixes (#399) 2019-05-01 17:00:35 -07:00
Shashwathi f95c27ee8c Enable fields validation on delete actions (#398) 2019-04-30 17:39:32 -07:00