From 671a4abad0b3a06ae034ccf00c2fdc6fd99d082e Mon Sep 17 00:00:00 2001 From: "Johannes M. Scheuermann" Date: Wed, 3 Dec 2025 15:46:11 +0100 Subject: [PATCH] Fix the usage of the management API in the e2e test framework --- api/v1beta2/foundationdbcluster_types.go | 1 + controllers/maintenance_mode_checker.go | 4 ++++ e2e/fixtures/fdb_cluster_specs.go | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/api/v1beta2/foundationdbcluster_types.go b/api/v1beta2/foundationdbcluster_types.go index 0bf9d5283..ae5794416 100644 --- a/api/v1beta2/foundationdbcluster_types.go +++ b/api/v1beta2/foundationdbcluster_types.go @@ -2769,6 +2769,7 @@ func (cluster *FoundationDBCluster) GetMaxConcurrentReplacements() int { } // UseManagementAPI returns the value of UseManagementAPI or false if unset. +// Deprecated: Use DatabaseInteractionMode instead. func (cluster *FoundationDBCluster) UseManagementAPI() bool { return ptr.Deref(cluster.Spec.AutomationOptions.UseManagementAPI, false) } diff --git a/controllers/maintenance_mode_checker.go b/controllers/maintenance_mode_checker.go index 699f4a9be..99178a60a 100644 --- a/controllers/maintenance_mode_checker.go +++ b/controllers/maintenance_mode_checker.go @@ -150,5 +150,9 @@ func (c maintenanceModeChecker) reconcile( return &requeue{curError: err, delayedRequeue: true} } + // Reset the maintenance zone in the cached status for this run. In this code path the maintenance off command + // returned without an error, so we can assume that the maintenance zone was reset. + status.Cluster.MaintenanceZone = "" + return nil } diff --git a/e2e/fixtures/fdb_cluster_specs.go b/e2e/fixtures/fdb_cluster_specs.go index 33a763bf7..c75847780 100644 --- a/e2e/fixtures/fdb_cluster_specs.go +++ b/e2e/fixtures/fdb_cluster_specs.go @@ -63,6 +63,11 @@ func (factory *Factory) createFDBClusterSpec( faultDomain.ValueFrom = "" } + var databaseInteractionMode *fdbv1beta2.DatabaseInteractionMode + if ptr.Deref(config.ManagementAPI, false) { + databaseInteractionMode = ptr.To(fdbv1beta2.DatabaseInteractionModeMgmtAPI) + } + return &fdbv1beta2.FoundationDBCluster{ ObjectMeta: metav1.ObjectMeta{ Name: config.Name, @@ -106,7 +111,7 @@ func (factory *Factory) createFDBClusterSpec( }, UseLocalitiesForExclusion: config.UseLocalityBasedExclusions, SynchronizationMode: ptr.To(string(config.SynchronizationMode)), - UseManagementAPI: config.ManagementAPI, + DatabaseInteractionMode: databaseInteractionMode, }, Routing: fdbv1beta2.RoutingConfig{ UseDNSInClusterFile: config.UseDNS,