mirror of https://github.com/knative/pkg.git
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 |
||
|---|---|---|
| .. | ||
| ducktypes | ||
| images | ||
| v1 | ||
| v1alpha1 | ||
| v1beta1 | ||
| ABOUT.md | ||
| OWNERS | ||
| README.md | ||
| cached.go | ||
| cached_test.go | ||
| const.go | ||
| doc.go | ||
| enqueue.go | ||
| enqueue_test.go | ||
| interface.go | ||
| patch.go | ||
| patch_test.go | ||
| proxy.go | ||
| register.go | ||
| scale_test.go | ||
| typed.go | ||
| typed_test.go | ||
| unstructured.go | ||
| unstructured_test.go | ||
| v1_tests.go | ||
| v1beta1_tests.go | ||
| verify.go | ||
| verify_test.go | ||
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