Skip to content

Commit

Permalink
add to the global cfg (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero authored Feb 14, 2024
1 parent 89ea322 commit 4283ab0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions server/config/raw/global_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ type GlobalCfg struct {
Persistence Persistence `yaml:"persistence" json:"persistence"`
RevisionSetter RevisionSetter `yaml:"revision_setter" json:"revision_setter"`
Admin Admin `yaml:"admin" json:"admin"`
TerraformAdminMode TerraformAdminMode `yaml:"terraform_admin_mode" json:"terraform_admin_mode"`
}

type TerraformAdminMode struct {
Repo string `yaml:"repo" json:"repo"`
Root string `yaml:"root" json:"root"`
}

func (t TerraformAdminMode) ToValid() valid.TerraformAdminMode {
return valid.TerraformAdminMode{
Repo: t.Repo,
Root: t.Root,
}
}

func (t TerraformAdminMode) Validate() error {
// We don't need to validate the inputs so we can just return nil
return nil
}

type GithubTeam struct {
Expand Down Expand Up @@ -196,6 +214,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.ToValid(),
}
}

Expand Down
6 changes: 6 additions & 0 deletions server/config/valid/global_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4283ab0

Please sign in to comment.