From 67b6c945e22dbc8c29411f9c34f217bb2c71ad5e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 1 Sep 2021 11:37:58 -0700 Subject: [PATCH] whitelist certain ENVs from bootstrap check --- cmd/bootstrap-peer-server.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/bootstrap-peer-server.go b/cmd/bootstrap-peer-server.go index 47fcc63d7..ab9546107 100644 --- a/cmd/bootstrap-peer-server.go +++ b/cmd/bootstrap-peer-server.go @@ -91,10 +91,21 @@ func (s1 ServerSystemConfig) Diff(s2 ServerSystemConfig) error { return nil } +var skipEnvs = map[string]struct{}{ + "MINIO_OPTS": {}, +} + func getServerSystemCfg() ServerSystemConfig { envs := env.List("MINIO_") envValues := make(map[string]string, len(envs)) for _, envK := range envs { + // skip certain environment variables as part + // of the whitelist and could be configured + // differently on each nodes, update skipEnvs() + // map if there are such environment values + if _, ok := skipEnvs[envK]; ok { + continue + } envValues[envK] = env.Get(envK, "") } return ServerSystemConfig{