-
-
Notifications
You must be signed in to change notification settings - Fork 15
feat(stackable-operator): Add git-sync support #1024
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
68677a5
Add git-sync support
siegfriedweber 1ad347d
Merge branch 'main' into feat/git-sync
siegfriedweber 5d7a007
Version the git_sync structure as v1alpha1
siegfriedweber 613e58d
Rephrase the comment for GitSync::git_folder
siegfriedweber 6619fe4
Add logging support to git-sync containers
siegfriedweber 5bba49d
Use the type Url for the git-sync repository URL
siegfriedweber e8ad04b
Extend the comment of the GitSync structure
siegfriedweber 2cf42ff
Improve a comment in the GitSync structure
siegfriedweber 80c75f6
Extend the comment of the GitSync structure
siegfriedweber d04e4e9
Merge branch 'feat/git-sync' of github.com:stackabletech/operator-rs …
siegfriedweber 7dc7926
Reformat the code
siegfriedweber 84aa733
Improve the code style
siegfriedweber d8a8b45
Improve the code style
siegfriedweber 8a13bba
Improve the code style
siegfriedweber ea4e63f
Improve the code style
siegfriedweber dccf07d
Add always the git-sync parameter one-time
siegfriedweber b3e460e
Merge branch 'feat/git-sync' of github.com:stackabletech/operator-rs …
siegfriedweber c69b2d2
Improve the code style
siegfriedweber a2baa65
Improve the code style
siegfriedweber b41837a
Merge branch 'main' into feat/git-sync
siegfriedweber 80d7b3e
Disallow variants of the option `--git-config`
siegfriedweber 519c65d
Merge branch 'main' into feat/git-sync
siegfriedweber cb28be3
Merge branch 'main' into feat/git-sync
siegfriedweber 19a0ac9
Extend a comment in the GitSync structure
siegfriedweber 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
//! GitSync structure for CRDs | ||
|
||
use std::{collections::BTreeMap, path::PathBuf}; | ||
|
||
use schemars::{self, JsonSchema}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::{time::Duration, versioned::versioned}; | ||
|
||
mod v1alpha1_impl; | ||
|
||
#[versioned(version(name = "v1alpha1"))] | ||
pub mod versioned { | ||
pub mod v1alpha1 { | ||
pub use v1alpha1_impl::{Error, GitSyncResources}; | ||
} | ||
|
||
#[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`. | ||
pub repo: String, | ||
Techassi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// The branch to clone; defaults to `main`. | ||
/// | ||
/// Since git-sync v4.x.x this field is mapped to the flag `--ref`. | ||
#[serde(default = "GitSync::default_branch")] | ||
pub branch: String, | ||
Techassi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Location in the Git repository containing the resource. | ||
/// | ||
/// It can optionally start with `/`, however, no trailing slash is recommended. | ||
/// An empty string (``) or slash (`/`) corresponds to the root folder in Git. | ||
#[serde(default = "GitSync::default_git_folder")] | ||
pub git_folder: PathBuf, | ||
Techassi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// The depth of syncing, i.e. the number of commits to clone; defaults to 1. | ||
#[serde(default = "GitSync::default_depth")] | ||
pub depth: u32, | ||
|
||
/// 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`. | ||
#[serde(default = "GitSync::default_wait")] | ||
pub wait: Duration, | ||
Techassi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// The name of the Secret used to access the repository if it is not public. | ||
/// This should include two fields: `user` and `password`. | ||
/// The `password` field can either be an actual password (not recommended) or a GitHub token, | ||
/// as described [here](https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual). | ||
pub credentials_secret: Option<String>, | ||
siegfriedweber marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// A map of optional configuration settings that are listed in the [git-sync documentation](https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual). | ||
/// Read the [git sync example](DOCS_BASE_URL_PLACEHOLDER/airflow/usage-guide/mounting-dags#_example). | ||
#[serde(default)] | ||
pub git_sync_conf: BTreeMap<String, String>, | ||
Techassi marked this conversation as resolved.
Show resolved
Hide resolved
adwk67 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
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.