Skip to content
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

Merged
merged 5 commits into from
Mar 20, 2024
Merged

Conversation

banks
Copy link
Member

@banks banks commented Mar 20, 2024

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.

@banks banks added this to the 1.17.0 milestone Mar 20, 2024
@banks banks requested a review from miagilepner March 20, 2024 12:42
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Mar 20, 2024
@banks
Copy link
Member Author

banks commented Mar 20, 2024

Changes incoming: I realise we already have a mechanism for this so will update the PR to use it.

Copy link

github-actions bot commented Mar 20, 2024

CI Results:
All Go tests succeeded! ✅

Copy link

Build Results:
All builds succeeded! ✅

@@ -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 != "" {
Copy link
Member Author

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)
Copy link
Member Author

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 🤦

Comment on lines +128 to +129
},

Copy link
Member Author

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!

@@ -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"),
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5ddc1ea

@banks banks merged commit fc0abf2 into main Mar 20, 2024
80 of 83 checks passed
@banks banks deleted the fix/mount-namespace-ce-warn branch March 20, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants