diff --git a/server/config/raw/global_cfg.go b/server/config/raw/global_cfg.go index 74b0b5da4..a2cf56e57 100644 --- a/server/config/raw/global_cfg.go +++ b/server/config/raw/global_cfg.go @@ -33,6 +33,12 @@ type TerraformAdminMode struct { Repo string `yaml:"repo" json:"repo"` Root string `yaml:"root" json:"root"` } + +type (t TerraformAdminMode) Validate() error { + return validation.ValidateStruct( + &t, + + type GithubTeam struct { Name string `yaml:"name" json:"name"` Org string `yaml:"org" json:"org"` @@ -201,6 +207,7 @@ func (g GlobalCfg) ToValid(defaultCfg valid.GlobalCfg) valid.GlobalCfg { Github: g.Github.ToValid(), Admin: g.Admin.ToValid(), RevisionSetter: g.RevisionSetter.ToValid(), + TerraformAdminMode: g.TerraformAdminMode, } } diff --git a/server/config/valid/global_cfg.go b/server/config/valid/global_cfg.go index aa0bdfd6b..7c2b45f8b 100644 --- a/server/config/valid/global_cfg.go +++ b/server/config/valid/global_cfg.go @@ -64,6 +64,12 @@ type GlobalCfg struct { Github Github RevisionSetter RevisionSetter Admin Admin + TerraformAdminMode TerraformAdminMode +} + +type TerraformAdminMode struct { + Repo string + Root string } type GithubTeam struct {