diff --git a/wsl-pro-service/internal/system/landscape.go b/wsl-pro-service/internal/system/landscape.go index 0235583d6..46f9857c2 100644 --- a/wsl-pro-service/internal/system/landscape.go +++ b/wsl-pro-service/internal/system/landscape.go @@ -77,7 +77,7 @@ func (s *System) fixAndEnableLandscapeFromConfig(ctx context.Context, landscapeC } // TODO: check foreground/background - cmd := s.backend.LandscapeConfigExecutable(ctx, "--config", landscapeConfigPath, "--silent") + cmd := s.backend.LandscapeConfigExecutable(ctx, "--config", landscapeConfigPath, "--silent", "--register-if-needed") if _, err := runCommand(cmd); err != nil { return fmt.Errorf("could not enable Landscape: %v", err) } diff --git a/wsl-pro-service/internal/testutils/mock_executables.go b/wsl-pro-service/internal/testutils/mock_executables.go index aced47103..fa1453c70 100644 --- a/wsl-pro-service/internal/testutils/mock_executables.go +++ b/wsl-pro-service/internal/testutils/mock_executables.go @@ -404,8 +404,8 @@ func LandscapeConfigMock(t *testing.T) { } return exitOk - case 3: - // landscape-config [--config|-c] FILENAME --silent + case 4: + // landscape-config [--config|-c] FILENAME --silent --register-if-needeed if argv[0] != "-c" && argv[0] != "--config" { fmt.Fprintf(os.Stderr, "Mock not implemented for arg %q\n", argv[0]) return exitBadUsage @@ -416,6 +416,11 @@ func LandscapeConfigMock(t *testing.T) { return exitBadUsage } + if argv[3] != "--register-if-needed" { + fmt.Fprintf(os.Stderr, "Mock not implemented for arg %q\n", argv[3]) + return exitBadUsage + } + if envExists(LandscapeEnableErr) { fmt.Fprintln(os.Stderr, "Enable: Mock error") return exitError