Skip to content

Commit b000fda

Browse files
authored
Fix the usage of the management API in the e2e test framework (#2401)
1 parent cac1c22 commit b000fda

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

api/v1beta2/foundationdbcluster_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,7 @@ func (cluster *FoundationDBCluster) GetMaxConcurrentReplacements() int {
27692769
}
27702770

27712771
// UseManagementAPI returns the value of UseManagementAPI or false if unset.
2772+
// Deprecated: Use DatabaseInteractionMode instead.
27722773
func (cluster *FoundationDBCluster) UseManagementAPI() bool {
27732774
return ptr.Deref(cluster.Spec.AutomationOptions.UseManagementAPI, false)
27742775
}

controllers/maintenance_mode_checker.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,9 @@ func (c maintenanceModeChecker) reconcile(
150150
return &requeue{curError: err, delayedRequeue: true}
151151
}
152152

153+
// Reset the maintenance zone in the cached status for this run. In this code path the maintenance off command
154+
// returned without an error, so we can assume that the maintenance zone was reset.
155+
status.Cluster.MaintenanceZone = ""
156+
153157
return nil
154158
}

e2e/fixtures/fdb_cluster_specs.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ func (factory *Factory) createFDBClusterSpec(
6363
faultDomain.ValueFrom = ""
6464
}
6565

66+
var databaseInteractionMode *fdbv1beta2.DatabaseInteractionMode
67+
if ptr.Deref(config.ManagementAPI, false) {
68+
databaseInteractionMode = ptr.To(fdbv1beta2.DatabaseInteractionModeMgmtAPI)
69+
}
70+
6671
return &fdbv1beta2.FoundationDBCluster{
6772
ObjectMeta: metav1.ObjectMeta{
6873
Name: config.Name,
@@ -106,7 +111,7 @@ func (factory *Factory) createFDBClusterSpec(
106111
},
107112
UseLocalitiesForExclusion: config.UseLocalityBasedExclusions,
108113
SynchronizationMode: ptr.To(string(config.SynchronizationMode)),
109-
UseManagementAPI: config.ManagementAPI,
114+
DatabaseInteractionMode: databaseInteractionMode,
110115
},
111116
Routing: fdbv1beta2.RoutingConfig{
112117
UseDNSInClusterFile: config.UseDNS,

0 commit comments

Comments
 (0)