Skip to content

Commit

Permalink
add in other places
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero committed Feb 13, 2024
1 parent 60d9ecf commit fe8ead2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions server/config/raw/global_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,19 @@ type TerraformAdminMode struct {
Root string `yaml:"root" json:"root"`
}

type (t TerraformAdminMode) Validate() error {
return validation.ValidateStruct(
&t,
func (t TerraformAdminMode) ToValid() valid.TerraformAdminMode {
return valid.TerraformAdminMode{
Repo: t.Repo,
Root: t.Root,
}
}

func (t TerraformAdminMode) Validate() error {
return validation.ValidateStruct(&t,
validation.Field(&t.Repo),
validation.Field(&t.Root),
)
}

type GithubTeam struct {
Name string `yaml:"name" json:"name"`
Expand Down Expand Up @@ -207,7 +216,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,
TerraformAdminMode: g.TerraformAdminMode.ToValid(),
}
}

Expand Down

0 comments on commit fe8ead2

Please sign in to comment.