Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

PMM-8082 add srv initialization #1148

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions utils/envvars/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ func ParseEnvVars(envs []string) (envSettings *models.ChangeSettingsParams, errs
case "PERCONA_TEST_PMM_CLICKHOUSE_DATABASE", "PERCONA_TEST_PMM_CLICKHOUSE_ADDR", "PERCONA_TEST_PMM_CLICKHOUSE_BLOCK_SIZE", "PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE":
// skip env variables for external clickhouse
continue
case "PMM_ADMIN_PASSWORD":
// skip admin password change, so far handled by entrypoint.sh
continue
case "DISABLE_UPDATES":
envSettings.DisableUpdates, err = strconv.ParseBool(v)
if err != nil {
Expand Down
15 changes: 15 additions & 0 deletions utils/envvars/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ func TestEnvVarValidator(t *testing.T) {
assert.Nil(t, gotWarns)
})

t.Run("PMM internal env vars", func(t *testing.T) {
t.Parallel()

envs := []string{
"PMM_DEBUG=0",
"PMM_ADMIN_PASSWORD=admin",
}
expectedEnvVars := &models.ChangeSettingsParams{}

gotEnvVars, gotErrs, gotWarns := ParseEnvVars(envs)
assert.Equal(t, gotEnvVars, expectedEnvVars)
assert.Nil(t, gotErrs)
assert.Nil(t, gotWarns)
})

t.Run("Invalid env variables values", func(t *testing.T) {
t.Parallel()

Expand Down