@@ -290,17 +290,16 @@ func containsProxy(pluginInfo *UIPluginInfo) (bool, bool, bool) {
290290}
291291
292292var features = []string {}
293- var acmVersion = "v2.11"
294293var clusterVersion = "v4.18"
295294
296- func getPluginInfo (plugin * uiv1alpha1.UIPlugin , features []string , clusterVersion string , acmVersion string ) (* UIPluginInfo , error ) {
297- return createMonitoringPluginInfo (plugin , namespace , name , image , features , acmVersion , clusterVersion )
295+ func getPluginInfo (plugin * uiv1alpha1.UIPlugin , features []string , clusterVersion string ) (* UIPluginInfo , error ) {
296+ return createMonitoringPluginInfo (plugin , namespace , name , image , features , clusterVersion )
298297}
299298
300299func TestCreateMonitoringPluginInfo (t * testing.T ) {
301300 /** Postive Test - ALL **/
302301 t .Run ("Test createMonitoringPluginInfo with all monitoring configurations" , func (t * testing.T ) {
303- pluginInfo , error := getPluginInfo (pluginConfigAll , features , clusterVersion , acmVersion )
302+ pluginInfo , error := getPluginInfo (pluginConfigAll , features , clusterVersion )
304303 assert .Assert (t , error == nil )
305304
306305 alertmanagerProxyFound , thanosProxyFound , persesProxyFound := containsProxy (pluginInfo )
@@ -316,7 +315,7 @@ func TestCreateMonitoringPluginInfo(t *testing.T) {
316315
317316 /** Postive Test - ACM **/
318317 t .Run ("Test createMonitoringPluginInfo with AMC configuration only" , func (t * testing.T ) {
319- pluginInfo , error := getPluginInfo (pluginConfigACM , features , clusterVersion , acmVersion )
318+ pluginInfo , error := getPluginInfo (pluginConfigACM , features , clusterVersion )
320319 assert .Assert (t , error == nil )
321320
322321 alertmanagerProxyFound , thanosProxyFound , persesProxyFound := containsProxy (pluginInfo )
@@ -330,25 +329,9 @@ func TestCreateMonitoringPluginInfo(t *testing.T) {
330329 assert .Assert (t , incidentsFlagFound == false )
331330 })
332331
333- t .Run ("Test validACMConfig() with valid and invalid acmVersions" , func (t * testing.T ) {
334-
335- // UIPlugin monitoring ACM feature is only supported in v2.11+
336- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "v2.11.3" ) == true )
337- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "v2.11" ) == true )
338- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "2.11" ) == true )
339- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "v2.11" ) == true )
340-
341- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "2.10" ) == false )
342- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "v2.10" ) == false )
343- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "1.0.0" ) == false )
344- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "v1.0.0" ) == false )
345-
346- assert .Assert (t , validateACMConfig (pluginConfigACM .Spec .Monitoring , "acm version not found" ) == false )
347- })
348-
349332 /** Postive Test - Perses **/
350333 t .Run ("Test createMonitoringPluginInfo with Perses configuration only" , func (t * testing.T ) {
351- pluginInfo , error := getPluginInfo (pluginConfigPerses , features , clusterVersion , acmVersion )
334+ pluginInfo , error := getPluginInfo (pluginConfigPerses , features , clusterVersion )
352335 assert .Assert (t , error == nil )
353336
354337 alertmanagerProxyFound , thanosProxyFound , persesProxyFound := containsProxy (pluginInfo )
@@ -364,7 +347,7 @@ func TestCreateMonitoringPluginInfo(t *testing.T) {
364347 })
365348
366349 t .Run ("Test createMonitoringPluginInfo with Perses default namespace and namespace" , func (t * testing.T ) {
367- pluginInfo , error := getPluginInfo (pluginConfigPersesDefault , features , clusterVersion , acmVersion )
350+ pluginInfo , error := getPluginInfo (pluginConfigPersesDefault , features , clusterVersion )
368351 assert .Assert (t , error == nil )
369352
370353 alertmanagerProxyFound , thanosProxyFound , persesProxyFound := containsProxy (pluginInfo )
@@ -382,7 +365,7 @@ func TestCreateMonitoringPluginInfo(t *testing.T) {
382365 t .Run ("Test createMonitoringPluginInfo with Perses default serviceName" , func (t * testing.T ) {
383366 // should not throw an error because serviceName is allowed to be empty
384367 // a default serviceName will be assigned
385- pluginInfo , error := getPluginInfo (pluginConfigPersesDefaultServiceName , features , clusterVersion , acmVersion )
368+ pluginInfo , error := getPluginInfo (pluginConfigPersesDefaultServiceName , features , clusterVersion )
386369 assert .Assert (t , error == nil )
387370
388371 alertmanagerProxyFound , thanosProxyFound , persesProxyFound := containsProxy (pluginInfo )
@@ -399,7 +382,7 @@ func TestCreateMonitoringPluginInfo(t *testing.T) {
399382 t .Run ("Test createMonitoringPluginInfo with Perses default namespace" , func (t * testing.T ) {
400383 // should not throw an error because namespace is allowed to be empty
401384 // a default namespace will be assigned
402- pluginInfo , error := getPluginInfo (pluginConfigPersesDefaultNamespace , features , clusterVersion , acmVersion )
385+ pluginInfo , error := getPluginInfo (pluginConfigPersesDefaultNamespace , features , clusterVersion )
403386 assert .Assert (t , error == nil )
404387
405388 alertmanagerProxyFound , thanosProxyFound , persesProxyFound := containsProxy (pluginInfo )
@@ -415,7 +398,7 @@ func TestCreateMonitoringPluginInfo(t *testing.T) {
415398
416399 /** Postive Test - Incidients **/
417400 t .Run ("Test createMonitoringPluginInfo with Incidents configuration only" , func (t * testing.T ) {
418- pluginInfo , error := getPluginInfo (pluginConfigIncidents , features , clusterVersion , acmVersion )
401+ pluginInfo , error := getPluginInfo (pluginConfigIncidents , features , clusterVersion )
419402 assert .Assert (t , error == nil )
420403
421404 alertmanagerProxyFound , thanosProxyFound , persesProxyFound := containsProxy (pluginInfo )
@@ -456,30 +439,30 @@ func TestCreateMonitoringPluginInfo(t *testing.T) {
456439 /** Negative Tests - ACM **/
457440 t .Run ("Test createMonitoringPluginInfo with missing URL from thanos" , func (t * testing.T ) {
458441 // this should throw an error because thanosQuerier.URL is not set
459- pluginInfo , error := getPluginInfo (pluginConfigAlertmanager , features , clusterVersion , acmVersion )
442+ pluginInfo , error := getPluginInfo (pluginConfigAlertmanager , features , clusterVersion )
460443 assert .Assert (t , pluginInfo == nil )
461444 assert .Assert (t , error != nil )
462445 })
463446
464447 t .Run ("Test createMonitoringPluginInfo with missing URL from alertmanager " , func (t * testing.T ) {
465448 // this should throw an error because alertManager.URL is not set
466- pluginInfo , error := getPluginInfo (pluginConfigThanos , features , clusterVersion , acmVersion )
449+ pluginInfo , error := getPluginInfo (pluginConfigThanos , features , clusterVersion )
467450 assert .Assert (t , pluginInfo == nil )
468451 assert .Assert (t , error != nil )
469452 })
470453
471454 /** Negative Tests - Perses **/
472455 t .Run ("Test createMonitoringPluginInfo with missing Perses enabled field " , func (t * testing.T ) {
473456 // this should throw an error because 'enabled: true' is not set
474- pluginInfo , error := getPluginInfo (pluginConfigPersesEmpty , features , clusterVersion , acmVersion )
457+ pluginInfo , error := getPluginInfo (pluginConfigPersesEmpty , features , clusterVersion )
475458 assert .Assert (t , pluginInfo == nil )
476459 assert .Assert (t , error != nil )
477460 })
478461
479462 /** Negative Tests - ALL **/
480463 t .Run ("Test createMonitoringPluginInfo with malform UIPlugin custom resource" , func (t * testing.T ) {
481464 // this should throw an error because UIPlugin doesn't include alertmanager, thanos, perses, or incidents
482- pluginInfo , error := getPluginInfo (pluginMalformed , features , clusterVersion , acmVersion )
465+ pluginInfo , error := getPluginInfo (pluginMalformed , features , clusterVersion )
483466 assert .Assert (t , pluginInfo == nil )
484467 assert .Assert (t , error != nil )
485468 })
0 commit comments