Skip to content

Commit 73fd414

Browse files
BupycHukJiriCtvrtkaademidoff
authored
PMM-7 use image from ENV for standalone encrypted (#695)
* PMM-7 use image from ENV for standalone encrypted * chore: update the default version of mongodb * PMM-7 fix test. --------- Co-authored-by: Jiří Čtvrtka <[email protected]> Co-authored-by: Alex Demidoff <[email protected]>
1 parent 6ed58cd commit 73fd414

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ services:
278278
standalone-encrypted:
279279
user: root
280280
container_name: "standalone-encrypted"
281-
image: percona/percona-server-mongodb:5.0.13-11
281+
image: ${TEST_MONGODB_IMAGE:-mongo:4.4}
282282
ports:
283283
- "${TEST_MONGODB_STANDALONE_ENCRYPTED_PORT:-27027}:27017"
284284
volumes:

exporter/encryption_info_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package exporter
1717

1818
import (
1919
"context"
20+
"fmt"
2021
"io"
2122
"strings"
2223
"testing"
@@ -32,6 +33,10 @@ import (
3233

3334
func TestGetEncryptionInfo(t *testing.T) {
3435
t.Parallel()
36+
version, vendor := getMongoDBVersionInfo(t, "standalone-encrypted")
37+
if vendor != "Percona" {
38+
t.Skip("Test is only for Percona MongoDB as upstream MongoDB does not support encryption")
39+
}
3540

3641
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
3742
defer cancel()
@@ -52,13 +57,13 @@ func TestGetEncryptionInfo(t *testing.T) {
5257
c := newDiagnosticDataCollector(ctx, client, logger, true, ti, dbBuildInfo)
5358

5459
// The last \n at the end of this string is important
55-
expected := strings.NewReader(`
60+
expected := strings.NewReader(fmt.Sprintf(`
5661
# HELP mongodb_security_encryption_enabled Shows that encryption is enabled
5762
# TYPE mongodb_security_encryption_enabled gauge
5863
mongodb_security_encryption_enabled{type="localKeyFile"} 1
5964
# HELP mongodb_version_info The server version
6065
# TYPE mongodb_version_info gauge
61-
mongodb_version_info{edition="Community",mongodb="5.0.13-11",vendor="Percona"} 1` + "\n")
66+
mongodb_version_info{edition="Community",mongodb="%s",vendor="%s"} 1`, version, vendor) + "\n")
6267

6368
filter := []string{
6469
"mongodb_security_encryption_enabled",

0 commit comments

Comments
 (0)