feat: integration refactor (#684)

* feat: more significant refactor

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>

* feat: more significant refactor

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>

* feat: reworked the integration activate/deactivation

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>

* chore: updated schema for list integrations

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>

* fix: error with incorrect error being swallowed

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>

* feat: added namespace check

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>

* chore: fixed issue with namespace and skip install validation

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>

---------

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
Alex Jones
2023-09-28 07:43:05 +01:00
committed by GitHub
parent ddeff9fae4
commit 69fe2db8ac
9 changed files with 177 additions and 54 deletions

View File

@@ -32,6 +32,8 @@ type IIntegration interface {
AddAnalyzer(*map[string]common.IAnalyzer)
GetAnalyzerName() []string
// An integration must keep record of its deployed namespace (if not using --no-install)
GetNamespace() (string, error)
OwnsAnalyzer(string) bool
@@ -86,7 +88,6 @@ func (*Integration) Activate(name string, namespace string, activeFilters []stri
return err
}
}
mergedFilters := activeFilters
mergedFilters = append(mergedFilters, integrations[name].GetAnalyzerName()...)
uniqueFilters, _ := util.RemoveDuplicates(mergedFilters)