@@ -61,7 +61,7 @@ func TestLoadConfig_FromConfigMapOnly(t *testing.T) {
6161 assert .Equal (t , "configmap-secret-key" , config .Elasticsearch .SnapshotRepository .SecretKey )
6262 // Verify legacy mode
6363 assert .True (t , config .IsLegacyMode ())
64- assert .True (t , config .StorageEnabled ())
64+ assert .True (t , config .GlobalBackupEnabled ())
6565}
6666
6767func TestLoadConfig_Storage_FromConfigMapOnly (t * testing.T ) {
@@ -96,14 +96,65 @@ func TestLoadConfig_Storage_FromConfigMapOnly(t *testing.T) {
9696 assert .Equal (t , "configmap-secret-key" , config .Elasticsearch .SnapshotRepository .SecretKey )
9797 // Verify new storage mode (not legacy)
9898 assert .False (t , config .IsLegacyMode ())
99- assert .True (t , config .StorageEnabled ())
99+ assert .True (t , config .GlobalBackupEnabled ())
100100 // Verify storage accessor methods return storage config values
101101 assert .Equal (t , "suse-observability-storage" , config .GetStorageService ().Name )
102102 assert .Equal (t , 9000 , config .GetStorageService ().Port )
103103 assert .Equal (t , "storageadmin" , config .GetStorageAccessKey ())
104104 assert .Equal (t , "storageadmin" , config .GetStorageSecretKey ())
105105}
106106
107+ func TestGlobalBackupEnabled_StorageMode_Disabled (t * testing.T ) {
108+ config := & Config {
109+ Storage : StorageConfig {
110+ GlobalBackupEnabled : false ,
111+ Service : ServiceConfig {
112+ Name : "storage" ,
113+ Port : 9000 ,
114+ LocalPortForwardPort : 9000 ,
115+ },
116+ },
117+ }
118+
119+ assert .False (t , config .IsLegacyMode ())
120+ assert .False (t , config .GlobalBackupEnabled ())
121+ }
122+
123+ func TestGlobalBackupEnabled_StorageMode_Enabled (t * testing.T ) {
124+ config := & Config {
125+ Storage : StorageConfig {
126+ GlobalBackupEnabled : true ,
127+ Service : ServiceConfig {
128+ Name : "storage" ,
129+ Port : 9000 ,
130+ LocalPortForwardPort : 9000 ,
131+ },
132+ },
133+ }
134+
135+ assert .False (t , config .IsLegacyMode ())
136+ assert .True (t , config .GlobalBackupEnabled ())
137+ }
138+
139+ func TestGlobalBackupEnabled_LegacyMode (t * testing.T ) {
140+ config := & Config {
141+ Minio : MinioConfig {
142+ Enabled : false ,
143+ Service : ServiceConfig {
144+ Name : "minio" ,
145+ Port : 9000 ,
146+ LocalPortForwardPort : 9000 ,
147+ },
148+ },
149+ }
150+
151+ assert .True (t , config .IsLegacyMode ())
152+ assert .False (t , config .GlobalBackupEnabled ())
153+
154+ config .Minio .Enabled = true
155+ assert .True (t , config .GlobalBackupEnabled ())
156+ }
157+
107158func TestLoadConfig_CompleteConfiguration (t * testing.T ) {
108159 fakeClient := fake .NewClientset ()
109160 validConfigYAML := loadTestData (t , "validConfigMapConfig.yaml" )
@@ -223,7 +274,7 @@ func TestLoadConfig_Storage_CompleteConfiguration(t *testing.T) {
223274
224275 // Verify new storage mode (not legacy)
225276 assert .False (t , config .IsLegacyMode ())
226- assert .True (t , config .StorageEnabled ())
277+ assert .True (t , config .GlobalBackupEnabled ())
227278
228279 // Service config
229280 assert .Equal (t , "suse-observability-elasticsearch-master-headless" , config .Elasticsearch .Service .Name )
0 commit comments