This repository was archived by the owner on Jan 2, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ type PlacementResponse struct {
1616}
1717
1818func (r PlacementResponse ) GetScore () float64 {
19- cpuUtilization := float64 (r .AllocatedAfter .MemoryMB ) / float64 (r .Allocatable .MemoryMB )
19+ cpuUtilization := float64 (r .AllocatedAfter .CpusMHz ) / float64 (r .Allocatable .CpusMHz )
2020 memoryUtilization := float64 (r .AllocatedAfter .MemoryMB ) / float64 (r .Allocatable .MemoryMB )
2121
22- idealRatio := float64 (r .Allocatable .MemoryMB ) / float64 (r .Allocatable .MemoryMB )
23- currentRatio := float64 (r .AllocatedAfter .MemoryMB ) / float64 (r .AllocatedAfter .MemoryMB )
22+ idealRatio := float64 (r .Allocatable .MemoryMB ) / float64 (r .Allocatable .CpusMHz )
23+ currentRatio := float64 (r .AllocatedAfter .MemoryMB ) / float64 (r .AllocatedAfter .CpusMHz )
2424
2525 ratioScore := 1 - (idealRatio - currentRatio )/ idealRatio
2626
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ func buildCommand(cfg initd.Config) (*exec.Cmd, error) {
3737 workingDir = * cfg .ImageConfig .WorkingDir
3838 }
3939
40+ err := os .Chdir (workingDir )
41+ if err != nil {
42+ return nil , fmt .Errorf ("error changing working directory: %v" , err )
43+ }
44+
4045 lp , err := exec .LookPath (args [0 ])
4146 if err != nil {
4247 return nil , fmt .Errorf ("error searching for executable: %v" , err )
@@ -46,7 +51,6 @@ func buildCommand(cfg initd.Config) (*exec.Cmd, error) {
4651 Path : lp ,
4752 Args : args ,
4853 Env : envars ,
49- Dir : workingDir ,
5054 Stdin : os .Stdin ,
5155 Stdout : os .Stdout ,
5256 Stderr : os .Stderr ,
You can’t perform that action at this time.
0 commit comments