mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-03 23:18:49 +00:00
Problem When `projects` are specified and `when_modified` is not specified via the config file, changing `.terraform.lock.hcl` file won't trigger auto plan. This is because the default `raw.WhenModified` does not include `.terraform.lock.hcl`. Note that when projects are auto detected, changing `.terraform.lock.hcl` triggers auto plan. This is because the `cmd.DefaultAutoplanFileList` includes `.terraform.lock.hcl`. Solution Include `.terraform.lock.hcl` to the default `raw.WhenModified`.
48 lines
981 B
Go
48 lines
981 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",
|
|
"**/.terraform.lock.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,
|
|
}
|
|
}
|