@@ -8,15 +8,13 @@ import (
8
8
"github.com/nuvo/skbn/pkg/skbn"
9
9
)
10
10
11
- const cassandraDataDir = "/var/lib/cassandra/data"
12
-
13
11
// GetFromAndToPathsFromK8s aggregates paths from all pods
14
- func GetFromAndToPathsFromK8s (iClient interface {}, pods []string , namespace , container , keyspace , tag , dstBasePath string ) ([]skbn.FromToPair , error ) {
12
+ func GetFromAndToPathsFromK8s (iClient interface {}, pods []string , namespace , container , keyspace , tag , dstBasePath , cassandraDataDir string ) ([]skbn.FromToPair , error ) {
15
13
k8sClient := iClient .(* skbn.K8sClient )
16
14
var fromToPathsAllPods []skbn.FromToPair
17
15
for _ , pod := range pods {
18
16
19
- fromToPaths , err := GetFromAndToPathsK8sToDst (k8sClient , namespace , pod , container , keyspace , tag , dstBasePath )
17
+ fromToPaths , err := GetFromAndToPathsK8sToDst (k8sClient , namespace , pod , container , keyspace , tag , dstBasePath , cassandraDataDir )
20
18
if err != nil {
21
19
return nil , err
22
20
}
@@ -27,7 +25,7 @@ func GetFromAndToPathsFromK8s(iClient interface{}, pods []string, namespace, con
27
25
}
28
26
29
27
// GetFromAndToPathsSrcToK8s performs a path mapping between a source and Kubernetes
30
- func GetFromAndToPathsSrcToK8s (srcClient , k8sClient interface {}, srcPrefix , srcPath , srcBasePath , namespace , container string ) ([]skbn.FromToPair , []string , []string , error ) {
28
+ func GetFromAndToPathsSrcToK8s (srcClient , k8sClient interface {}, srcPrefix , srcPath , srcBasePath , namespace , container , cassandraDataDir string ) ([]skbn.FromToPair , []string , []string , error ) {
31
29
var fromToPaths []skbn.FromToPair
32
30
33
31
filesToCopyRelativePaths , err := skbn .GetListOfFiles (srcClient , srcPrefix , srcPath )
@@ -56,7 +54,7 @@ func GetFromAndToPathsSrcToK8s(srcClient, k8sClient interface{}, srcPrefix, srcP
56
54
}
57
55
58
56
// GetFromAndToPathsK8sToDst performs a path mapping between Kubernetes and a destination
59
- func GetFromAndToPathsK8sToDst (k8sClient interface {}, namespace , pod , container , keyspace , tag , dstBasePath string ) ([]skbn.FromToPair , error ) {
57
+ func GetFromAndToPathsK8sToDst (k8sClient interface {}, namespace , pod , container , keyspace , tag , dstBasePath , cassandraDataDir string ) ([]skbn.FromToPair , error ) {
60
58
var fromToPaths []skbn.FromToPair
61
59
62
60
pathPrfx := filepath .Join (namespace , pod , container , cassandraDataDir )
@@ -146,7 +144,7 @@ func PathFromSrcToK8s(k8sClient interface{}, fromPath, cassandraDataDir, srcBase
146
144
}
147
145
148
146
// ChangeFilesOwnership changes the ownership of files after restoring them
149
- func ChangeFilesOwnership (iK8sClient interface {}, pods []string , namespace , container , userGroup string ) error {
147
+ func ChangeFilesOwnership (iK8sClient interface {}, pods []string , namespace , container , userGroup , cassandraDataDir string ) error {
150
148
k8sClient := iK8sClient .(* skbn.K8sClient )
151
149
command := []string {"chown" , "-R" , userGroup , cassandraDataDir }
152
150
for _ , pod := range pods {
0 commit comments