Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conflict ¶
type Conflict struct {
Context string
KeyPath string
SourceValue any
SourceFile string
ValuesValue any
ValuesFile string
}
Conflict is a key that holds different values in a v1alpha1 source and in values.yaml.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator reads and writes the files of a project through its shims.
func NewMigrator ¶
NewMigrator creates a Migrator. A nil argument selects the real file system.
func (*Migrator) Apply ¶
Apply writes the files of a plan and deletes the context windsor.yaml files. It writes the root file last, so that a failure leaves a project that migrate can read again. A plan with conflicts writes nothing and returns an error.
func (*Migrator) LegacyFiles ¶
LegacyFiles lists the v1alpha1 files of a project. They are the root windsor.yaml when its version is v1alpha1 or missing, and each contexts/<name>/windsor.yaml or windsor.yml. It returns nil when the project holds none.
func (*Migrator) Plan ¶
Plan reads the v1alpha1 sources of the project and compares them with each values.yaml. For each context it merges the root contexts.<name> map and then contexts/<name>/windsor.yaml. It maps provider to platform, and copies a root terraform.driver into every context. A key that only the sources hold is added to values.yaml. A key with a different value is a conflict. A root key other than version, environment, paths, contexts, and terraform.driver fails the plan.