Rewrite: rewrites env config repo and commits application cue files
We can build upon this tool to implement version to version migration logic.
Change-Id: I6066f565f118ca44ca3ce7a0ac7522258958cf25
diff --git a/core/installer/tasks/activate.go b/core/installer/tasks/activate.go
index dffdfbe..ccbdbb8 100644
--- a/core/installer/tasks/activate.go
+++ b/core/installer/tasks/activate.go
@@ -31,7 +31,7 @@
return err
}
repoHost := strings.Split(st.ssClient.Addr, ":")[0]
- return st.repo.Atomic(func(r installer.RepoFS) (string, error) {
+ return st.repo.Do(func(r installer.RepoFS) (string, error) {
kust, err := installer.ReadKustomization(r, "environments/kustomization.yaml")
if err != nil {
return "", err
diff --git a/core/installer/tasks/dns.go b/core/installer/tasks/dns.go
index 65ef787..27e044d 100644
--- a/core/installer/tasks/dns.go
+++ b/core/installer/tasks/dns.go
@@ -50,7 +50,7 @@
if err != nil {
return err
}
- return r.Atomic(func(r installer.RepoFS) (string, error) {
+ return r.Do(func(r installer.RepoFS) (string, error) {
{
out, err := r.Writer("dns-zone.yaml")
if err != nil {
diff --git a/core/installer/tasks/infra.go b/core/installer/tasks/infra.go
index fb3047d..543cc67 100644
--- a/core/installer/tasks/infra.go
+++ b/core/installer/tasks/infra.go
@@ -23,7 +23,7 @@
if err != nil {
return err
}
- appManager, err := installer.NewAppManager(r, st.nsCreator)
+ appManager, err := installer.NewAppManager(r, st.nsCreator, "/apps")
if err != nil {
return err
}
@@ -61,7 +61,7 @@
if err != nil {
return err
}
- r.Atomic(func(r installer.RepoFS) (string, error) {
+ r.Do(func(r installer.RepoFS) (string, error) {
{
// TODO(giolekva): private domain can be configurable as well
config := installer.AppEnvConfig{
@@ -127,7 +127,7 @@
if err != nil {
return err
}
- return r.Atomic(func(r installer.RepoFS) (string, error) {
+ return r.Do(func(r installer.RepoFS) (string, error) {
fa := firstAccount{false, initGroups}
if err := installer.WriteYaml(r, "first-account.yaml", fa); err != nil {
return "", err
diff --git a/core/installer/tasks/init.go b/core/installer/tasks/init.go
index 70b7939..4e676cd 100644
--- a/core/installer/tasks/init.go
+++ b/core/installer/tasks/init.go
@@ -104,7 +104,7 @@
if err != nil {
return err
}
- if err := repoIO.Atomic(func(r installer.RepoFS) (string, error) {
+ if err := repoIO.Do(func(r installer.RepoFS) (string, error) {
w, err := r.Writer("README.md")
if err != nil {
return "", err