Event system alpha experiment (#18795)
This commit is contained in:
parent
15ae00d147
commit
fc378c0908
|
@ -1,4 +1,4 @@
|
||||||
```release-note:improvement
|
```release-note:improvement
|
||||||
core: Add experiments system and `events.beta1` experiment.
|
core: Add experiments system and `events.alpha1` experiment.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package experiments
|
package experiments
|
||||||
|
|
||||||
const VaultExperimentEventsBeta1 = "events.beta1"
|
const VaultExperimentEventsAlpha1 = "events.alpha1"
|
||||||
|
|
||||||
var validExperiments = []string{
|
var validExperiments = []string{
|
||||||
VaultExperimentEventsBeta1,
|
VaultExperimentEventsAlpha1,
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidExperiments exposes the list without exposing a mutable global variable.
|
// ValidExperiments exposes the list without exposing a mutable global variable.
|
||||||
|
|
|
@ -1269,7 +1269,7 @@ func NewCore(conf *CoreConfig) (*Core, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
c.events = events
|
c.events = events
|
||||||
if c.isExperimentEnabled(experiments.VaultExperimentEventsBeta1) {
|
if c.isExperimentEnabled(experiments.VaultExperimentEventsAlpha1) {
|
||||||
c.events.Start()
|
c.events.Start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5466,7 +5466,7 @@ func TestSystemBackend_ReadExperiments(t *testing.T) {
|
||||||
|
|
||||||
for name, tc := range map[string][]string{
|
for name, tc := range map[string][]string{
|
||||||
"no experiments enabled": {},
|
"no experiments enabled": {},
|
||||||
"one experiment enabled": {experiments.VaultExperimentEventsBeta1},
|
"one experiment enabled": {experiments.VaultExperimentEventsAlpha1},
|
||||||
} {
|
} {
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
// Set the enabled experiments.
|
// Set the enabled experiments.
|
||||||
|
|
|
@ -37,7 +37,7 @@ $ curl \
|
||||||
"renewable": false,
|
"renewable": false,
|
||||||
"data": {
|
"data": {
|
||||||
"available": [
|
"available": [
|
||||||
"events.beta1"
|
"events.alpha1"
|
||||||
],
|
],
|
||||||
"enabled": []
|
"enabled": []
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue