summaryrefslogtreecommitdiff
path: root/Omni/Deploy/Manifest.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Deploy/Manifest.hs')
-rw-r--r--Omni/Deploy/Manifest.hs18
1 files changed, 8 insertions, 10 deletions
diff --git a/Omni/Deploy/Manifest.hs b/Omni/Deploy/Manifest.hs
index bbbda95..13dd47a 100644
--- a/Omni/Deploy/Manifest.hs
+++ b/Omni/Deploy/Manifest.hs
@@ -71,7 +71,7 @@ instance Aeson.FromJSON Artifact where
parseJSON =
Aeson.withObject "Artifact" <| \o ->
Artifact
- <$> o
+ </ o
.:? "type"
.!= "nix-closure"
<*> o
@@ -95,7 +95,7 @@ instance Aeson.FromJSON Exec where
parseJSON =
Aeson.withObject "Exec" <| \o ->
Exec
- <$> o
+ </ o
.:? "command"
<*> o
.:? "user"
@@ -126,7 +126,7 @@ instance Aeson.FromJSON Http where
parseJSON =
Aeson.withObject "Http" <| \o ->
Http
- <$> o
+ </ o
.: "domain"
<*> o
.:? "path"
@@ -154,7 +154,7 @@ instance Aeson.FromJSON Systemd where
parseJSON =
Aeson.withObject "Systemd" <| \o ->
Systemd
- <$> o
+ </ o
.:? "after"
.!= ["network-online.target"]
<*> o
@@ -191,7 +191,7 @@ instance Aeson.FromJSON Hardening where
parseJSON =
Aeson.withObject "Hardening" <| \o ->
Hardening
- <$> o
+ </ o
.:? "dynamicUser"
.!= False
<*> o
@@ -234,7 +234,7 @@ instance Aeson.FromJSON Service where
parseJSON =
Aeson.withObject "Service" <| \o ->
Service
- <$> o
+ </ o
.: "name"
<*> o
.: "artifact"
@@ -286,7 +286,7 @@ instance Aeson.FromJSON Manifest where
parseJSON =
Aeson.withObject "Manifest" <| \o ->
Manifest
- <$> o
+ </ o
.:? "version"
.!= 1
<*> o
@@ -515,9 +515,7 @@ move args
Exit.exitWith (Exit.ExitFailure 1)
Right svc -> do
manifest <- loadManifestFromS3
- m <- case manifest of
- Nothing -> createEmptyManifest
- Just existing -> pure existing
+ m <- maybe createEmptyManifest pure manifest
case findService (serviceName svc) m of
Just _ -> do
Log.fail ["manifest", "service already exists:", serviceName svc]