Skip to content

Commit

Permalink
better template handling
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
  • Loading branch information
travisghansen committed Apr 15, 2023
1 parent c4fe096 commit 6a51285
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.5.14

Released 2023-04-15

- more robust handling of the shared frontend templates

# v0.5.13

Released 2023-02-23
Expand Down
18 changes: 16 additions & 2 deletions src/KubernetesPfSenseController/Plugin/HAProxyIngressProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,22 @@ public function doAction()
$frontend['status'] = 'active';
$frontend['secondary'] = 'yes';
$frontend['primary_frontend'] = $primaryFrontendName;
$frontend['ha_acls'] = ['item' => []];
$frontend['a_actionitems'] = ['item' => []];

// acls
if (!is_array($frontend['ha_acls'])) {
$frontend['ha_acls'] = ['item' => []];
}
if (!is_array(($frontend['ha_acls']['item']))) {
$frontend['ha_acls']['item'] = [];
}

// actions
if (!is_array($frontend['a_actionitems'])) {
$frontend['a_actionitems'] = ['item' => []];
}
if (!is_array($frontend['a_actionitems']['item'])) {
$frontend['a_actionitems']['item'] = [];
}

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

0 comments on commit 6a51285

Please sign in to comment.