pkg/apis/duck
Matt Moore be5186c170
[master] golang format tools (#1479)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -name '*.pb.go' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-07-13 09:24:18 -07:00
..
ducktypes Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07:00
images Move duck typing document to markdown (#1184) 2020-04-07 07:59:00 -07:00
v1 Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07:00
v1alpha1 populate the v1alpha1.Hostname from the URI as per the spec (#1264) 2020-04-29 16:34:42 -07:00
v1beta1 [master] golang format tools (#1479) 2020-07-13 09:24:18 -07:00
ABOUT.md Move duck typing document to markdown (#1184) 2020-04-07 07:59:00 -07:00
OWNERS add self to aliases and add reviewers to OWNERS (#1409) 2020-06-22 12:30:27 -07:00
README.md Format markdown (#904) 2019-11-26 10:28:21 -08:00
cached.go Allow retry of informer cache init upon error (#1221) 2020-04-17 09:02:48 -07:00
cached_test.go Clean context.TODO in pkg and other minor nits (#1337) 2020-05-15 10:58:02 -07:00
const.go add ability to opt-out of bindings (#970) 2020-01-07 08:56:51 -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 Update jsonpatch lib that correctly handle object removal (#1078) 2020-02-12 08:27:22 -08:00
patch_test.go Update jsonpatch lib that correctly handle object removal (#1078) 2020-02-12 08:27:22 -08:00
proxy.go Add logic to convert the watch.Interface. (#106) 2018-09-29 21:38:22 -07:00
register.go Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07:00
scale_test.go Some fixes we did in server upstream to pkg (#1244) 2020-04-24 15:03:49 -07: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 Assorted linting fixes. (#1443) 2020-06-24 12:11:27 -07: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
v1_tests.go [master] golang format tools (#1479) 2020-07-13 09:24:18 -07:00
v1beta1_tests.go Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07:00
verify.go Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07: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