diff options
author | 2019-08-29 12:06:51 -0700 | |
---|---|---|
committer | 2019-09-06 17:22:06 +0000 | |
commit | c3ef7c3f40f6aa4a14a98301ae12bfa11b1a12c3 (patch) | |
tree | 0fc2d474c55706891f4bf0214c0a9c3c9378a00e /vnfs/DAaaS/microservices/visualization-operator/pkg/controller/utils | |
parent | b2651f39b6dbe79e05d42f8a3bfbbc11c42c5d4c (diff) |
Visualization operator - update/delete datasource
Added support in the visualization operator to update
or delete an existing grafana datasource dynamically.
Issue-ID: ONAPARC-393
Signed-off-by: Srivahni <srivahni.chivukula@intel.com>
Change-Id: I814cca8e5b4f7f5832a948449cf545cecd25b1f9
Diffstat (limited to 'vnfs/DAaaS/microservices/visualization-operator/pkg/controller/utils')
-rw-r--r-- | vnfs/DAaaS/microservices/visualization-operator/pkg/controller/utils/visualizationutils.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vnfs/DAaaS/microservices/visualization-operator/pkg/controller/utils/visualizationutils.go b/vnfs/DAaaS/microservices/visualization-operator/pkg/controller/utils/visualizationutils.go new file mode 100644 index 00000000..dc7e1f1b --- /dev/null +++ b/vnfs/DAaaS/microservices/visualization-operator/pkg/controller/utils/visualizationutils.go @@ -0,0 +1,26 @@ +package visualizationutils + +// Define the GrafanaDatasource finalizer for handling deletion +const ( + VisualizationFinalizer = "finalizer.visualization.onap.org" +) + +// Contains checks if a string is contained in a list of strings +func Contains(list []string, s string) bool { + for _, v := range list { + if v == s { + return true + } + } + return false +} + +// Remove checks and removes a string from a list of strings +func Remove(list []string, s string) []string { + for i, v := range list { + if v == s { + list = append(list[:i], list[i+1:]...) + } + } + return list +} |