Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Migrating to the PingSource

With the release of 0.13 the CronJobsource is deprecated, and should be converted to the PingSource

Here is an example of a CronJobSource that delivers messages to a given sink:

apiVersion: sources.eventing.knative.dev/v1alpha1
kind: CronJobSource
metadata:
  name: cronjob-source
spec:
  schedule: "* * * * *"
  data: '{"message": "Hello world!"}'
  sink:
    apiVersion: eventing.knative.dev/v1alpha1
    kind: Broker
    name: default

Migration to the newer PingSource requires a few steps, and the sample now looks like:

apiVersion: sources.knative.dev/v1alpha2
kind: PingSource
metadata:
  name: ping-source
spec:
  schedule: "* * * * *"
  jsonData: '{"message": "Hello world!"}'
  sink:
    ref:
      apiVersion: eventing.knative.dev/v1beta1
      kind: Broker
      name: default

Biggest impact on changes were:

  • different GVK (see apiVersion/Kind diffs)
  • spec now uses jsonData on the PingSource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment