Git source type
Depending on a runtime you use to build your Function (Node.js 14, Node.js 16, or Python 3.9), your Git repository must contain at least a directory with these files:
handler.pywith Function's code
requirements.txtwith Function's dependencies
The Function CR must contain
type: git to specify that you use a Git repository for the Function's sources.
To create a Function with the Git source, you must:
- Create a GitRepository CR with details of your Git repository.
- Create a Secret (optional, only if you must authenticate to the repository).
- Create a Function CR with your Function definition and references to the Git repository.
NOTE: For detailed steps, see the tutorial on creating a Function from Git repository sources.
You can have various setups for your Function's Git source with different:
You can specify the location of your code dependencies with the baseDir parameter in the Function CR. For example, use
"/"if you keep the source files at the root of your repository.
You can define with the spec.auth parameter in the GitRepository CR that you must authenticate to the repository with a password or token (
basic), or an SSH key (
Function's rebuild triggers
You can use the reference parameter in the GitRepository CR to define whether the Function Controller must monitor a given branch or commit in the Git repository to rebuild the Function upon their changes.