From 351f31559687f0f0fa6cdc2756ca169eb3daee8c Mon Sep 17 00:00:00 2001 From: Lasith Koswatta Gamage Date: Sun, 26 Nov 2023 08:27:19 +0000 Subject: [PATCH] (feat): Remove file system service cache --- configs/ubuntu.yml | 4 +++- internal/service/filesystem.go | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/configs/ubuntu.yml b/configs/ubuntu.yml index cbe8919..12dfb7b 100644 --- a/configs/ubuntu.yml +++ b/configs/ubuntu.yml @@ -8,4 +8,6 @@ devices: mountOptions: defaults group: ubuntu user: ubuntu - permissions: 644 \ No newline at end of file + permissions: 644 + remount: true + resizeFs: true \ No newline at end of file diff --git a/internal/service/filesystem.go b/internal/service/filesystem.go index 1d6eb5f..a3600d9 100644 --- a/internal/service/filesystem.go +++ b/internal/service/filesystem.go @@ -23,22 +23,17 @@ type FileSystemServiceFactory interface { } type LinuxFileSystemServiceFactory struct { - services map[model.FileSystem]FileSystemService RunnerFactory utils.RunnerFactory } func NewLinuxFileSystemServiceFactory(rc utils.RunnerFactory) *LinuxFileSystemServiceFactory { return &LinuxFileSystemServiceFactory{ - services: map[model.FileSystem]FileSystemService{}, RunnerFactory: rc, } } func (fsf *LinuxFileSystemServiceFactory) Select(fs model.FileSystem) (FileSystemService, error) { - fss, exists := fsf.services[fs] - if exists { - return fss, nil - } + var fss FileSystemService switch fs { case model.Ext4: fss = NewExt4Service(fsf.RunnerFactory) @@ -47,7 +42,6 @@ func (fsf *LinuxFileSystemServiceFactory) Select(fs model.FileSystem) (FileSyste case model.Unformatted: return nil, fmt.Errorf("🔴 An unsupported filesystem was encountered") } - fsf.services[fs] = fss return fss, nil }