cluster_filter.go | |
---|---|
|
|
Generated documentation is available at: https://pkg.go.dev/github.com/RedHatInsights/ccx-notification-service/differ Documentation in literate-programming-style is available at: https://redhatinsights.github.io/ccx-notification-service/packages/differ/cluster_filter.html |
|
ClusterFilterStatistic is a structure containing elementary statistic about clusters being filtered by filterClusterList function. It can be used for logging and debugging purposes. |
|
filterClusterList function filters clusters according to given allow list and block list |
|
initialize structure with statistic |
|
optimization phase - don't process/filter clusters if filtering is completely disabled (this includes both allowed clusters filter and blocked clusters filter) |
|
just update the statistic |
|
and return original cluster list |
|
list of filtered clusters |
|
update statistic |
|
cluster might be explicitly allowed if "filter allowed clusters" command line option is enabled |
|
if cluster is in list of allowed clusters -> put it into the output list -> skip rest of the loop |
|
don't do anything else with the cluster |
|
cluster might be blocked if "filter blocked clusters" configuration option is enabled |
|
if cluster is in list of blocked clusters -> ignore it -> skip rest of the loop |
|
don't do anything else with the cluster |
|
not blocked -> put it into the output list |
|
return filtered list of clusters |
|