Add an Input CRD

We don't currently have any conventions for strongly typed inputs in
Python. I expect that Python functions will just use struct_to_dict to
read their inputs as unstructured data. It's useful to demonstrate
having an input schema in the template, though. Places like
https://marketplace.upbound.io use this CRD schema to document a
function's input.

Signed-off-by: Nic Cope <nicc@rk0n.org>
This commit is contained in:
Nic Cope 2024-01-09 16:59:18 -08:00
parent 137e88e402
commit f109678951
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: inputs.template.fn.crossplane.io
spec:
group: template.fn.crossplane.io
names:
categories:
- crossplane
kind: Input
listKind: InputList
plural: inputs
singular: input
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: Input can be used to provide input to this Function.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
example:
description: Example is an example field. Replace it with whatever input
you need. :)
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
required:
- example
type: object
served: true
storage: true