Skip to content

Commit dbc3cb4

Browse files
plural up generate fixes (#666)
We were probably being too delicate and should just overwrite these files each run of plural up
1 parent 68af4bd commit dbc3cb4

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

pkg/up/generate.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,13 @@ func (ctx *Context) Generate(gitRef string) (dir string, err error) {
6565
}
6666

6767
copies := []templatePair{
68-
{from: ctx.path("terraform/modules/clusters"), to: "terraform/modules/clusters"},
69-
{from: ctx.path(fmt.Sprintf("terraform/clouds/%s", prov)), to: "terraform/mgmt/cluster"},
70-
{from: ctx.path("setup"), to: "bootstrap"},
68+
{from: ctx.path("terraform/modules/clusters"), to: "terraform/modules/clusters", overwrite: true},
69+
{from: ctx.path(fmt.Sprintf("terraform/clouds/%s", prov)), to: "terraform/mgmt/cluster", overwrite: true},
70+
{from: ctx.path("setup"), to: "bootstrap", overwrite: true},
7171
{from: ctx.path(fmt.Sprintf("terraform/core-infra/%s", prov)), to: "terraform/core-infra"},
72-
{from: ctx.path("templates"), to: "templates"},
73-
{from: ctx.path("resources"), to: "resources"},
74-
{from: ctx.path("services"), to: "services"},
75-
{from: ctx.path("helm"), to: "helm"},
72+
{from: ctx.path("templates"), to: "templates", overwrite: true},
73+
{from: ctx.path("services"), to: "services", overwrite: true},
74+
{from: ctx.path("helm"), to: "helm", overwrite: true},
7675
}
7776

7877
if ctx.Cloud {
@@ -103,7 +102,7 @@ func (ctx *Context) Generate(gitRef string) (dir string, err error) {
103102

104103
for _, tpl := range postTemplates {
105104
if err = ctx.templateFrom(tpl.from, tpl.to); err != nil {
106-
err = fmt.Errorf("failed to template %s: %w", tpl.from, err)
105+
err = fmt.Errorf("failed to template %s: %w (you might need to regenerate your repo from scratch if partially applied)", tpl.from, err)
107106
return
108107
}
109108
}
@@ -127,8 +126,6 @@ func (ctx *Context) Generate(gitRef string) (dir string, err error) {
127126

128127
ctx.changeDelims()
129128
overwrites := []templatePair{
130-
{from: "resources/monitoring/services", to: "resources/monitoring/services"},
131-
{from: "resources/policy/services", to: "resources/policy/services"},
132129
{from: "bootstrap", to: "bootstrap"},
133130
}
134131

0 commit comments

Comments
 (0)