Commit be751ab9 authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Add comparison of configurations for distribution to MCs



.. and SSConf. The function determines, if the configuration needs to be
fully distributed before finishing a modification call or not.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 4bd16f46
......@@ -27,8 +27,12 @@ module Ganeti.WConfd.ConfigState
( ConfigState
, csConfigData
, mkConfigState
, needsFullDist
) where
import Control.Applicative
import Data.Function (on)
import Ganeti.Objects
-- | In future this data type will include the current configuration
......@@ -42,3 +46,12 @@ data ConfigState = ConfigState
-- This method will expand as more fields are added to 'ConfigState'.
mkConfigState :: ConfigData -> ConfigState
mkConfigState = ConfigState
-- | Given two versions of the configuration, determine if its distribution
-- needs to be fully commited before returning the corresponding call to
-- WConfD.
needsFullDist :: ConfigState -> ConfigState -> Bool
needsFullDist = on (/=) watched
where
watched = (,) <$> clusterCandidateCerts . configCluster . csConfigData
<*> clusterMasterNode . configCluster . csConfigData
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment