Skip to content

fix(alb): anchor health check duration validators - #1856

Open
mittalpk wants to merge 2 commits into
stackitcloud:mainfrom
mittalpk:fix/alb-health-check-duration-validation
Open

mittalpk wants to merge 2 commits into
stackitcloud:mainfrom
mittalpk:fix/alb-health-check-duration-validation

Conversation

@mittalpk

@mittalpk mittalpk commented Oct 24, 2026 •

Copy link
Copy Markdown

Description

relates to #1847

The ALB health check interval, interval_jitter and timeout validators used ^[0-9]{1,3}s|[0-9]{1,3}\.(?:[0-9]{2}[1-9]|[0-9][1-9][0-9]|[1-9][0-9]{2})s$. Because the two alternatives were not grouped, ^ anchored only the first and $ only the second, so values like 5sGARBAGE or GARBAGE1.500s passed validation and only failed at the API.

All three now share one grouped pattern with the same accepted set: whole seconds, or exactly three decimals that are not all zero. That is the form the API returns durations in, so values like 0.1s or 1.000s stay rejected to avoid state drift.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@mittalpk
mittalpk requested a review from a team as a code owner October 24, 2026 11:53
@Manuelvaas

Copy link
Copy Markdown
Contributor

Hi @mittalpk,
thank you for your contribution. Have you tested if it works with the service API (e.g., through the ACC tests)? It was initially implemented that way to avoid a state drift in Terraform.

@mittalpk mittalpk changed the title fix(alb): accept all documented health check durations fix(alb): anchor health check duration validators Oct 29, 2026
@mittalpk

Copy link
Copy Markdown
Author

Good point, I couldn't run the ACC tests (no STACKIT account) and missed that the pattern matches the API's canonical duration format, so 0.1s or 1.000s would come back as 0.100s/1s and drift. I've reverted to the original accepted set and kept only the grouping fix, so 5sGARBAGE and similar no longer pass validation.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants