Skip to content

Commit 42e1a40

Browse files
Merge pull request #23 from valtzu/master
Fix php warning on ingress without host
2 parents 37ce26c + 0b086bf commit 42e1a40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/KubernetesPfSenseController/Plugin/HAProxyIngressProxy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function doAction()
230230

231231
foreach ($item['spec']['rules'] as $ruleKey => $rule) {
232232
$aclName = $frontend['name'].'-rule-'.$ruleKey;
233-
$host = $rule['host'];
233+
$host = $rule['host'] ?? '';
234234
//$host = "*.${host}"; // for testing purposes only
235235
//$host = ""; // for testing purposes only
236236
if (!$this->shouldCreateRule($rule)) {
@@ -425,7 +425,7 @@ public function doAction()
425425
*/
426426
private function shouldCreateRule($rule)
427427
{
428-
$hostName = $rule['host'];
428+
$hostName = $rule['host'] ?? '';
429429
$pluginConfig = $this->getConfig();
430430
if (!empty($pluginConfig['allowedHostRegex'])) {
431431
$allowed = @preg_match($pluginConfig['allowedHostRegex'], $hostName);

0 commit comments

Comments
 (0)