Skip to content

Commit 65a074f

Browse files
CSPL-1598: Delete apps from app directory while app installation is in progress (#800)
* CSPL-1598: Delete apps from init-apps while app installation is in progress * modify delete logic * Modified GetoperatorPodName to take into consideration clusterwide install
1 parent c49085f commit 65a074f

File tree

7 files changed

+291
-16
lines changed

7 files changed

+291
-16
lines changed

.github/workflows/int-test-workflow.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
branches:
55
- develop
66
- master
7-
- cspl-1740
87
jobs:
98
int-tests:
109
strategy:

test/c3/appframework/appframework_test.go

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
. "github.com/onsi/gomega"
2626

2727
enterpriseApi "github.com/splunk/splunk-operator/api/v3"
28+
splcommon "github.com/splunk/splunk-operator/pkg/splunk/common"
2829
testenv "github.com/splunk/splunk-operator/test/testenv"
2930
corev1 "k8s.io/api/core/v1"
3031
)
@@ -2885,4 +2886,101 @@ var _ = Describe("c3appfw test", func() {
28852886
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
28862887
})
28872888
})
2889+
2890+
Context("Single Site Indexer Cluster with Search Head Cluster (C3) and App Framework", func() {
2891+
It("integration, c3, appframeworkc3, appframework: can deploy a C3 SVA with App Framework enabled and delete apps from app directory when download is complete", func() {
2892+
2893+
/* Test Steps
2894+
################## SETUP ####################
2895+
* Upload big-size app to S3 for Indexer Cluster and Search Head Cluster
2896+
* Create app sources for Cluster Manager and Deployer
2897+
* Prepare and deploy C3 CRD with app framework and wait for the pods to be ready
2898+
* When app download is complete, delete apps from app directory
2899+
######### VERIFICATIONS #############
2900+
* Verify Apps are Downloaded in App Deployment Info
2901+
* Verify Apps Copied in App Deployment Info
2902+
* Verify App Package is deleted from Operator Pod
2903+
* Verify Apps Installed in App Deployment Info
2904+
* Verify App Package is deleted from Splunk Pod
2905+
* Verify bundle push is successful
2906+
* Verify V1 apps are copied, installed on Monitoring Console and on Search Heads and Indexers pods
2907+
*/
2908+
2909+
//################## SETUP ####################
2910+
// Download big size apps from S3
2911+
appList := testenv.BigSingleApp
2912+
appFileList := testenv.GetAppFileList(appList)
2913+
err := testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
2914+
Expect(err).To(Succeed(), "Unable to download big-size app")
2915+
2916+
// Upload big size app to S3 for Indexer Cluster
2917+
appVersion := "V1"
2918+
testcaseEnvInst.Log.Info("Upload big size app to S3 for Indexer Cluster")
2919+
s3TestDirIdxc = "c3appfw-idxc-" + testenv.RandomDNSName(4)
2920+
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
2921+
Expect(err).To(Succeed(), "Unable to upload big size to S3 test directory for Indexer Cluster")
2922+
uploadedApps = append(uploadedApps, uploadedFiles...)
2923+
2924+
// Upload big size app to S3 for Search Head Cluster
2925+
testcaseEnvInst.Log.Info("Upload big size app to S3 for Search Head Cluster")
2926+
s3TestDirShc = "c3appfw-shc-" + testenv.RandomDNSName(4)
2927+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
2928+
Expect(err).To(Succeed(), "Unable to upload big size to S3 test directory for Search Head Cluster")
2929+
uploadedApps = append(uploadedApps, uploadedFiles...)
2930+
2931+
// Create App framework Spec for C3
2932+
appSourceNameIdxc = "appframework-idxc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2933+
appSourceNameShc = "appframework-shc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2934+
appSourceVolumeNameIdxc := "appframework-test-volume-idxc-" + testenv.RandomDNSName(3)
2935+
appSourceVolumeNameShc := "appframework-test-volume-shc-" + testenv.RandomDNSName(3)
2936+
appFrameworkSpecIdxc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameIdxc, enterpriseApi.ScopeCluster, appSourceNameIdxc, s3TestDirIdxc, 60)
2937+
appFrameworkSpecShc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, s3TestDirShc, 60)
2938+
2939+
// Deploy C3 CRD
2940+
testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster with Search Head Cluster")
2941+
indexerReplicas := 3
2942+
shReplicas := 3
2943+
cm, _, shc, err := deployment.DeploySingleSiteClusterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "")
2944+
Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with Search Head Cluster")
2945+
2946+
// Verify App Download is completed on Cluster Manager
2947+
testenv.VerifyAppState(ctx, deployment, testcaseEnvInst, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList, enterpriseApi.AppPkgPodCopyComplete, enterpriseApi.AppPkgPodCopyPending)
2948+
2949+
//Delete apps from app directory when app download is complete
2950+
opPod := testenv.GetOperatorPodName(testcaseEnvInst)
2951+
podDownloadPath := filepath.Join(splcommon.AppDownloadVolume, "downloadedApps", testenvInstance.GetName(), cm.Kind, deployment.GetName(), enterpriseApi.ScopeCluster, appSourceNameIdxc, testenv.AppInfo[appList[0]]["filename"])
2952+
err = testenv.DeleteFilesOnOperatorPod(ctx, deployment, opPod, []string{podDownloadPath})
2953+
Expect(err).To(Succeed(), "Unable to delete file on pod")
2954+
2955+
// Ensure Cluster Manager goes to Ready phase
2956+
testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst)
2957+
2958+
// Ensure Indexers go to Ready phase
2959+
testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst)
2960+
2961+
// Ensure Search Head Cluster go to Ready phase
2962+
testenv.SearchHeadClusterReady(ctx, deployment, testcaseEnvInst)
2963+
2964+
// Verify RF SF is met
2965+
testenv.VerifyRFSFMet(ctx, deployment, testcaseEnvInst)
2966+
2967+
// Get Pod age to check for pod resets later
2968+
splunkPodAge := testenv.GetPodsStartTime(testcaseEnvInst.GetName())
2969+
2970+
//######### VERIFICATIONS #############
2971+
var idxcPodNames, shcPodNames []string
2972+
idxcPodNames = testenv.GeneratePodNameSlice(testenv.IndexerPod, deployment.GetName(), indexerReplicas, false, 1)
2973+
shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), indexerReplicas, false, 1)
2974+
cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())}
2975+
deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())}
2976+
cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: indexerReplicas, CrClusterPods: idxcPodNames}
2977+
shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames}
2978+
allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo}
2979+
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
2980+
2981+
// Verify no pods reset by checking the pod age
2982+
testenv.VerifyNoPodReset(ctx, deployment, testcaseEnvInst, testcaseEnvInst.GetName(), splunkPodAge, nil)
2983+
2984+
})
2985+
})
28882986
})

test/m4/appframework/appframework_test.go

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
. "github.com/onsi/ginkgo"
2525
. "github.com/onsi/gomega"
2626

27-
testenv "github.com/splunk/splunk-operator/test/testenv"
28-
2927
enterpriseApi "github.com/splunk/splunk-operator/api/v3"
28+
splcommon "github.com/splunk/splunk-operator/pkg/splunk/common"
29+
testenv "github.com/splunk/splunk-operator/test/testenv"
3030
corev1 "k8s.io/api/core/v1"
3131
)
3232

@@ -2453,4 +2453,99 @@ var _ = Describe("m4appfw test", func() {
24532453
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
24542454
})
24552455
})
2456+
2457+
Context("Multisite Indexer Cluster with Search Head Cluster (m4) with App Framework", func() {
2458+
It("integration, m4, appframeworkm4, appframework: can deploy a M4 SVA with App Framework enabled and delete apps from app directory when download is complete", func() {
2459+
2460+
/* Test Steps
2461+
################## SETUP ##################
2462+
* Upload big-size app to S3 for Indexer Cluster and Search Head Cluster
2463+
* Prepare and deploy M4 CRD with app framework and wait for the pods to be ready
2464+
* When app download is complete, delete apps from app directory
2465+
########## VERIFICATIONS ##########
2466+
* Verify Apps Downloaded in App Deployment Info
2467+
* Verify Apps Copied in App Deployment Info
2468+
* Verify App Package is deleted from Operator Pod
2469+
* Verify Apps Installed in App Deployment Info
2470+
* Verify App Package is deleted from Splunk Pod
2471+
* Verify bundle push is successful
2472+
* Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods
2473+
*/
2474+
2475+
//################## SETUP ##################
2476+
// Download big size apps from S3
2477+
appList := testenv.BigSingleApp
2478+
appFileList := testenv.GetAppFileList(appList)
2479+
err := testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
2480+
Expect(err).To(Succeed(), "Unable to download big-size app")
2481+
2482+
// Upload big size app to S3 for Indexer Cluster
2483+
appVersion := "V1"
2484+
testcaseEnvInst.Log.Info("Upload big size app to S3 for Indexer Cluster")
2485+
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
2486+
Expect(err).To(Succeed(), "Unable to upload big size to S3 test directory for Indexer Cluster")
2487+
uploadedApps = append(uploadedApps, uploadedFiles...)
2488+
2489+
// Upload big size app to S3 for Search Head Cluster
2490+
testcaseEnvInst.Log.Info("Upload big size app to S3 for Search Head Cluster")
2491+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
2492+
Expect(err).To(Succeed(), "Unable to upload big size to S3 test directory for Search Head Cluster")
2493+
uploadedApps = append(uploadedApps, uploadedFiles...)
2494+
2495+
// Create App framework Spec for M4
2496+
appSourceNameIdxc = "appframework-idxc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2497+
appSourceNameShc = "appframework-shc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2498+
appFrameworkSpecIdxc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameIdxc, enterpriseApi.ScopeCluster, appSourceNameIdxc, s3TestDirIdxc, 60)
2499+
appFrameworkSpecShc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, s3TestDirShc, 60)
2500+
2501+
// Deploy M4 CRD
2502+
testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster")
2503+
siteCount := 3
2504+
shReplicas := 3
2505+
indexersPerSite := 1
2506+
cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "")
2507+
Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App framework")
2508+
2509+
// Verify App Download is completed on Cluster Manager
2510+
testenv.VerifyAppState(ctx, deployment, testcaseEnvInst, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList, enterpriseApi.AppPkgPodCopyComplete, enterpriseApi.AppPkgPodCopyPending)
2511+
2512+
//Delete apps from app directory when app download is complete
2513+
opPod := testenv.GetOperatorPodName(testcaseEnvInst)
2514+
podDownloadPath := filepath.Join(splcommon.AppDownloadVolume, "downloadedApps", testenvInstance.GetName(), cm.Kind, deployment.GetName(), enterpriseApi.ScopeCluster, appSourceNameIdxc, testenv.AppInfo[appList[0]]["filename"])
2515+
err = testenv.DeleteFilesOnOperatorPod(ctx, deployment, opPod, []string{podDownloadPath})
2516+
Expect(err).To(Succeed(), "Unable to delete file on pod")
2517+
2518+
// Ensure that the Cluster Manager goes to Ready phase
2519+
testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst)
2520+
2521+
// Ensure the Indexers of all sites go to Ready phase
2522+
testenv.IndexersReady(ctx, deployment, testcaseEnvInst, siteCount)
2523+
2524+
// Ensure Indexer Cluster configured as Multisite
2525+
testenv.IndexerClusterMultisiteStatus(ctx, deployment, testcaseEnvInst, siteCount)
2526+
2527+
// Ensure Search Head Cluster go to Ready phase
2528+
testenv.SearchHeadClusterReady(ctx, deployment, testcaseEnvInst)
2529+
2530+
// Verify RF SF is met
2531+
testenv.VerifyRFSFMet(ctx, deployment, testcaseEnvInst)
2532+
2533+
// Get Pod age to check for pod resets later
2534+
splunkPodAge := testenv.GetPodsStartTime(testcaseEnvInst.GetName())
2535+
2536+
//########## VERIFICATIONS ##########
2537+
var idxcPodNames, shcPodNames []string
2538+
idxcPodNames = testenv.GeneratePodNameSlice(testenv.MultiSiteIndexerPod, deployment.GetName(), 1, true, siteCount)
2539+
shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1)
2540+
cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())}
2541+
deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())}
2542+
cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames}
2543+
shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames}
2544+
allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo}
2545+
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
2546+
2547+
// Verify no pods reset by checking the pod age
2548+
testenv.VerifyNoPodReset(ctx, deployment, testcaseEnvInst, testcaseEnvInst.GetName(), splunkPodAge, nil)
2549+
})
2550+
})
24562551
})

test/s1/appframework/appframework_test.go

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import (
2323
. "github.com/onsi/ginkgo"
2424
. "github.com/onsi/gomega"
2525

26-
testenv "github.com/splunk/splunk-operator/test/testenv"
27-
2826
enterpriseApi "github.com/splunk/splunk-operator/api/v3"
27+
splcommon "github.com/splunk/splunk-operator/pkg/splunk/common"
28+
testenv "github.com/splunk/splunk-operator/test/testenv"
2929
corev1 "k8s.io/api/core/v1"
3030
)
3131

@@ -1779,4 +1779,75 @@ var _ = Describe("s1appfw test", func() {
17791779
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
17801780
})
17811781
})
1782+
1783+
Context("Standalone deployment (S1) with App Framework", func() {
1784+
It("integration, s1, appframeworks1, appframework: Deploy a Standalone instance with App Framework enabled and delete apps from app directory when app download is complete", func() {
1785+
1786+
/* Test Steps
1787+
################## SETUP ####################
1788+
* Upload big-size app to S3 for Standalone
1789+
* Create app source for Standalone
1790+
* Prepare and deploy Standalone
1791+
* When app download is complete, delete apps from app directory
1792+
############## VERIFICATIONS ################
1793+
* Verify App installation is in progress on Standalone
1794+
* Upload more apps from S3 during bigger app install
1795+
* Wait for polling interval to pass
1796+
* Verify all apps are installed on Standalone
1797+
*/
1798+
1799+
// ################## SETUP FOR STANDALONE ####################
1800+
// Download big size apps from S3
1801+
appVersion := "V1"
1802+
appList := testenv.BigSingleApp
1803+
appFileList := testenv.GetAppFileList(appList)
1804+
err := testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
1805+
Expect(err).To(Succeed(), "Unable to download big app")
1806+
1807+
// Upload big-size app to S3 for Standalone
1808+
testcaseEnvInst.Log.Info("Upload big-size app to S3 for Standalone")
1809+
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDir, appFileList, downloadDirV1)
1810+
Expect(err).To(Succeed(), "Unable to upload big-size app to S3 test directory for Standalone")
1811+
uploadedApps = append(uploadedApps, uploadedFiles...)
1812+
1813+
// Create App framework spec for Standalone
1814+
appSourceName = "appframework-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3)
1815+
appFrameworkSpec := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeName, enterpriseApi.ScopeLocal, appSourceName, s3TestDir, 60)
1816+
spec := enterpriseApi.StandaloneSpec{
1817+
CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{
1818+
Spec: enterpriseApi.Spec{
1819+
ImagePullPolicy: "Always",
1820+
},
1821+
Volumes: []corev1.Volume{},
1822+
},
1823+
AppFrameworkConfig: appFrameworkSpec,
1824+
}
1825+
1826+
// Deploy Standalone
1827+
testcaseEnvInst.Log.Info("Deploy Standalone")
1828+
standalone, err := deployment.DeployStandaloneWithGivenSpec(ctx, deployment.GetName(), spec)
1829+
Expect(err).To(Succeed(), "Unable to deploy Standalone instance with App framework")
1830+
1831+
// Verify App Download is completed on Standalone
1832+
testenv.VerifyAppState(ctx, deployment, testcaseEnvInst, deployment.GetName(), standalone.Kind, appSourceName, appFileList, enterpriseApi.AppPkgPodCopyComplete, enterpriseApi.AppPkgPodCopyPending)
1833+
1834+
//Delete apps from app-directory when app download is complete
1835+
opPod := testenv.GetOperatorPodName(testcaseEnvInst)
1836+
podDownloadPath := filepath.Join(splcommon.AppDownloadVolume, "downloadedApps", testenvInstance.GetName(), standalone.Kind, deployment.GetName(), enterpriseApi.ScopeLocal, appSourceName, testenv.AppInfo[appList[0]]["filename"])
1837+
err = testenv.DeleteFilesOnOperatorPod(ctx, deployment, opPod, []string{podDownloadPath})
1838+
Expect(err).To(Succeed(), "Unable to delete file on pod")
1839+
1840+
// Wait for Standalone to be in READY status
1841+
testenv.StandaloneReady(ctx, deployment, deployment.GetName(), standalone, testcaseEnvInst)
1842+
1843+
// Get Pod age to check for pod resets later
1844+
splunkPodAge := testenv.GetPodsStartTime(testcaseEnvInst.GetName())
1845+
1846+
// ############ VERIFICATION ###########
1847+
standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)}
1848+
standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appList, CrAppFileList: appFileList}
1849+
allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo}
1850+
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
1851+
})
1852+
})
17821853
})

