Commit Graph

26 Commits

Author SHA1 Message Date
Dave Protasowski 528ad1c1dd Generate K8s Injection Code (#640)
* update codegen so the fatal error messages are more informative

String representation of an untyped nil is 'nil' so the Fatal messages weren't useful

* generate k8s injection code

* generate apiextensions injection code

* use Fatal & move output paths

* switch from Fatal to Panic

* injection creates a single factory
2019-09-09 12:52:11 -07:00
Matt Moore d29eb5d70c Cut v1 of the duck types. (#615)
The main pieces of interest here are Addressable and Status.

This is a glorified copy/paste of v1beta1 with `s/v1beta1/v1/g`.
2019-08-28 13:49:42 -07:00
Scott Nichols a690d27530 Missed the deepcopy gen for Destination. Fixed. (#567) 2019-08-09 12:50:04 -07:00
chaodaiG 178f4d5456 Use knative.dev/test-infra (#552) 2019-07-31 14:20:43 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -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 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
Adriano Cunha 678bb6612d Remove OWNERS under /vendor (#432)
These are unnecessary.
2019-06-04 07:44:41 -07:00
Adriano Cunha c0132d9dde Update OWNERS to use OWNERS_ALIASES (#422) 2019-05-29 20:04:33 -07:00
Matt Moore 281cda84ce Move Condition stuff to apis, add a v1beta1 Status. (#361)
This moves the common Condition stuff to apis, and creates a v1beta1 form of Status that uses the Condition it defines (changing this in v1alpha1 is too breaking).

There aren't really any meaningful changes in this PR, mostly reorganization.  Enumerating what I did:
1. Copied `condition_set*.go` to `apis/`,
1. Copied the `Condition` portions of `conditions_types.go` to `apis/`,
1. Copied the balance of `conditions_types.go` to `apis/duck/v1beta1/status_types.go`,
1. Changed the parts of the above to reference things in the appropriate new places,
1. Removed the reflection-based `ConditionsAccessor` stuff, implementing it instead on `duckv1beta1.Status`.
1. Incorporate: https://github.com/knative/pkg/pull/358
2019-04-02 09:51:55 -07:00
Thomas Shafer 916205998d Update verification script and fix generated code. (#353)
Run ./hack/update-codegen.sh
2019-03-29 20:46:53 -07:00
jonjohnsonjr cd278f2d33 Bump k8s deps: 1.11.3 -> 1.12.6 (#310)
* Bump k8s deps: 1.11.3 -> 1.12.6

* ./hack/update-deps.sh

* ./hack/update-codegen.sh
2019-03-14 13:48:45 -07:00
chaodaiG b899d3fdac Make verify-codegen.sh also check /vendor (#180)
Replicated from: https://github.com/knative/serving/pull/2561

Original link: https://github.com/knative/serving/issues/1711`
2018-11-30 12:37:24 -08:00
Matt Moore 5c809f170b Add logic to check the licenses of our common package (#135)
* Add logic to check the licenses of our common packages.

* Update test-infra.

* Fix the test-infra vendor
2018-10-25 17:37:31 -07:00
Vincent Demeester 8e471c3d74 Use `/usr/bin/env bash` instead of `/bin/bash` (#107)
Some systems may not have `/bin/bash` (NixOS for example)… Using
`/usr/bin/env bash` has the benefit of looking for whatever the
default version of the program is in your current environment.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
2018-10-02 00:02:23 -07:00
Matt Moore 3473880674 Informers / Listers for Duck Types. (#86)
This starts to sketch common libraries for instantiating informers/listers for a particular GroupVersionResource as one of our duck types.

You can instantiate a duck.InformerFactory like so:
```go
        dynaClient, err := dynamic.NewForConfig(cfg)
        if err != nil {
                logger.Fatalf("Error building dynamic clientset: %v", err)
        }

	// Cache as the outermost layer so we only register the EventHandler once.
        dif := &duck.CachedInformerFactory{
                Delegate: &duck.EnqueueInformerFactory{
			Delegate: &duck.TypedInformerFactory{
        	                Client:       dynaClient,
                	        Type:         &duckv1alpha1.Target{},
                        	ResyncPeriod: 30 * time.Second,
	                        StopChannel:  stopCh,
			},
			EventHandler: cache.ResourceEventHandlerFuncs{
				AddFunc: func(obj interface{}) {
					// Enqueue, obj is: *duckerv1alpha1.Target
				},
				UpdateFunc: func(old, new interface{}) {
					// Enqueue, old and new are: *duckerv1alpha1.Target
				},
			},
                },
        }
```

Then, as you come across new GroupVersionResources that you want to handle:
```go
        informer, lister, err := dif.Get(gvr)
        if err != nil {
               logger.Fatalf("Error starting shared index informer: %v", err)
        }
```

With the `duck.TypedInformerFactory` the objects will be returned as the provided `Type:`, so in this example, you could safely write:
```go
        elt, err := lister.ByNamespace(ns).Get(name)
        if err != nil { ... }

        target := elt.(*duckv1alpha1.Target)
        // Stuff involving target.
```
2018-09-24 20:10:20 -07:00
Matt Moore 28fe5a05de Don't generate clients for apis/duck (#82)
... they are not real types.

Fixes: https://github.com/knative/pkg/issues/75
2018-09-20 14:56:19 -07:00
Matt Moore 9a13caa7a1 WIP Define a package with which to support duck typed definitions. (#71)
This also sketches out the skeletons for Targettable, Subscribable, and Conditions.
2018-09-15 19:08:17 -07:00
Adriano Cunha eedc0a939d Make verify-codegen.sh compatible with OS X (#54)
OS X's `mktemp` has no `-p` flag.
2018-08-26 08:42:02 -07:00
Adriano Cunha 4be5c07977 Vendor the test-infra scripts (#52)
* 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.
2018-08-23 21:30:59 -07:00
Zhimin Xiang 62d2560a1f Add Istio DestinationRule and Policy into Istio apis and clients (#43)
* initial draft

* fix incorrect dependency on knative/serving

* 1. Move StringMatch from istio/v1alpha3 to istio/common/v1alpha1. 2. Add field excludedPaths into Policy

* fix typo
2018-08-22 16:16:59 -07:00
Scott Andrews a088fee622 Add Istio client from knative/serving (#35)
* 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
2018-08-03 16:14:10 -07:00
Matt Moore fdf2fdcd93 Move the test resource out of `./webhook`. (#32)
This is so that other things can more naturally write tests using this same test resource.
2018-07-31 16:02:37 -07:00
Matt Moore 4d4c00734e Pull the webhook from `knative/serving` into `knative/pkg`. (#23)
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
2018-07-27 19:03:36 -07:00
Matt Moore 8b7b2d7cfb Move the logging packages from serving into pkg. (#21) 2018-07-27 09:53:35 -07:00
Matt Moore f8e84c0d02
Copy `pkg/configmap` over from `knative/serving`. (#11) 2018-07-25 14:56:29 -07:00