Skip to content

Commit ec91eef

Browse files
fix: use k8s path constants from k8s diagnostics in integration tests
1 parent 53a49c6 commit ec91eef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

testing/integration/k8s/common.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040

4141
"github.com/elastic/elastic-agent-libs/kibana"
4242
"github.com/elastic/elastic-agent-libs/testing/estools"
43+
k8sDiagnostics "github.com/elastic/elastic-agent/internal/pkg/diagnostics"
4344
aclient "github.com/elastic/elastic-agent/pkg/control/v2/client"
4445
atesting "github.com/elastic/elastic-agent/pkg/testing"
4546
"github.com/elastic/elastic-agent/pkg/testing/define"
@@ -577,15 +578,15 @@ func checkK8sDiagnosticsArchive(archivePath string, agentPodName string) error {
577578
err error
578579
}
579580

580-
podYamlPath := fmt.Sprintf("k8s/pod-%s.yaml", agentPodName)
581+
podYamlPath := filepath.Join(k8sDiagnostics.K8sSubdir, fmt.Sprintf(k8sDiagnostics.PodK8sManifestFormat, agentPodName))
581582
validators := map[string]*zipFileValidator{
582583
podYamlPath: {
583584
err: fmt.Errorf("%s is not present in diagnostics", podYamlPath),
584585
validate: func(f *zip.File, validator *zipFileValidator) {
585586
validator.err = nil
586587
},
587588
},
588-
"errors.txt": {
589+
k8sDiagnostics.K8sDiagnosticsErrorFile: {
589590
validate: func(f *zip.File, validator *zipFileValidator) {
590591
validatorErr := errors.New("errors.txt file should not be present")
591592
reader, err := f.Open()

0 commit comments

Comments
 (0)