Using the Knative sample repository
- You are familiar with Kubernetes and Go development.
- You have installed Git.
- You have cloned the .
Optional:
- Translates resource variables to the underlying adapter structure, so that they can be passed into the Knative system.
pkg/adapter/adapter.go
- The functions that support receiver adapter translation of events to CloudEvents.
- The
NewController
implementation that is passed to the sharedmain
method.
pkg/apis/samples/VERSION/samplesource_types.go
- The schema for the underlying API types, which provide the variables to be defined in the resource YAML file.
- Contains status information for the event source’s reconciliation details:
- Source ready
- Sink provided
- Deployed
- EventType provided
- Kubernetes resources correct
-
This includes the fields that are required in the resource YAML, as well as those referenced in the controller using the source’s clientset and API:
Define the lifecycle to be reflected in the
status
andSinkURI
fields:Set the lifecycle conditions by defining the functions to be called from the reconciler functions. This is typically done in
pkg/apis/samples/VERSION/samplesource_lifecycle.go
: