Skip to content

Commit eb5a700

Browse files
authored
Fix ruxitagentproc.conf placement + content (#75)
1 parent 9f77d9e commit eb5a700

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

pkg/configure/oneagent/pmc/pmc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const (
1313
InputFileName = "ruxitagentproc.json"
1414

1515
SourceRuxitAgentProcPath = "agent/conf/ruxitagentproc.conf"
16-
DestinationRuxitAgentProcPath = "oneagent/config/ruxitagentproc.conf"
16+
DestinationRuxitAgentProcPath = "oneagent/agent/config/ruxitagentproc.conf"
1717
)
1818

1919
func GetSourceRuxitAgentProcFilePath(targetDir string) string {

pkg/configure/oneagent/pmc/ruxit/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ func (pm ProcMap) SetupReadonly(installPath string) ProcMap {
9090
volume := filepath.VolumeName(value)
9191
fmt.Printf("%s", volume)
9292

93-
if strings.HasPrefix(value, "\"../") {
93+
if strings.HasPrefix(entry, "libraryPath") {
9494
sanitizedEntry := strings.ReplaceAll(value, "../", "")
9595
sanitizedEntry, found := strings.CutPrefix(sanitizedEntry, "\"")
9696

9797
if found {
98-
pm[section][entry] = "\"" + filepath.Join(installPath, sanitizedEntry)
98+
pm[section][entry] = "\"" + filepath.Join(installPath, "agent", sanitizedEntry)
9999
} else {
100-
pm[section][entry] = filepath.Join(installPath, sanitizedEntry)
100+
pm[section][entry] = filepath.Join(installPath, "agent", sanitizedEntry)
101101
}
102102
}
103103
}

pkg/configure/oneagent/pmc/ruxit/types_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,13 @@ func TestSetupReadonly(t *testing.T) {
204204
{
205205
// overwritten to be absolute path
206206
Section: "test",
207-
Key: "keyWithPath",
208-
Value: "\"/absolute/path/relative/path\"",
207+
Key: "libraryPath123",
208+
Value: "\"/absolute/path/agent/relative/path\"",
209+
},
210+
{
211+
Section: "general",
212+
Key: "libraryPathMusl64",
213+
Value: "\"/absolute/path/agent/bin/1.2.3.4-5/linux-musl-x86-64\"",
209214
},
210215
{
211216
// added from override
@@ -229,8 +234,13 @@ func TestSetupReadonly(t *testing.T) {
229234
},
230235
{
231236
Section: "test",
232-
Key: "keyWithPath",
233-
Value: "\"../../relative/path\"",
237+
Key: "libraryPath123",
238+
Value: "\"../relative/path\"",
239+
},
240+
{
241+
Section: "general",
242+
Key: "libraryPathMusl64",
243+
Value: "\"../bin/1.2.3.4-5/linux-musl-x86-64\"",
234244
},
235245
{
236246
// will be removed, as it is not needed in readonly

0 commit comments

Comments
 (0)