Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

Each revision is versioned by the date of the revision.

## 2026-03-23

- Fixed hosts validation in haproxy-route and haproxy-route-tcp relation libraries.

## 2026-01-19

- Fixed issues with the DDoS protection configurator charm found in staging.
Expand Down
13 changes: 13 additions & 0 deletions docs/release-notes/artifacts/pr0383.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version_schema: 2
changes:
- title: Fix hosts validation in haproxy-route-tcp, and haproxy-route relation libraries
author: skatsaounis
type: bugfix
description: >
Fixed hosts validation in the haproxy-route-tcp and haproxy-route relation libraries, ensuring
that only valid IP addresses are accepted.
urls:
pr:
- https://github.com/canonical/haproxy-operator/pull/383
visibility: public
highlight: false
10 changes: 5 additions & 5 deletions haproxy-operator/lib/charms/haproxy/v1/haproxy_route_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _on_haproxy_route_data_available(self, event: EventBase) -> None:

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 1
LIBPATCH = 2

logger = logging.getLogger(__name__)
HAPROXY_ROUTE_TCP_RELATION_NAME = "haproxy-route-tcp"
Expand Down Expand Up @@ -976,7 +976,7 @@ def __init__(
*,
port: Optional[int] = None,
backend_port: Optional[int] = None,
hosts: Optional[list[str]] = None,
hosts: Optional[list[IPvAnyAddress]] = None,
sni: Optional[str] = None,
check_interval: Optional[int] = None,
check_rise: Optional[int] = None,
Expand Down Expand Up @@ -1102,7 +1102,7 @@ def provide_haproxy_route_tcp_requirements(
*,
port: int,
backend_port: Optional[int] = None,
hosts: Optional[list[str]] = None,
hosts: Optional[list[IPvAnyAddress]] = None,
sni: Optional[str] = None,
check_interval: Optional[int] = None,
check_rise: Optional[int] = None,
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def _generate_application_data(
*,
port: Optional[int] = None,
backend_port: Optional[int] = None,
hosts: Optional[list[str]] = None,
hosts: Optional[list[IPvAnyAddress]] = None,
sni: Optional[str] = None,
check_interval: Optional[int] = None,
check_rise: Optional[int] = None,
Expand Down Expand Up @@ -1558,7 +1558,7 @@ def configure_backend_port(self, backend_port: int) -> "Self":
self._application_data["backend_port"] = backend_port
return self

def configure_hosts(self, hosts: Optional[list[int]] = None) -> "Self":
def configure_hosts(self, hosts: Optional[list[IPvAnyAddress]] = None) -> "Self":
"""Set backend hosts.

Args:
Expand Down
8 changes: 4 additions & 4 deletions haproxy-operator/lib/charms/haproxy/v2/haproxy_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _on_haproxy_route_data_available(self, event: EventBase) -> None:

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 0
LIBPATCH = 1

logger = logging.getLogger(__name__)
HAPROXY_ROUTE_RELATION_NAME = "haproxy-route"
Expand Down Expand Up @@ -1005,7 +1005,7 @@ def __init__(
service: Optional[str] = None,
ports: Optional[list[int]] = None,
protocol: Literal["http", "https"] = "http",
hosts: Optional[list[str]] = None,
hosts: Optional[list[IPvAnyAddress]] = None,
paths: Optional[list[str]] = None,
hostname: Optional[str] = None,
additional_hostnames: Optional[list[str]] = None,
Expand Down Expand Up @@ -1144,7 +1144,7 @@ def provide_haproxy_route_requirements(
service: str,
ports: list[int],
protocol: Literal["http", "https"] = "http",
hosts: Optional[list[str]] = None,
hosts: Optional[list[IPvAnyAddress]] = None,
paths: Optional[list[str]] = None,
hostname: Optional[str] = None,
additional_hostnames: Optional[list[str]] = None,
Expand Down Expand Up @@ -1258,7 +1258,7 @@ def _generate_application_data( # noqa: C901
service: Optional[str] = None,
ports: Optional[list[int]] = None,
protocol: Literal["http", "https"] = "http",
hosts: Optional[list[str]] = None,
hosts: Optional[list[IPvAnyAddress]] = None,
paths: Optional[list[str]] = None,
hostname: Optional[str] = None,
additional_hostnames: Optional[list[str]] = None,
Expand Down
Loading