From 449c014357e6d9d9178dcb5859d7a17a58d536b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Socho=C5=84?= Date: Tue, 28 Sep 2021 23:49:16 +0200 Subject: [PATCH] Add support to set backups with tag, which overwrites existing Notice, this will overwrite existing tag if it exists, use with caution --- pkg/cain/nodetool.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cain/nodetool.go b/pkg/cain/nodetool.go index 69950f9..00d9f08 100644 --- a/pkg/cain/nodetool.go +++ b/pkg/cain/nodetool.go @@ -13,10 +13,14 @@ import ( // TakeSnapshots takes a snapshot using nodetool in all pods in parallel func TakeSnapshots(iClient interface{}, pods []string, namespace, container, keyspace string, username string, password string, tag string) string { k8sClient := iClient.(*skbn.K8sClient) + + // get current time as tag realtag := utils.GetTimeStamp() - if len(tag) == 0 { + // set custom tag if provided + if len(tag) != 0 { realtag = tag } + bwgSize := len(pods) bwg := utils.NewBoundedWaitGroup(bwgSize) for _, pod := range pods {