@@ -19,7 +19,7 @@ use stackable_operator::{
1919 fragment:: { self , Fragment , ValidationError } ,
2020 merge:: Merge ,
2121 } ,
22- crd:: git_sync:: { self , credentials_secret_to_basic_auth , credentials_to_secret } ,
22+ crd:: git_sync:: { self } ,
2323 deep_merger:: ObjectOverrides ,
2424 k8s_openapi:: {
2525 api:: core:: v1:: { Volume , VolumeMount } ,
@@ -53,7 +53,7 @@ use crate::{
5353 AirflowAuthenticationClassResolved , AirflowClientAuthenticationDetails ,
5454 AirflowClientAuthenticationDetailsResolved ,
5555 } ,
56- v1alpha1 :: WebserverRoleConfig ,
56+ v1alpha2 :: WebserverRoleConfig ,
5757 } ,
5858 util:: role_service_name,
5959} ;
@@ -214,7 +214,7 @@ pub mod versioned {
214214
215215 /// The `webservers` role provides the main UI for user interaction.
216216 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
217- pub webservers : Option < Role < AirflowConfigFragment , v1alpha1 :: WebserverRoleConfig > > ,
217+ pub webservers : Option < Role < AirflowConfigFragment , v1alpha2 :: WebserverRoleConfig > > ,
218218
219219 /// The `schedulers` is responsible for triggering jobs and persisting their metadata to the backend database.
220220 /// Jobs are scheduled on the workers/executors.
@@ -254,12 +254,10 @@ pub mod versioned {
254254 /// Learn more in the
255255 /// [mounting DAGs documentation](DOCS_BASE_URL_PLACEHOLDER/airflow/usage-guide/mounting-dags#_via_git_sync).
256256 #[ serde( default ) ]
257- #[ versioned( changed(
258- since = "v1alpha2" ,
259- from_type = "Vec<git_sync::v1alpha1::GitSync>" ,
260- upgrade_with = gitsync_v1_to_v2,
261- downgrade_with = gitsync_v2_to_v1
262- ) ) ]
257+ #[ versioned(
258+ changed( since = "v1alpha2" , from_type = "Vec<git_sync::v1alpha1::GitSync>" ) ,
259+ hint( vec)
260+ ) ]
263261 pub dags_git_sync : Vec < git_sync:: v1alpha2:: GitSync > ,
264262
265263 /// for internal use only - not for production use.
@@ -305,40 +303,6 @@ pub mod versioned {
305303 }
306304}
307305
308- pub fn gitsync_v1_to_v2 (
309- input : Vec < git_sync:: v1alpha1:: GitSync > ,
310- ) -> Vec < git_sync:: v1alpha2:: GitSync > {
311- input
312- . iter ( )
313- . map ( |g| git_sync:: v1alpha2:: GitSync {
314- credentials : credentials_secret_to_basic_auth ( g. credentials_secret . clone ( ) ) ,
315- repo : g. repo . clone ( ) ,
316- branch : g. branch . clone ( ) ,
317- git_folder : g. git_folder . clone ( ) ,
318- depth : g. depth ,
319- wait : g. wait ,
320- git_sync_conf : g. git_sync_conf . clone ( ) ,
321- } )
322- . collect ( )
323- }
324-
325- pub fn gitsync_v2_to_v1 (
326- input : Vec < git_sync:: v1alpha2:: GitSync > ,
327- ) -> Vec < git_sync:: v1alpha1:: GitSync > {
328- input
329- . iter ( )
330- . map ( |g| git_sync:: v1alpha1:: GitSync {
331- credentials_secret : credentials_to_secret ( g. credentials . clone ( ) ) ,
332- repo : g. repo . clone ( ) ,
333- branch : g. branch . clone ( ) ,
334- git_folder : g. git_folder . clone ( ) ,
335- depth : g. depth ,
336- wait : g. wait ,
337- git_sync_conf : g. git_sync_conf . clone ( ) ,
338- } )
339- . collect ( )
340- }
341-
342306#[ derive( Clone , Debug , Deserialize , JsonSchema , PartialEq , Serialize ) ]
343307#[ serde( rename_all = "camelCase" ) ]
344308pub struct DatabaseInitializationConfig {
@@ -361,9 +325,9 @@ pub fn default_db_init() -> bool {
361325 true
362326}
363327
364- impl Default for v1alpha1 :: WebserverRoleConfig {
328+ impl Default for v1alpha2 :: WebserverRoleConfig {
365329 fn default ( ) -> Self {
366- v1alpha1 :: WebserverRoleConfig {
330+ v1alpha2 :: WebserverRoleConfig {
367331 listener_class : webserver_default_listener_class ( ) ,
368332 common : Default :: default ( ) ,
369333 }
0 commit comments