-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove CE-only warning from shared tests #26052
Conversation
Changes incoming: I realise we already have a mechanism for this so will update the PR to use it. |
CI Results: |
Build Results: |
@@ -238,7 +238,7 @@ func parseRaftBackendConfig(conf map[string]string, logger log.Logger) (*RaftBac | |||
} | |||
|
|||
c.AutopilotRedundancyZone = conf["autopilot_redundancy_zone"] | |||
if c.AutopilotRedundancyZone == "" { | |||
if c.AutopilotRedundancyZone != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An actual bug that not testing warnings missed!
@@ -14,5 +14,5 @@ func (b *RaftBackend) entrySizeLimitForPath(path string) uint64 { | |||
} | |||
|
|||
func emitEntWarning(logger hclog.Logger, field string) { | |||
logger.Warn("%s is configuration for a Vault Enterprise feature and has been ignored.", field) | |||
logger.Warn("configuration for a Vault Enterprise feature has been ignored", "field", field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another bug! I used hclog like fmt
🤦
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't have a test case for this before so I added one while I'm here!
physical/raft/config_test.go
Outdated
@@ -50,6 +58,7 @@ func TestRaft_ParseConfig(t *testing.T) { | |||
cfg.RaftLogVerifierEnabled = true | |||
cfg.RaftLogVerificationInterval = defaultRaftLogVerificationInterval | |||
}, | |||
wantWarns: ceOnlyWarnings("raft_log_verification_interval is less than the minimum allowed"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this warning not present in enterprise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh great catch. Will remove this wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5ddc1ea
I added this while developing #25992 as a quick check that the warnings were omitted (and that this test functionality worked) but didn't intend to commit it since it will conflict with Enterprise code.
Perhaps later it would be nice to have a clean way to be able to encode these warnings here but only for CE but that is a bigger change that is a bit gross so want to just get this mergeable in Ent for now while we discuss the cleanest pattern for that.