Skip to content

Commit 6a51285

Browse files
committed
better template handling
Signed-off-by: Travis Glenn Hansen <[email protected]>
1 parent c4fe096 commit 6a51285

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v0.5.14
2+
3+
Released 2023-04-15
4+
5+
- more robust handling of the shared frontend templates
6+
17
# v0.5.13
28

39
Released 2023-02-23

src/KubernetesPfSenseController/Plugin/HAProxyIngressProxy.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,22 @@ public function doAction()
243243
$frontend['status'] = 'active';
244244
$frontend['secondary'] = 'yes';
245245
$frontend['primary_frontend'] = $primaryFrontendName;
246-
$frontend['ha_acls'] = ['item' => []];
247-
$frontend['a_actionitems'] = ['item' => []];
246+
247+
// acls
248+
if (!is_array($frontend['ha_acls'])) {
249+
$frontend['ha_acls'] = ['item' => []];
250+
}
251+
if (!is_array(($frontend['ha_acls']['item']))) {
252+
$frontend['ha_acls']['item'] = [];
253+
}
254+
255+
// actions
256+
if (!is_array($frontend['a_actionitems'])) {
257+
$frontend['a_actionitems'] = ['item' => []];
258+
}
259+
if (!is_array($frontend['a_actionitems']['item'])) {
260+
$frontend['a_actionitems']['item'] = [];
261+
}
248262

249263
foreach ($item['spec']['rules'] as $ruleKey => $rule) {
250264
$aclName = $frontend['name'] . '-rule-' . $ruleKey;

0 commit comments

Comments
 (0)