Skip to content

Commit

Permalink
Fix directory being used during reseed (#1121)
Browse files Browse the repository at this point in the history
"/data" directory was hardcoded previously, needed to use config's Seed
instead.
  • Loading branch information
eliasdaler authored Apr 6, 2023
1 parent cdaefa5 commit f98b60b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fakestorage/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func NewServerWithHostPort(objects []Object, host string, port uint16) (*Server,
type Options struct {
InitialObjects []Object
StorageRoot string
Seed string
Scheme string
Host string
Port uint16
Expand Down Expand Up @@ -292,8 +293,7 @@ func (s *Server) buildMuxer() {
}

func (s *Server) reseedServer(r *http.Request) jsonResponse {
folder := "/data"
initialObjects, emptyBuckets := generateObjectsFromFiles(folder)
initialObjects, emptyBuckets := generateObjectsFromFiles(s.options.Seed)

backendObjects := bufferedObjectsToBackendObjects(initialObjects)

Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func (c *Config) ToFakeGcsOptions() fakestorage.Options {
logger.SetLevel(c.LogLevel)
opts := fakestorage.Options{
StorageRoot: storageRoot,
Seed: c.Seed,
Scheme: c.scheme,
Host: c.host,
Port: uint16(c.port),
Expand Down

0 comments on commit f98b60b

Please sign in to comment.