test/testenv/appframework_utils.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,7 @@ func AppFrameWorkVerifications(ctx context.Context, deployment *Deployment, test
385385
}
386386

387387
// Verify apps packages are deleted from the operator pod for all CRs
388-
var opPod string
389-
if testenvInstance.clusterWideOperator != "true" {
390-
opPod = GetOperatorPodName(testenvInstance.GetName())
391-
} else {
392-
opPod = GetOperatorPodName("splunk-operator")
393-
}
388+
opPod := GetOperatorPodName(testenvInstance)
394389
for _, appSource := range appSource {
395390
testenvInstance.Log.Info(fmt.Sprintf("Verify apps %s packages are deleted from the operator pod for CR %v with name %v", appSource.CrAppVersion, appSource.CrKind, appSource.CrName))
396391
opPath := filepath.Join(splcommon.AppDownloadVolume, "downloadedApps", testenvInstance.GetName(), appSource.CrKind, deployment.GetName(), appSource.CrAppScope, appSource.CrAppSourceName)

test/testenv/deployment.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ func (d *Deployment) Teardown() error {
111111

112112
var err error
113113
var output []byte
114-
var podName string
114+
podName := GetOperatorPodName(d.testenv)
115115
if d.testenv.clusterWideOperator != "true" {
116-
podName = GetOperatorPodName(d.testenv.GetName())
117116
output, err = exec.Command("kubectl", "logs", "-n", d.testenv.GetName(), podName).Output()
118117
} else {
119-
podName = GetOperatorPodName("splunk-operator")
120118
output, err = exec.Command("kubectl", "logs", "-n", "splunk-operator", podName, "manager").Output()
121119
}
122120
if err != nil {

0 commit comments

Comments
 (0)