While not technically part of the cluster configuration, OpClusterSetParams
is the best place to set and modify the maintenance interval of the maintenance
daemon. Most likely, there won't be enough tunables to justify a separate
Ganeti command.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 src/Ganeti/OpCodes.hs          | 1 +
 src/Ganeti/OpParams.hs         | 9 ++++++++-
 test/hs/Test/Ganeti/OpCodes.hs | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/Ganeti/OpCodes.hs b/src/Ganeti/OpCodes.hs
index 24cc1d6..f532d2b 100644
--- a/src/Ganeti/OpCodes.hs
+++ b/src/Ganeti/OpCodes.hs
@@ -260,6 +260,7 @@ $(genOpCode "OpCode"
      , pEnabledUserShutdown
      , pEnabledDataCollectors
      , pDataCollectorInterval
+     , pMaintdRoundDelay
      ],
      [])
   , ("OpClusterRedistConf",
diff --git a/src/Ganeti/OpParams.hs b/src/Ganeti/OpParams.hs
index 08c4be8..4746430 100644
--- a/src/Ganeti/OpParams.hs
+++ b/src/Ganeti/OpParams.hs
@@ -297,6 +297,7 @@ module Ganeti.OpParams
   , pEnabledUserShutdown
   , pAdminStateSource
   , pEnabledDataCollectors
+  , pMaintdRoundDelay
   , pDataCollectorInterval
   , pNodeSslCerts
   , pSshKeys
@@ -1889,6 +1890,12 @@ pDataCollectorInterval =
   optionalField $
   simpleField C.dataCollectorsIntervalName [t| GenericContainer String Int |]
 
+pMaintdRoundDelay :: Field
+pMaintdRoundDelay =
+  withDoc "Minimal delay between rounds of the maintenance daemon"
+  . optionalField
+  $ simpleField "maint_round_delay" [t| Int |]
+
 pNodeSslCerts :: Field
 pNodeSslCerts =
   withDoc "Whether to renew node SSL certificates" .
@@ -1917,4 +1924,4 @@ pLongSleep :: Field
 pLongSleep =
   withDoc "Whether to allow long instance shutdowns during exports" .
   defaultField [| False |] $
-  simpleField "long_sleep" [t| Bool |]
\ No newline at end of file
+  simpleField "long_sleep" [t| Bool |]
diff --git a/test/hs/Test/Ganeti/OpCodes.hs b/test/hs/Test/Ganeti/OpCodes.hs
index 17c361a..7b7fac5 100644
--- a/test/hs/Test/Ganeti/OpCodes.hs
+++ b/test/hs/Test/Ganeti/OpCodes.hs
@@ -251,6 +251,7 @@ instance Arbitrary OpCodes.OpCode where
           <*> arbitrary                    -- enabled_user_shutdown
           <*> genMaybe arbitraryDataCollector   -- enabled_data_collectors
           <*> arbitraryDataCollectorInterval   -- data_collector_interval
+          <*> genMaybe (fromPositive <$> arbitrary) -- maintd round interval
       "OP_CLUSTER_REDIST_CONF" -> pure OpCodes.OpClusterRedistConf
       "OP_CLUSTER_ACTIVATE_MASTER_IP" ->
         pure OpCodes.OpClusterActivateMasterIp
-- 
2.4.3.573.g4eafbef

Reply via email to