Skip to content

Add log options - #238

Open
kenichi-mashiyama wants to merge 1 commit into
six-group:mainfrom
kenichi-mashiyama:add-log-options
Open

kenichi-mashiyama wants to merge 1 commit into
six-group:mainfrom
kenichi-mashiyama:add-log-options

Conversation

@kenichi-mashiyama

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for configuring various logging options in the defaults section, as well as specific logging options for backends.

Motivation

Currently, the HAProxy Operator lacks granular control over certain native HAProxy logging behaviors directly through the CRDs. Users often need to enable separate error logging, suppress null connection logs, format HTTP logs in CLF, or log health checks. By introducing DefaultsOptions (for Instance CRD) and BackendOptions (for Backend CRD), users can now explicitly configure standard HAProxy logging options (such as option log-separate-errors, option httplog clf, option dontlognull, and option dontlog-normal) dynamically through the Operator.

Changes

  • Added the BackendOptions struct with the LogHealthChecks field to BackendSpec in apis/config/v1alpha1/backend_types.go.
  • Added the DefaultsOptions struct with LogSeparateErrors, LogHealthChecks, Dontlognull, DontlogNormal, and HTTPLogCLF fields to DefaultsConfiguration in apis/proxy/v1alpha1/instance_types.go.
  • Updated the Model() and AddToParser() methods to map these new fields to the native HAProxy configuration lines.
  • Added unit tests in backend_types_test.go and instance_types_test.go to verify the correct parsing and generation of these options.
  • Regenerated CRDs, DeepCopy methods, and API documentation to reflect the schema updates.

Checklist

  • Code changes implemented
  • Unit tests added/updated
  • Generated CRDs and API docs updated

This branch has not been deployed

No deployments
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.

1 participant