NamespaceSync​Namespace​Sync

Unidirectional namespace sync between Kestra and Git.

Create/update is driven by 'sourceOfTruth'; delete/keep/fail is driven by 'whenMissingInSource'.

yaml
type: "io.kestra.plugin.git.NamespaceSync"

Sync a namespace using Git as the source of truth (destructive).

yaml
id: git_namespace_sync
namespace: system
tasks:
  - id: sync
    type: io.kestra.plugin.git.NamespaceSync
    namespace: system
    sourceOfTruth: GIT
    whenMissingInSource: DELETE
    protectedNamespaces:
      - system
    url: https://github.com/fdelbrayelle/plugin-git-qa
    username: fdelbrayelle
    password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
    branch: main
    gitDirectory: kestra

Sync a namespace using Kestra as source of truth (additive).

yaml
id: kestra_namespace_sync
namespace: system
tasks:
  - id: sync
    type: io.kestra.plugin.git.NamespaceSync
    namespace: system
    sourceOfTruth: KESTRA
    whenMissingInSource: KEEP
    protectedNamespaces:
      - system
    url: https://github.com/fdelbrayelle/plugin-git-qa
    username: fdelbrayelle
    password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
    branch: dev
    # gitDirectory omitted -> repository root
    onInvalidSyntax: WARN
    # dryRun omitted
Properties

The branch to read from / write to (required).

Target namespace to sync (required).

The commit author email.

The commit author name (defaults to username if null).

Whether to clone submodules

Default false

If true, only compute the plan and output a diff without applying changes.

Git configuration to apply to the repository

Map of Git config keys and values, applied after clone few examples: - 'core.fileMode': false -> ignore file permission changes - 'core.autocrlf': false -> prevent line ending conversion

Subdirectory inside the repo used to store Kestra code and files; if empty, repo root is used.

This is the base folder in your Git repository where Kestra will look for code and files. If you don't set it, the repo root will be used. Inside that folder, Kestra always expects a structure like /flows, /files, etc.

gitDirectorynamespaceExpected Git path
(not set)companycompany/flows/my-flow.yaml
monoreposystemmonorepo/system/flows/my-flow.yaml
projectAcompany.teamprojectA/company.team/flows/my-flow.yaml
Default FAIL
Possible Values
SKIPWARNFAIL

Behavior when encountering invalid syntax while syncing.

The passphrase for the privateKey

The password or Personal Access Token (PAT) -- when you authenticate the task with a PAT, any flows or files pushed to Git from Kestra will be pushed from the user associated with that PAT. This way, you don't need to configure the commit author (the authorName and authorEmail properties).

PEM-format private key content that is paired with a public key registered on Git

To generate an ECDSA PEM format key from OpenSSH, use the following command: ssh-keygen -t ecdsa -b 256 -m PEM. You can then set this property with your private key content and put your public key on Git.

SubType string
Default ["system"]

Namespaces protected from deletion regardless of policies.

Default KESTRA
Possible Values
GITKESTRA

Select the source of truth.

Optional path to a PEM-encoded CA certificate to trust (in addition to the JVM default truststore)

Equivalent to git config http.sslCAInfo <path>. Use this for self-signed/internal CAs.

The URI to clone from

The username or organization

Default DELETE
Possible Values
DELETEKEEPFAIL

Behavior when an object is missing from the selected source of truth.

ID of the commit pushed (if any).

URL to the commit (if any).

Format uri

A file containing all changes applied (or not in case of dry run) to/from Git.