Skip to content

Commit 1d7c211

Browse files
committed
document comma-separated behavior, trim hostnames
Signed-off-by: Travis Glenn Hansen <[email protected]>
1 parent 3451855 commit 1d7c211

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ powerful setups/combinations.
125125

126126
### pfsense-dns-services
127127
`pfsense-dns-services` watches for services of type `LoadBalancer` that have the annotation `dns.pfsense.org/hostname`
128-
with the value of the desired hostname. `kpc` will create the DNS entry in unbound/dnsmasq. Note that to actually get
129-
an IP on these services you'll likely need `MetalLB` deployed in the cluster (regardless of the `metallb` plugin running
130-
or not).
128+
with the value of the desired hostname (optionally you may specifiy a comma-separated list of hostnames). `kpc` will
129+
create the DNS entry in unbound/dnsmasq. Note that to actually get an IP on these services you'll likely need
130+
`MetalLB` deployed in the cluster (regardless of the `metallb` plugin running or not).
131131

132132
```yaml
133133
pfsense-dns-services:

src/KubernetesPfSenseController/Plugin/KubernetesUtils.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ public static function getServiceHostname($service)
228228
{
229229
foreach ($service['metadata']['annotations'] as $key => $value) {
230230
if ($key == self::SERVICE_HOSTNAME_ANNOTATION) {
231-
return explode(",", $value);
231+
$hosts = explode(",", $value);
232+
array_walk($hosts, function(&$host){
233+
$host = trim($host);
234+
});
235+
return $hosts;
232236
}
233237
}
234238
}

0 commit comments

Comments
 (0)