Skip to content

add version and headers fields to HTTPChk - #214

Merged
m-terra merged 1 commit into
six-group:mainfrom
kenichi-mashiyama:CustomUser-Agent
Aug 6, 2026
Merged

add version and headers fields to HTTPChk#214
m-terra merged 1 commit into
six-group:mainfrom
kenichi-mashiyama:CustomUser-Agent

Conversation

@kenichi-mashiyama

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for custom HTTP versions and HTTP headers in the HTTPChk configuration for backends and listens.

Motivation

Currently, spec.httpchk only supports method and uri fields, which limits the ability to construct custom http-check send directives (e.g., option httpchk GET / HTTP/1.0\r\nUser-Agent:...).

By adding the optional version and headers fields to HTTPChk, users can now set custom HTTP versions (such as HTTP/1.0) and append arbitrary headers (like custom User-Agents) to their health check requests.

Changes

  • Added version and headers fields to the HTTPChk struct in apis/config/v1alpha1/common_types.go.
  • Implemented HasCustomSendLine() and CustomSendHTTPCheck() helper methods to build the appropriate http-check send directive when version or headers are set.
  • Updated AddToParser() in backend_types.go to inject the custom http-check line into the HAProxy configuration.
  • Regenerated CRDs, DeepCopy methods, and API documentation.
  • Added unit tests in backend_types_test.go to verify custom http-check send generation and validation logic.

Checklist

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

@m-terra
m-terra requested review from m-terra and xosk31 August 6, 2026 07:17

@m-terra m-terra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM - thank you very much for your contribution

@xosk31 xosk31 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution, much appreciated!

@m-terra
m-terra merged commit 1757325 into six-group:main Aug 6, 2026
4 checks passed
@kenichi-mashiyama
kenichi-mashiyama deleted the CustomUser-Agent branch August 7, 2026 05:36
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.

3 participants