mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-02 13:58:39 +00:00
* Moving config files to core/config * fix package names * fix package dependencies * linting fixes * more linting fixes * ran golangci-lint run --fix
44 lines
949 B
Go
44 lines
949 B
Go
package raw
|
|
|
|
import (
|
|
"github.com/runatlantis/atlantis/server/core/config/valid"
|
|
)
|
|
|
|
// DefaultAutoPlanWhenModified is the default element in the when_modified
|
|
// list if none is defined.
|
|
var DefaultAutoPlanWhenModified = []string{"**/*.tf*", "**/terragrunt.hcl"}
|
|
|
|
type Autoplan struct {
|
|
WhenModified []string `yaml:"when_modified,omitempty"`
|
|
Enabled *bool `yaml:"enabled,omitempty"`
|
|
}
|
|
|
|
func (a Autoplan) ToValid() valid.Autoplan {
|
|
var v valid.Autoplan
|
|
if a.WhenModified == nil {
|
|
v.WhenModified = DefaultAutoPlanWhenModified
|
|
} else {
|
|
v.WhenModified = a.WhenModified
|
|
}
|
|
|
|
if a.Enabled == nil {
|
|
v.Enabled = true
|
|
} else {
|
|
v.Enabled = *a.Enabled
|
|
}
|
|
|
|
return v
|
|
}
|
|
|
|
func (a Autoplan) Validate() error {
|
|
return nil
|
|
}
|
|
|
|
// DefaultAutoPlan returns the default autoplan config.
|
|
func DefaultAutoPlan() valid.Autoplan {
|
|
return valid.Autoplan{
|
|
WhenModified: DefaultAutoPlanWhenModified,
|
|
Enabled: valid.DefaultAutoPlanEnabled,
|
|
}
|
|
}
|