-
-
Notifications
You must be signed in to change notification settings - Fork 16
feat(stackable-operator): Support gitsync via SSH #1121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adwk67
wants to merge
7
commits into
main
Choose a base branch
from
feat/gitsync-ssh
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4b892dd
add ssh key information
adwk67 a18aeb4
remove ssh_known_hosts flag and git_ssh_volume_mounts
adwk67 ff025d4
Merge branch 'main' into feat/gitsync-ssh
adwk67 bed929e
pre-commit fix
adwk67 843820c
added check for multiple credential types
adwk67 3ab7a5f
changelog
adwk67 3bcde90
add gitsync to dummy cluster
adwk67 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,77 @@ spec: | |
| domainName: | ||
| description: A validated domain name type conforming to RFC 1123, so e.g. not an IP address | ||
| type: string | ||
| gitSync: | ||
| properties: | ||
| branch: | ||
| default: main | ||
| description: |- | ||
| The branch to clone; defaults to `main`. | ||
|
|
||
| Since git-sync v4.x.x this field is mapped to the flag `--ref`. | ||
| type: string | ||
| credentialsSecret: | ||
| description: |- | ||
| The name of the Secret used to access the repository if it is not public. | ||
|
|
||
| The referenced Secret must include two fields: `user` and `password`. | ||
| The `password` field can either be an actual password (not recommended) or a GitHub token, | ||
| as described in the git-sync [documentation]. | ||
| This cannot be provided if `ssh_secret` is also provided. | ||
|
|
||
| [documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual | ||
| nullable: true | ||
| type: string | ||
| depth: | ||
| default: 1 | ||
| description: The depth of syncing, i.e. the number of commits to clone; defaults to 1. | ||
| format: uint32 | ||
| minimum: 0.0 | ||
| type: integer | ||
| gitFolder: | ||
| default: / | ||
| description: |- | ||
| Location in the Git repository containing the resource; defaults to the root folder. | ||
|
|
||
| It can optionally start with `/`, however, no trailing slash is recommended. | ||
| An empty string (``) or slash (`/`) corresponds to the root folder in Git. | ||
| type: string | ||
| gitSyncConf: | ||
| additionalProperties: | ||
| type: string | ||
| default: {} | ||
| description: |- | ||
| A map of optional configuration settings that are listed in the git-sync [documentation]. | ||
|
|
||
| Also read the git-sync [example] in our documentation. These settings are not verified. | ||
|
|
||
| [documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual | ||
| [example]: https://docs.stackable.tech/home/nightly/airflow/usage-guide/mounting-dags#_example | ||
| type: object | ||
| repo: | ||
| description: 'The git repository URL that will be cloned, for example: `https://github.com/stackabletech/airflow-operator` or `ssh://[email protected]:stackable-airflow/dags.git`.' | ||
| format: uri | ||
| type: string | ||
| sshSecret: | ||
| description: |- | ||
| The name of the Secret used for SSH access to the repository. | ||
|
|
||
| The referenced Secret must include two fields: `key` and `knownHosts`. | ||
| This cannot be provided if `credentials_secret` is also provided. | ||
|
|
||
| [documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual | ||
| nullable: true | ||
| type: string | ||
| wait: | ||
| default: 20s | ||
| description: |- | ||
| The synchronization interval, e.g. `20s` or `5m`; defaults to `20s`. | ||
|
|
||
| Since git-sync v4.x.x this field is mapped to the flag `--period`. | ||
| type: string | ||
| required: | ||
| - repo | ||
| type: object | ||
| hostName: | ||
| type: string | ||
| kerberosRealmName: | ||
|
|
@@ -1402,6 +1473,7 @@ spec: | |
| - clientAuthenticationDetails | ||
| - clusterOperation | ||
| - domainName | ||
| - gitSync | ||
| - hostName | ||
| - kerberosRealmName | ||
| - opaConfig | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ pub mod versioned { | |
| #[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Eq, Serialize)] | ||
| #[serde(rename_all = "camelCase")] | ||
| pub struct GitSync { | ||
| /// The git repository URL that will be cloned, for example: `https://github.com/stackabletech/airflow-operator`. | ||
| /// The git repository URL that will be cloned, for example: `https://github.com/stackabletech/airflow-operator` or `ssh://[email protected]:stackable-airflow/dags.git`. | ||
| pub repo: Url, | ||
|
|
||
| /// The branch to clone; defaults to `main`. | ||
|
|
@@ -51,6 +51,7 @@ pub mod versioned { | |
| /// The referenced Secret must include two fields: `user` and `password`. | ||
| /// The `password` field can either be an actual password (not recommended) or a GitHub token, | ||
| /// as described in the git-sync [documentation]. | ||
| /// This cannot be provided if `ssh_secret` is also provided. | ||
| /// | ||
| /// [documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual | ||
| pub credentials_secret: Option<String>, | ||
|
|
@@ -63,5 +64,13 @@ pub mod versioned { | |
| /// [example]: DOCS_BASE_URL_PLACEHOLDER/airflow/usage-guide/mounting-dags#_example | ||
| #[serde(default)] | ||
| pub git_sync_conf: BTreeMap<String, String>, | ||
|
|
||
| /// The name of the Secret used for SSH access to the repository. | ||
| /// | ||
| /// The referenced Secret must include two fields: `key` and `knownHosts`. | ||
| /// This cannot be provided if `credentials_secret` is also provided. | ||
|
Comment on lines
+70
to
+71
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: Ideally we want this to be a single field instead which is an enum with two variants. This completely prevents the potential misuse by users. I know this is a breaking change, but we should consider it going forward. |
||
| /// | ||
| /// [documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual | ||
| pub ssh_secret: Option<String>, | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.