Skip to content

Commit

Permalink
Disable local plan for elemental-system-agent
Browse files Browse the repository at this point in the history
As local plan is not used, only remote.

Signed-off-by: Loic Devulder <[email protected]>
  • Loading branch information
ldevulder committed Oct 9, 2023
1 parent b359b1e commit 961b0c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/install/_testdata/system-agent-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ stages:
permissions: 384
owner: 0
group: 0
content: '{"workDirectory":"/var/lib/elemental/agent/work","localEnabled":true,"localPlanDirectory":"/var/lib/elemental/agent/plans","appliedPlanDirectory":"/var/lib/elemental/agent/applied","remoteEnabled":true,"connectionInfoFile":"/var/lib/elemental/agent/elemental_connection.json"}'
content: '{"workDirectory":"/var/lib/elemental/agent/work","localPlanDirectory":"/var/lib/elemental/agent/plans","appliedPlanDirectory":"/var/lib/elemental/agent/applied","remoteEnabled":true,"connectionInfoFile":"/var/lib/elemental/agent/elemental_connection.json"}'
encoding: ""
ownerstring: ""
2 changes: 1 addition & 1 deletion pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (i *installer) getAgentConfigBytes() ([]byte, error) {
AppliedPlanDir: filepath.Join(agentStateDir, "applied"),
LocalPlanDir: filepath.Join(agentStateDir, "plans"),
RemoteEnabled: true,
LocalEnabled: true,
LocalEnabled: false,
ConnectionInfoFile: filepath.Join(agentStateDir, "elemental_connection.json"),
PreserveWorkDir: false,
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package install

import (
"fmt"
"io/ioutil"
"os"
"testing"
"time"
Expand Down Expand Up @@ -148,7 +147,7 @@ var _ = Describe("installer reset elemental", Label("installer", "reset"), func(
checkConfigs(fs)
})
It("should remove reset plan", func() {
Expect(fs.WriteFile(controllers.LocalResetPlanPath, []byte("{}\n"), os.FileMode(600))).ToNot(HaveOccurred())
Expect(fs.WriteFile(controllers.LocalResetPlanPath, []byte("{}\n"), os.FileMode(0600))).ToNot(HaveOccurred())
cliRunner.EXPECT().Reset(gomock.Any()).Return(nil)
Expect(install.ResetElemental(configFixture, stateFixture)).ToNot(HaveOccurred())
_, err := fs.Stat(controllers.LocalResetPlanPath)
Expand Down Expand Up @@ -176,7 +175,7 @@ func checkConfigs(fs vfs.FS) {
func compareFiles(fs vfs.FS, got string, want string) {
gotFile, err := fs.ReadFile(got)
Expect(err).ToNot(HaveOccurred())
wantFile, err := ioutil.ReadFile(want)
wantFile, err := os.ReadFile(want)
Expect(err).ToNot(HaveOccurred())
Expect(string(gotFile)).To(Equal(string(wantFile)))
}

0 comments on commit 961b0c5

Please sign in to comment.