Skip to content

Commit 9c284ad

Browse files
committed
switch gitsync to v2
1 parent 5e4d838 commit 9c284ad

6 files changed

Lines changed: 39 additions & 39 deletions

File tree

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate-hashes.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/airflow_controller.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub enum Error {
224224
},
225225

226226
#[snafu(display("invalid git-sync specification"))]
227-
InvalidGitSyncSpec { source: git_sync::v1alpha1::Error },
227+
InvalidGitSyncSpec { source: git_sync::v1alpha2::Error },
228228

229229
#[snafu(display("failed to create cluster resources"))]
230230
CreateClusterResources {
@@ -530,7 +530,7 @@ pub async fn reconcile_airflow(
530530
.merged_config(&airflow_role, &rolegroup)
531531
.context(FailedToResolveConfigSnafu)?;
532532

533-
let git_sync_resources = git_sync::v1alpha1::GitSyncResources::new(
533+
let git_sync_resources = git_sync::v1alpha2::GitSyncResources::new(
534534
&airflow.spec.cluster_config.dags_git_sync,
535535
&resolved_product_image,
536536
&env_vars_from_rolegroup_config(rolegroup_config),
@@ -717,7 +717,7 @@ async fn build_executor_template(
717717
rolegroup: rolegroup.clone(),
718718
})?;
719719

720-
let git_sync_resources = git_sync::v1alpha1::GitSyncResources::new(
720+
let git_sync_resources = git_sync::v1alpha2::GitSyncResources::new(
721721
&airflow.spec.cluster_config.dags_git_sync,
722722
resolved_product_image,
723723
&env_vars_from(&common_config.env_overrides),
@@ -934,7 +934,7 @@ fn build_server_rolegroup_statefulset(
934934
service_account: &ServiceAccount,
935935
merged_airflow_config: &AirflowConfig,
936936
executor: &AirflowExecutor,
937-
git_sync_resources: &git_sync::v1alpha1::GitSyncResources,
937+
git_sync_resources: &git_sync::v1alpha2::GitSyncResources,
938938
) -> Result<StatefulSet> {
939939
let binding = airflow.get_role(airflow_role);
940940
let role = binding.as_ref().context(NoAirflowRoleSnafu)?;
@@ -1255,7 +1255,7 @@ fn build_executor_template_config_map(
12551255
env_overrides: &HashMap<String, String>,
12561256
pod_overrides: &PodTemplateSpec,
12571257
rolegroup_ref: &RoleGroupRef<v1alpha1::AirflowCluster>,
1258-
git_sync_resources: &git_sync::v1alpha1::GitSyncResources,
1258+
git_sync_resources: &git_sync::v1alpha2::GitSyncResources,
12591259
) -> Result<ConfigMap> {
12601260
let mut pb = PodBuilder::new();
12611261
let pb_metadata = ObjectMetaBuilder::new()
@@ -1437,7 +1437,7 @@ fn add_authentication_volumes_and_volume_mounts(
14371437
fn add_git_sync_resources(
14381438
pb: &mut PodBuilder,
14391439
cb: &mut ContainerBuilder,
1440-
git_sync_resources: &git_sync::v1alpha1::GitSyncResources,
1440+
git_sync_resources: &git_sync::v1alpha2::GitSyncResources,
14411441
add_sidecar_containers: bool,
14421442
add_init_containers: bool,
14431443
) -> Result<()> {

rust/operator-binary/src/crd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ pub mod versioned {
252252
/// Learn more in the
253253
/// [mounting DAGs documentation](DOCS_BASE_URL_PLACEHOLDER/airflow/usage-guide/mounting-dags#_via_git_sync).
254254
#[serde(default)]
255-
pub dags_git_sync: Vec<git_sync::v1alpha1::GitSync>,
255+
pub dags_git_sync: Vec<git_sync::v1alpha2::GitSync>,
256256

257257
/// for internal use only - not for production use.
258258
#[serde(default)]

rust/operator-binary/src/env_vars.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub fn build_airflow_statefulset_envs(
8080
executor: &AirflowExecutor,
8181
auth_config: &AirflowClientAuthenticationDetailsResolved,
8282
authorization_config: &AirflowAuthorizationResolved,
83-
git_sync_resources: &git_sync::v1alpha1::GitSyncResources,
83+
git_sync_resources: &git_sync::v1alpha2::GitSyncResources,
8484
resolved_product_image: &ResolvedProductImage,
8585
) -> Result<Vec<EnvVar>, Error> {
8686
let mut env: BTreeMap<String, EnvVar> = BTreeMap::new();
@@ -288,7 +288,7 @@ pub fn build_airflow_statefulset_envs(
288288
Ok(transform_map_to_vec(env))
289289
}
290290

291-
pub fn get_dags_folder(git_sync_resources: &git_sync::v1alpha1::GitSyncResources) -> String {
291+
pub fn get_dags_folder(git_sync_resources: &git_sync::v1alpha2::GitSyncResources) -> String {
292292
let git_sync_count = git_sync_resources.git_content_folders.len();
293293
if git_sync_count > 1 {
294294
tracing::warn!(
@@ -310,7 +310,7 @@ pub fn get_dags_folder(git_sync_resources: &git_sync::v1alpha1::GitSyncResources
310310
// This set of environment variables is a standard set that is not dependent on any
311311
// conditional logic and should be applied to the statefulset or the executor template config map.
312312
fn static_envs(
313-
git_sync_resources: &git_sync::v1alpha1::GitSyncResources,
313+
git_sync_resources: &git_sync::v1alpha2::GitSyncResources,
314314
) -> BTreeMap<String, EnvVar> {
315315
let mut env: BTreeMap<String, EnvVar> = BTreeMap::new();
316316

@@ -372,7 +372,7 @@ pub fn build_airflow_template_envs(
372372
airflow: &v1alpha1::AirflowCluster,
373373
env_overrides: &HashMap<String, String>,
374374
config: &ExecutorConfig,
375-
git_sync_resources: &git_sync::v1alpha1::GitSyncResources,
375+
git_sync_resources: &git_sync::v1alpha2::GitSyncResources,
376376
resolved_product_image: &ResolvedProductImage,
377377
) -> Vec<EnvVar> {
378378
let mut env: BTreeMap<String, EnvVar> = BTreeMap::new();

0 commit comments

Comments
 (0)