-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmod.rs
More file actions
76 lines (63 loc) · 3.19 KB
/
mod.rs
File metadata and controls
76 lines (63 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! GitSync structure for CRDs
use std::{collections::BTreeMap, path::PathBuf};
use schemars::{self, JsonSchema};
use serde::{Deserialize, Serialize};
use stackable_shared::time::Duration;
use url::Url;
use crate::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` or `ssh://git@github.com:stackable-airflow/dags.git`.
pub repo: Url,
/// 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,
/// 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.
#[serde(default = "GitSync::default_git_folder")]
pub git_folder: PathBuf,
/// 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,
/// 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
pub credentials_secret: Option<String>,
/// 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]: 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.
///
/// [documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual
pub ssh_secret: Option<String>,
}
}