Using Git Connector in Tekton Tasks enables centralized management of tool integration information and secure access to Git repositories during Tekton Task execution. Currently, Git Connector only supports BasicAuth authentication method and does not support SSH authentication.
Not all Tekton Tasks can use Git Connector.
Git Connector essentially injects temporary Git credentials through a CSI Driver. It provides a configuration named gitconfig
that generates a .gitconfig
file with temporary authentication and URL rewriting settings.
For example:
Therefore, Tekton Tasks must meet the following requirement to use Git Connector:
Support mounting a .gitconfig
file via Workspace, and the Workspace must support providing only the .gitconfig
file
After confirming that your Tekton Task can use Git Connector, you can add Git Connector configuration to the TaskRun YAML file:
For example:
Parameter descriptions:
name
: The Workspace name defined in the Taskcsi
:
driver
: Fixed value connectors-csi
readOnly
: Fixed value true
volumeAttributes
: CSI Volume attributes
connector.name
: Name of the Git Connectorconnector.namespace
: Namespace of the Git Connector; if not specified, the TaskRun's namespace is usedconfiguration.names
: Configuration name, fixed as gitconfig
, which will generate a .gitconfig
file in the $(workspaces.basic-auth.path)
directoryFor more information, please refer to Connectors CSI Configuration.