server: refactor to use Config struct
This paves the way for having a configuration file that is loaded rather than everything being set via the command-line. Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
parent
3f48986ea0
commit
7bf5110b76
5 changed files with 230 additions and 45 deletions
|
@ -55,10 +55,10 @@ func (s *Server) PullImage(ctx context.Context, req *pb.PullImageRequest) (*pb.P
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if err = os.Mkdir(filepath.Join(imageStore, tr.StringWithinTransport()), 0755); err != nil {
|
||||
if err = os.Mkdir(filepath.Join(s.config.ImageStore, tr.StringWithinTransport()), 0755); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dir, err := directory.NewReference(filepath.Join(imageStore, tr.StringWithinTransport()))
|
||||
dir, err := directory.NewReference(filepath.Join(s.config.ImageStore, tr.StringWithinTransport()))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue