From 41a081718877c3ec1e1c83ceb8d5af814c63341b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Jun 2024 15:34:45 -0400 Subject: [PATCH] make extendcluster also updatecluster This avoids the user forgetting to do it and simplifies the documentation. --- Command/ExtendCluster.hs | 5 ++++- doc/clusters.mdwn | 1 - doc/git-annex-extendcluster.mdwn | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Command/ExtendCluster.hs b/Command/ExtendCluster.hs index 6fa248d57a..21e65903f1 100644 --- a/Command/ExtendCluster.hs +++ b/Command/ExtendCluster.hs @@ -15,6 +15,7 @@ import Types.Cluster import Config import Types.GitConfig import qualified Remote +import qualified Command.UpdateCluster import qualified Data.Map as M @@ -27,7 +28,9 @@ seek (remotename:clustername:[]) = Remote.byName (Just clusterremotename) >>= \c Just clusterremote -> Remote.byName (Just remotename) >>= \case Just gatewayremote -> case mkClusterUUID (Remote.uuid clusterremote) of - Just cu -> commandAction $ start cu clustername gatewayremote + Just cu -> do + commandAction $ start cu clustername gatewayremote + Command.UpdateCluster.seek [] Nothing -> giveup $ clusterremotename ++ " is not a cluster remote." Nothing -> giveup $ "No remote named " ++ remotename ++ " exists." diff --git a/doc/clusters.mdwn b/doc/clusters.mdwn index e26163a88e..1a4a70ae97 100644 --- a/doc/clusters.mdwn +++ b/doc/clusters.mdwn @@ -168,7 +168,6 @@ for NYC, and extending the cluster to there as well: AMS$ git remote add NYC me@nyc.example.com:annex AMS$ git-annex sync NYC NYC$ git-annex extendcluster NYC mycluster - AMS$ git-annex updatecluster A user can now add either AMS or NYC as a remote, and will have access to the entire cluster as either `AMS-mycluster` or `NYC-mycluster`. diff --git a/doc/git-annex-extendcluster.mdwn b/doc/git-annex-extendcluster.mdwn index 79796fe6e8..9674cc9d15 100644 --- a/doc/git-annex-extendcluster.mdwn +++ b/doc/git-annex-extendcluster.mdwn @@ -17,8 +17,12 @@ The `clustername` parameter is the name of the cluster. The next step after running this command is to configure any additional cluster nodes that this gateway serves to the cluster, -then run [[git-annex-updatecluster]] on each gateway. -See the documentation of that command for details about configuring nodes. +then run [[git-annex-updatecluster]]. See the documentation of that +command for details about configuring nodes. + +After running this command in the new gateway repository, it typically +also needs to be run in the other gateway repositories as well, +after adding the new gateway repository as a remote. # OPTIONS