Using the Knative sample repository

    • You are familiar with Kubernetes and Go development.
    • You have installed Git.
    • You have cloned the .

    Optional:

    • Install the ko CLI tool.
    • Install the CLI tool.
    • Set up minikube or .
    • - 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 shared main 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
    1. 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:

    2. Define the lifecycle to be reflected in the status and SinkURI fields:

    3. 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: