Skip to content

Commit

Permalink
Remove eventing & experimental subsystems
Browse files Browse the repository at this point in the history
The eventing subsystem was the only pre-release experiment present in
upstream's 1.14.x branch; this wasn't stabilized and more widely used
until later release (1.15.x and the upcoming 1.16.x); and so makes
little sense to keep in its partial form. Additionally, no existing
plugins within this distribution currently emit such events.

By removing eventing, we can also remove the experiments subsystem; this
was only used for enabling the eventing subsystem in this release.

See also: https://developer.hashicorp.com/vault/docs/concepts/events

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
  • Loading branch information
cipherboy committed Mar 12, 2024
1 parent 5fa3d9a commit 60ce888
Show file tree
Hide file tree
Showing 39 changed files with 612 additions and 3,357 deletions.
11 changes: 0 additions & 11 deletions command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ const (
// EnvVaultLogLevel is used to specify the log level applied to logging
// Supported log levels: Trace, Debug, Error, Warn, Info
EnvVaultLogLevel = "BAO_LOG_LEVEL"
// EnvVaultExperiments defines the experiments to enable for a server as a
// comma separated list. See experiments.ValidExperiments() for the list of
// valid experiments. Not mutable or persisted in storage, only read and
// logged at startup _per node_. This was initially introduced for the events
// system being developed over multiple release cycles.
EnvVaultExperiments = "BAO_EXPERIMENTS"

// flagNameAddress is the flag used in the base command to read in the
// address of the Vault server.
Expand Down Expand Up @@ -273,11 +267,6 @@ func initCommands(ui, serverCmdUi cli.Ui, runOpts *RunOptions) map[string]cli.Co
BaseCommand: getBaseCommand(),
}, nil
},
"events subscribe": func() (cli.Command, error) {
return &EventsSubscribeCommands{
BaseCommand: getBaseCommand(),
}, nil
},
"lease": func() (cli.Command, error) {
return &LeaseCommand{
BaseCommand: getBaseCommand(),
Expand Down
127 changes: 0 additions & 127 deletions command/events.go

This file was deleted.

71 changes: 0 additions & 71 deletions command/events_test.go

This file was deleted.

25 changes: 0 additions & 25 deletions command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import (
config2 "github.com/openbao/openbao/command/config"
"github.com/openbao/openbao/command/server"
"github.com/openbao/openbao/helper/builtinplugins"
"github.com/openbao/openbao/helper/experiments"
loghelper "github.com/openbao/openbao/helper/logging"
"github.com/openbao/openbao/helper/metricsutil"
"github.com/openbao/openbao/helper/namespace"
Expand Down Expand Up @@ -122,7 +121,6 @@ type ServerCommand struct {

flagConfigs []string
flagRecovery bool
flagExperiments []string
flagDev bool
flagDevTLS bool
flagDevTLSCertDir string
Expand Down Expand Up @@ -212,17 +210,6 @@ func (c *ServerCommand) Flags() *FlagSets {
"Using a recovery operation token, \"sys/raw\" API can be used to manipulate the storage.",
})

f.StringSliceVar(&StringSliceVar{
Name: "experiment",
Target: &c.flagExperiments,
Completion: complete.PredictSet(experiments.ValidExperiments()...),
Usage: "Name of an experiment to enable. Experiments should NOT be used in production, and " +
"the associated APIs may have backwards incompatible changes between releases. This " +
"flag can be specified multiple times to specify multiple experiments. This can also be " +
fmt.Sprintf("specified via the %s environment variable as a comma-separated list. ", EnvVaultExperiments) +
"Valid experiments are: " + strings.Join(experiments.ValidExperiments(), ", "),
})

f = set.NewFlagSet("Dev Options")

f.BoolVar(&BoolVar{
Expand Down Expand Up @@ -1128,11 +1115,6 @@ func (c *ServerCommand) Run(args []string) int {
}
}

if err := server.ExperimentsFromEnvAndCLI(config, EnvVaultExperiments, c.flagExperiments); err != nil {
c.UI.Error(err.Error())
return 1
}

// If mlockall(2) isn't supported, show a warning. We disable this in dev
// because it is quite scary to see when first using Vault. We also disable
// this if the user has explicitly disabled mlock in configuration.
Expand Down Expand Up @@ -1203,12 +1185,6 @@ func (c *ServerCommand) Run(args []string) int {
info[key] = strings.Join(envVarKeys, ", ")
infoKeys = append(infoKeys, key)

if len(config.Experiments) != 0 {
expKey := "experiments"
info[expKey] = strings.Join(config.Experiments, ", ")
infoKeys = append(infoKeys, expKey)
}

barrierSeal, barrierWrapper, unwrapSeal, seals, sealConfigError, err := setSeal(c, config, infoKeys, info)
// Check error here
if err != nil {
Expand Down Expand Up @@ -2720,7 +2696,6 @@ func createCoreConfig(c *ServerCommand, config *server.Config, backend physical.
EnableResponseHeaderHostname: config.EnableResponseHeaderHostname,
EnableResponseHeaderRaftNodeID: config.EnableResponseHeaderRaftNodeID,
DisableSSCTokens: config.DisableSSCTokens,
Experiments: config.Experiments,
AdministrativeNamespacePath: config.AdministrativeNamespacePath,
}

Expand Down
Loading

0 comments on commit 60ce888

Please sign in to comment.