From 9a54ba471986b994f10ad332f27639059c18e7e1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 Mar 2017 16:52:00 -0400 Subject: don't propagate DNS info from DiskImage chroots * DiskImage building properties used to propagate DNS info out from the chroot used to build the disk image to the Host. That is no longer done, since that chroot only exists as a side effect of the disk image creation and servers will not be running in it. * The IsInfo types class's propagateInfo function changed to use a PropagateInfo data type. (API change) This is particularly important when using hostChroot, since the host could well have DNS settings then. This commit was sponsored by Ole-Morten Duesund on Patreon. --- src/Propellor/Property/Chroot.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Propellor/Property/Chroot.hs') diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index 4b9b48e1..8f18d724 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -135,7 +135,7 @@ provisioned' -> Bool -> RevertableProperty (HasInfo + Linux) Linux provisioned' c@(Chroot loc bootstrapper infopropigator _) systemdonly = - (infopropigator $ setup `describe` chrootDesc c "exists") + (infopropigator normalContainerInfo $ setup `describe` chrootDesc c "exists") (teardown `describe` chrootDesc c "removed") where @@ -154,11 +154,12 @@ provisioned' c@(Chroot loc bootstrapper infopropigator _) systemdonly = property ("removed " ++ loc) $ makeChange (removeChroot loc) -type InfoPropagator = Property Linux -> Property (HasInfo + Linux) +type InfoPropagator = (PropagateInfo -> Bool) -> Property Linux -> Property (HasInfo + Linux) propagateChrootInfo :: Chroot -> InfoPropagator -propagateChrootInfo c@(Chroot location _ _ _) p = propagateContainer location c $ - p `setInfoProperty` chrootInfo c +propagateChrootInfo c@(Chroot location _ _ _) pinfo p = + propagateContainer location c pinfo $ + p `setInfoProperty` chrootInfo c chrootInfo :: Chroot -> Info chrootInfo (Chroot loc _ _ h) = mempty `addInfo` @@ -308,6 +309,6 @@ hostChroot h bootstrapper d = chroot -- HostContext is not made to use the name of the chroot as its context, -- but instead uses the hostname of the Host. propagateHostChrootInfo :: Host -> Chroot -> InfoPropagator -propagateHostChrootInfo h c p = - propagateContainer (hostName h) c $ +propagateHostChrootInfo h c pinfo p = + propagateContainer (hostName h) c pinfo $ p `setInfoProperty` chrootInfo c -- cgit v1.2.3