Skip to content

Commit 3ff0312

Browse files
authored
Enable management API e2e test cases (#2342)
1 parent 7635f80 commit 3ff0312

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

e2e/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ ifndef FEATURE_DNS
9696
FEATURE_DNS=true
9797
endif
9898
endif
99+
100+
ifndef FEATURE_MANAGEMENT_API
101+
ifeq ($(shell shuf -i 0-1 -n 1), 0)
102+
FEATURE_MANAGEMENT_API=false
103+
else
104+
FEATURE_MANAGEMENT_API=true
105+
endif
106+
endif
107+
99108
# Make bash pickier about errors.
100109
SHELL=/bin/bash -euo pipefail
101110

@@ -210,6 +219,7 @@ foundationdb-nightly-tests: run
210219
--feature-synchronization-mode=$(FEATURE_SYNCHRONIZATION_MODE) \
211220
--feature-dns=$(FEATURE_DNS) \
212221
--feature-localities=$(FEATURE_LOCALITIES) \
222+
--feature-management-api=$(FEATURE_MANAGEMENT_API) \
213223
--node-selector="$(NODE_SELECTOR)" \
214224
--default-unavailable-threshold=$(DEFAULT_UNAVAILABLE_THRESHOLD) \
215225
--seaweedfs-image=$(SEAWEEDFS_IMAGE) \

e2e/fixtures/cluster_config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ type ClusterConfig struct {
8383
UseDNS *bool
8484
// If enabled the cluster will be setup with the unified image.
8585
UseUnifiedImage *bool
86+
// ManagementAPI if set to true, the operator will make use of the management API.
87+
ManagementAPI *bool
8688
// SimulateCustomFaultDomainEnv will simulate the use case that a user has set a custom environment variable to
8789
// be used as zone ID.
8890
SimulateCustomFaultDomainEnv bool
@@ -225,6 +227,10 @@ func (config *ClusterConfig) SetDefaults(factory *Factory) {
225227
if config.Version == nil {
226228
config.Version = ptr.To(factory.GetFDBVersion().String())
227229
}
230+
231+
if config.ManagementAPI == nil {
232+
config.ManagementAPI = ptr.To(factory.options.featureManagementAPI)
233+
}
228234
}
229235

230236
// getVolumeSize returns the volume size in as a string. If no volume size is defined a default will be set based on
@@ -632,5 +638,6 @@ func (config *ClusterConfig) Copy() *ClusterConfig {
632638
SynchronizationMode: config.SynchronizationMode,
633639
EnableTLS: config.EnableTLS,
634640
Version: config.Version,
641+
ManagementAPI: config.ManagementAPI,
635642
}
636643
}

e2e/fixtures/fdb_cluster_specs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ func (factory *Factory) createFDBClusterSpec(
106106
},
107107
UseLocalitiesForExclusion: config.UseLocalityBasedExclusions,
108108
SynchronizationMode: ptr.To(string(config.SynchronizationMode)),
109+
UseManagementAPI: config.ManagementAPI,
109110
},
110111
Routing: fdbv1beta2.RoutingConfig{
111112
UseDNSInClusterFile: config.UseDNS,

e2e/fixtures/options.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type FactoryOptions struct {
5959
featureOperatorLocalities bool
6060
featureOperatorUnifiedImage bool
6161
featureOperatorServerSideApply bool
62+
featureManagementAPI bool
6263
dumpOperatorState bool
6364
defaultUnavailableThreshold time.Duration
6465
}
@@ -204,6 +205,12 @@ func (options *FactoryOptions) BindFlags(fs *flag.FlagSet) {
204205
false,
205206
"defines if the operator should make use of server side apply.",
206207
)
208+
fs.BoolVar(
209+
&options.featureManagementAPI,
210+
"feature-management-api",
211+
false,
212+
"defines if the operator should make use of the management API",
213+
)
207214
fs.StringVar(
208215
&options.clusterName,
209216
"cluster-name",

0 commit comments

Comments
 (0)