caching/vendor/knative.dev/pkg/apis/duck
Dave Protasowski 0d09958897
bump deps (#940)
2025-06-12 03:22:46 +00:00
..
ducktypes [master] Auto-update dependencies (#285) 2020-07-13 09:25:18 -07:00
v1 bump deps (#940) 2025-06-12 03:22:46 +00:00
ABOUT.md upgrade to latest dependencies (#530) 2021-09-09 23:36:32 -07:00
README.md upgrade to latest dependencies (#361) 2020-10-18 19:36:58 -07:00
cached.go upgrade to latest dependencies (#353) 2020-10-06 20:38:21 -07:00
const.go upgrade to latest dependencies (#353) 2020-10-06 20:38:21 -07:00
doc.go upgrade to latest dependencies (#353) 2020-10-06 20:38:21 -07:00
enqueue.go upgrade to latest dependencies (#353) 2020-10-06 20:38:21 -07:00
interface.go upgrade to latest dependencies (#353) 2020-10-06 20:38:21 -07:00
patch.go upgrade to latest dependencies (#480) 2021-06-02 07:36:30 -07:00
register.go upgrade to latest dependencies (#474) 2021-05-26 09:17:28 -07:00
typed.go bump deps (#940) 2025-06-12 03:22:46 +00:00
unstructured.go upgrade to latest dependencies (#353) 2020-10-06 20:38:21 -07:00
verify.go upgrade to latest dependencies (#876) 2024-06-25 18:48:06 +00:00

README.md

Duck Types

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

For APIs leveraging ObjectReference, the context of the resource in question identifies the duck-type. To enable the case where no ObjectReference 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