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

BUG/MINOR: add missing field when parsing backend balance field #107

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

fabianonunes
Copy link
Contributor

@fabianonunes fabianonunes commented Mar 22, 2024

When parsing a backend with the balance option set to uri path-only, the parameter PathOnly is ignored:

func TestBalance(t *testing.T) {
	configFile, _ := os.CreateTemp("/tmp", "")
	_, _ = configFile.WriteString(`
		backend app
		    balance uri path-only
	`)

	config, _ := configuration.New(
		context.Background(),
		options.ConfigurationFile(configFile.Name()),
		options.HAProxyBin("echo"),
		options.TransactionsDir("/tmp"),
	)

	_, backend, _ := config.GetBackend("app", "")
	assert.True(t, backend.Balance.URIPathOnly)
}

@mjuraga
Copy link
Collaborator

mjuraga commented Mar 25, 2024

Thanks for the contribution, LGTM.

@mjuraga mjuraga merged commit 042bf50 into haproxytech:master Mar 25, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants