Skip to content

Commit 17cdcad

Browse files
committed
Merge branch 'main' into protobuf-with-plugin
2 parents 55fe9c7 + 8f3d0f6 commit 17cdcad

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

cmd/rep/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ type RepConfig struct {
9797
PlacementTags []string `json:"placement_tags"`
9898
PollingInterval durationjson.Duration `json:"polling_interval,omitempty"`
9999
PreloadedRootFS RootFSes `json:"preloaded_root_fs"`
100+
SidecarRootFSPath string `json:"sidecar_root_fs_path"`
100101
ServerCertFile string `json:"server_cert_file"` // DEPRECATED. Kept around for dusts compatability
101102
ServerKeyFile string `json:"server_key_file"` // DEPRECATED. Kept around for dusts compatability
102103
CertFile string `json:"cert_file"`

cmd/rep/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ func main() {
8989
}
9090

9191
rootFSMap := repConfig.PreloadedRootFS.StackPathMap()
92+
sidecarRootFSPath := repConfig.SidecarRootFSPath
9293

93-
executorClient, containerMetricsProvider, executorMembers, err := executorinit.Initialize(logger, repConfig.ExecutorConfig, repConfig.CellID, repConfig.Zone, rootFSMap, metronClient, clock)
94+
executorClient, containerMetricsProvider, executorMembers, err := executorinit.Initialize(logger, repConfig.ExecutorConfig, repConfig.CellID, repConfig.Zone, rootFSMap, sidecarRootFSPath, metronClient, clock)
9495
if err != nil {
9596
logger.Error("failed-to-initialize-executor", err)
9697
os.Exit(1)
@@ -135,7 +136,7 @@ func main() {
135136
)
136137

137138
requestTypes := []string{
138-
"State", "ContainerMetrics", "Perform", "Reset", "UpdateLRPInstance", "StopLRPInstance", "CancelTask", //over https only
139+
"State", "ContainerMetrics", "Perform", "Reset", "UpdateLRPInstance", "StopLRPInstance", "CancelTask", // over https only
139140
}
140141
requestMetrics := helpers.NewRequestMetricsNotifier(logger, clock, metronClient, time.Duration(repConfig.ReportInterval), requestTypes)
141142
httpServer := initializeServer(auctionCellRep, executorClient, evacuatable, requestMetrics, logger, repConfig, false)
@@ -271,7 +272,6 @@ func initializeServer(
271272
handlers := handlers.New(auctionCellRep, auctionCellRep, executorClient, evacuatable, requestMetrics, logger, networkAccessible)
272273
routes := rep.NewRoutes(networkAccessible)
273274
router, err := rata.NewRouter(routes, handlers)
274-
275275
if err != nil {
276276
logger.Fatal("failed-to-construct-router", err)
277277
}

cmd/rep/main_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,23 @@ var _ = Describe("The Rep", func() {
464464
)))
465465
})
466466
})
467+
468+
Context("when there is an explixitly specified rootfs path", func() {
469+
BeforeEach(func() {
470+
repConfig.PreloadedRootFS = append(repConfig.PreloadedRootFS, config.RootFS{
471+
Name: "another",
472+
Path: "/path/to/another/rootfs",
473+
})
474+
repConfig.SidecarRootFSPath = "/path/to/another/rootfs"
475+
})
476+
477+
It("uses the specified rootfs path", func() {
478+
Eventually(createRequestReceived).Should(Receive(And(
479+
ContainSubstring(`check-`),
480+
ContainSubstring(`/path/to/another/rootfs`),
481+
)))
482+
})
483+
})
467484
})
468485

469486
Context("when Garden is available", func() {

0 commit comments

Comments
 (0)