pkg/apis/duck
Matt Moore 891c2876dd Implement a base library for implementing "Pod Spec"-able bindings. (#915)
This PR adds facilities to make it easier to create both components of a Binding
over "Pod Spec"-able resources.  Rather than rehashing it all here, please look
at `./pkg/webhook/psbinding/README.md` for more details.
2019-12-02 08:58:34 -08:00
..
v1 Reduce the boilerplate for setting up duck.InformerFactory's. (#896) 2019-11-25 09:57:10 -08:00
v1alpha1 Fix the serialized name of the spec field (oops) (#899) 2019-11-25 13:24:21 -08:00
v1beta1 Reduce the boilerplate for setting up duck.InformerFactory's. (#896) 2019-11-25 09:57:10 -08:00
OWNERS Update OWNERS to use OWNERS_ALIASES (#422) 2019-05-29 20:04:33 -07:00
README.md Format markdown (#904) 2019-11-26 10:28:21 -08:00
cached.go Informers / Listers for Duck Types. (#86) 2018-09-24 20:10:20 -07:00
cached_test.go Assorted linting fixes. (#840) 2019-11-01 12:49:12 -07:00
const.go Implement a base library for implementing "Pod Spec"-able bindings. (#915) 2019-12-02 08:58:34 -08:00
doc.go Link to the doc on Duck Typing, which I missed adding before. (#105) 2018-09-28 16:33:22 -07:00
enqueue.go Informers / Listers for Duck Types. (#86) 2018-09-24 20:10:20 -07:00
enqueue_test.go Informers / Listers for Duck Types. (#86) 2018-09-24 20:10:20 -07:00
interface.go Implement a base library for implementing "Pod Spec"-able bindings. (#915) 2019-12-02 08:58:34 -08:00
patch.go Move duck patch helper function from Knative Serving to pkg (#681) 2019-09-15 21:35:40 -07:00
patch_test.go Reduce the boilerplate for setting up duck.InformerFactory's. (#896) 2019-11-25 09:57:10 -08:00
proxy.go Add logic to convert the watch.Interface. (#106) 2018-09-29 21:38:22 -07:00
register.go WIP Define a package with which to support duck typed definitions. (#71) 2018-09-15 19:08:17 -07:00
scale_test.go Reduce the boilerplate for setting up duck.InformerFactory's. (#896) 2019-11-25 09:57:10 -08:00
typed.go Add check in informer to make controllers work when process invalid resources (#880) 2019-11-26 14:16:21 -08:00
typed_test.go Add check in informer to make controllers work when process invalid resources (#880) 2019-11-26 14:16:21 -08:00
unstructured.go Implement a base library for implementing "Pod Spec"-able bindings. (#915) 2019-12-02 08:58:34 -08:00
unstructured_test.go Add a simple ToUnstructured method for converting our types to unstructured. (#900) 2019-11-26 10:05:21 -08:00
verify.go Reduce the boilerplate for setting up duck.InformerFactory's. (#896) 2019-11-25 09:57:10 -08:00
verify_test.go Reduce the boilerplate for setting up duck.InformerFactory's. (#896) 2019-11-25 09:57:10 -08:00

README.md

Duck Types

Knative leverages duck-typing to interact with resources inside of Kubernetes without explicit knowlage of the full resource shape. knative/pkg defines two duck types that are used throughout Knative: Addressable and Source.

For APIs leveraging ObjectReference, the context of the resource in question identifies the duck-type. To enable the case where no ObjectRefrence is used, we have labeled the Custom Resource Definition with the duck-type. Those labels are as follows:

Label Duck-Type
duck.knative.dev/addressable=true Addressable
duck.knative.dev/binding=true Binding
duck.knative.dev/source=true Source

Addressable Shape

Addressable is expected to be the following shape:

apiVersion: group/version
kind: Kind
status:
  address:
    url: http://host/path?query

Binding Shape

Binding is expected to be in the following shape:

(with direct subject)

apiVersion: group/version
kind: Kind
spec:
  subject:
    apiVersion: group/version
    kind: SomeKind
    namespace: the-namespace
    name: a-name

(with indirect subject)

apiVersion: group/version
kind: Kind
spec:
  subject:
    apiVersion: group/version
    kind: SomeKind
    namespace: the-namespace
    selector:
      matchLabels:
        key: value

Source Shape

Source is expected to be in the following shape:

(with ref sink)

apiVersion: group/version
kind: Kind
spec:
  sink:
    ref:
      apiVersion: group/version
      kind: AnAddressableKind
      name: a-name
  ceOverrides:
    extensions:
      key: value
status:
  observedGeneration: 1
  conditions:
    - type: Ready
      status: "True"
  sinkUri: http://host

(with uri sink)

apiVersion: group/version
kind: Kind
spec:
  sink:
    uri: http://host/path?query
  ceOverrides:
    extensions:
      key: value
status:
  observedGeneration: 1
  conditions:
    - type: Ready
      status: "True"
  sinkUri: http://host/path?query

(with ref and uri sink)

apiVersion: group/version
kind: Kind
spec:
  sink:
    ref:
      apiVersion: group/version
      kind: AnAddressableKind
      name: a-name
    uri: /path?query
  ceOverrides:
    extensions:
      key: value
status:
  observedGeneration: 1
  conditions:
    - type: Ready
      status: "True"
  sinkUri: http://host/path?query