@@ -8,15 +8,13 @@ import (
88 "github.com/nuvo/skbn/pkg/skbn"
99)
1010
11- const cassandraDataDir = "/var/lib/cassandra/data"
12-
1311// 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 ) {
1513 k8sClient := iClient .(* skbn.K8sClient )
1614 var fromToPathsAllPods []skbn.FromToPair
1715 for _ , pod := range pods {
1816
19- fromToPaths , err := GetFromAndToPathsK8sToDst (k8sClient , namespace , pod , container , keyspace , tag , dstBasePath )
17+ fromToPaths , err := GetFromAndToPathsK8sToDst (k8sClient , namespace , pod , container , keyspace , tag , dstBasePath , cassandraDataDir )
2018 if err != nil {
2119 return nil , err
2220 }
@@ -27,7 +25,7 @@ func GetFromAndToPathsFromK8s(iClient interface{}, pods []string, namespace, con
2725}
2826
2927// 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 ) {
3129 var fromToPaths []skbn.FromToPair
3230
3331 filesToCopyRelativePaths , err := skbn .GetListOfFiles (srcClient , srcPrefix , srcPath )
@@ -56,7 +54,7 @@ func GetFromAndToPathsSrcToK8s(srcClient, k8sClient interface{}, srcPrefix, srcP
5654}
5755
5856// 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 ) {
6058 var fromToPaths []skbn.FromToPair
6159
6260 pathPrfx := filepath .Join (namespace , pod , container , cassandraDataDir )
@@ -146,7 +144,7 @@ func PathFromSrcToK8s(k8sClient interface{}, fromPath, cassandraDataDir, srcBase
146144}
147145
148146// 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 {
150148 k8sClient := iK8sClient .(* skbn.K8sClient )
151149 command := []string {"chown" , "-R" , userGroup , cassandraDataDir }
152150 for _ , pod := range pods {
0 commit comments