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