@@ -489,6 +489,11 @@ func (m *upgradeManager) AbortDatabaseUpgrade(ctx context.Context) error {
489489
490490// Status returns the current status of the upgrade process.
491491func (m * upgradeManager ) Status (ctx context.Context ) (client.UpgradeStatus , error ) {
492+ _ , _ , mode := m .upgradeManagerContext .ClusterConfig ()
493+ if ! mode .HasAgency () {
494+ return client.UpgradeStatus {}, maskAny (client .NewPreconditionFailedError ("Mode does not support agency based upgrades" ))
495+ }
496+
492497 plan , err := m .readUpgradePlan (ctx )
493498 if agency .IsKeyNotFound (err ) {
494499 // No plan, return not found error
@@ -596,7 +601,7 @@ func (m *upgradeManager) fetchBinaryDatabaseVersions(ctx context.Context) ([]dri
596601// fetchRunningDatabaseVersions asks all arangod servers in the deployment for their version.
597602// It returns all distinct versions.
598603func (m * upgradeManager ) fetchRunningDatabaseVersions (ctx context.Context ) ([]driver.Version , error ) {
599- config , _ , _ := m .upgradeManagerContext .ClusterConfig ()
604+ config , _ , mode := m .upgradeManagerContext .ClusterConfig ()
600605 versionMap := make (map [driver.Version ]struct {})
601606 var versionList []driver.Version
602607
@@ -623,17 +628,23 @@ func (m *upgradeManager) fetchRunningDatabaseVersions(ctx context.Context) ([]dr
623628 return nil
624629 }
625630
626- if err := collect (config .GetAgentEndpoints , ConnectionTypeAgency ); err != nil {
627- return nil , maskAny (err )
628- }
629- if err := collect (config .GetCoordinatorEndpoints , ConnectionTypeDatabase ); err != nil {
630- return nil , maskAny (err )
631+ if mode .HasAgency () {
632+ if err := collect (config .GetAgentEndpoints , ConnectionTypeAgency ); err != nil {
633+ return nil , maskAny (err )
634+ }
631635 }
632- if err := collect (config .GetDBServerEndpoints , ConnectionTypeDatabase ); err != nil {
633- return nil , maskAny (err )
636+ if mode .IsClusterMode () {
637+ if err := collect (config .GetCoordinatorEndpoints , ConnectionTypeDatabase ); err != nil {
638+ return nil , maskAny (err )
639+ }
640+ if err := collect (config .GetDBServerEndpoints , ConnectionTypeDatabase ); err != nil {
641+ return nil , maskAny (err )
642+ }
634643 }
635- if err := collect (config .GetAllSingleEndpoints , ConnectionTypeDatabase ); err != nil {
636- return nil , maskAny (err )
644+ if mode .IsSingleMode () || mode .IsActiveFailoverMode () {
645+ if err := collect (config .GetAllSingleEndpoints , ConnectionTypeDatabase ); err != nil {
646+ return nil , maskAny (err )
647+ }
637648 }
638649
639650 return versionList , nil
@@ -722,6 +733,11 @@ func (m *upgradeManager) removeUpgradePlan(ctx context.Context) error {
722733// RunWatchUpgradePlan keeps watching the upgrade plan in the agency.
723734// Once it detects that this starter has to act, it does.
724735func (m * upgradeManager ) RunWatchUpgradePlan (ctx context.Context ) {
736+ _ , _ , mode := m .upgradeManagerContext .ClusterConfig ()
737+ if ! mode .HasAgency () {
738+ // Nothing to do here without an agency
739+ return
740+ }
725741 for {
726742 delay := time .Second * 10
727743 plan , err := m .readUpgradePlan (ctx )
0 commit comments