Skip to content

Commit 0ad99f1

Browse files
committed
deprecation notices
Signed-off-by: Travis Glenn Hansen <[email protected]>
1 parent b0810e9 commit 0ad99f1

File tree

10 files changed

+43
-36
lines changed

10 files changed

+43
-36
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.11
2+
3+
Released 2023-01-24
4+
5+
- cleanup deprecation notices
6+
17
# v0.5.10
28

39
Released 2023-01-24

composer.lock

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/KubernetesPfSenseController/Plugin/CommonTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private function getNodeWatchCallback($stateKey, $options = [])
5757
$oldNodeIp = KubernetesUtils::getNodeIp($oldNode);
5858

5959
if ($oldNodeIp != $nodeIp) {
60-
$this->log("NodeIP Address Changed - NewIp: ${nodeIp}, OldIP: ${oldNodeIp}");
60+
$this->log("NodeIP Address Changed - NewIp: {$nodeIp}, OldIP: {$oldNodeIp}");
6161
if ($trigger) {
6262
$this->delayedAction();
6363
}

src/KubernetesPfSenseController/Plugin/DNSHAProxyIngressProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function init()
4848

4949
$storeNamespace = $controller->getStoreNamespace();
5050
$storeName = $controller->getStoreName();
51-
$configMapResourceWatchPath = "/api/v1/watch/namespaces/${storeNamespace}/configmaps/${storeName}";
51+
$configMapResourceWatchPath = "/api/v1/watch/namespaces/{$storeNamespace}/configmaps/{$storeName}";
5252

5353
// initial load of ingresses
5454
$params = [];

src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function doAction()
3636
$managedHostsPreSave = [];
3737
foreach ($resourceHosts as $hostName => $struct) {
3838
$ip = $struct['ip'];
39-
$this->log("setting hostname entry: Host - ${hostName}, IP - ${ip}");
39+
$this->log("setting hostname entry: Host - {$hostName}, IP - {$ip}");
4040
$managedHostsPreSave[$hostName] = [
4141
'resource' => $this->getKubernetesResourceDetails($struct['resource']),
4242
];
@@ -61,7 +61,7 @@ public function doAction()
6161
// actually remove them from config
6262
$toDeleteHosts = array_diff(@array_keys($managedHosts), @array_keys($managedHostsPreSave));
6363
foreach ($toDeleteHosts as $hostName) {
64-
$this->log("deleting hostname entry for host: ${hostName}");
64+
$this->log("deleting hostname entry for host: {$hostName}");
6565
}
6666

6767
$dnsmasqConfig = null;

src/KubernetesPfSenseController/Plugin/HAProxyDeclarative.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private function expandResource($resource, $kubernetesResource)
192192
$serviceName = $resource['serviceName'];
193193
$servicePort = $resource['servicePort'];
194194

195-
$service = $controller->getKubernetesClient()->request("/api/v1/namespaces/${serviceNamespace}/services/${serviceName}");
195+
$service = $controller->getKubernetesClient()->request("/api/v1/namespaces/{$serviceNamespace}/services/{$serviceName}");
196196

197197
$hosts = [];
198198
// if service does not exist this is NULL

src/KubernetesPfSenseController/Plugin/HAProxyIngressProxy.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,22 +198,22 @@ public function doAction()
198198
// move along
199199
break;
200200
default:
201-
$this->log("WARN haproxy frontend ${sharedFrontendName} has unsupported type: ".$sharedFrontend['type']);
201+
$this->log("WARN haproxy frontend {$sharedFrontendName} has unsupported type: ".$sharedFrontend['type']);
202202
continue 2;
203203
}
204204

205205
if (!$haProxyConfig->frontendExists($sharedFrontendName)) {
206206
if (!in_array($sharedFrontendName, $frontendWarning)) {
207207
//$frontendWarning[] = $sharedFrontendName;
208-
$this->log("Frontend ${sharedFrontendName} must exist: ${frontendName}");
208+
$this->log("Frontend {$sharedFrontendName} must exist: {$frontendName}");
209209
}
210210
continue;
211211
}
212212

213213
if (!$haProxyConfig->backendExists($backendName)) {
214214
if (!in_array($backendName, $backendWarning)) {
215215
//$backendWarning[] = $backendName;
216-
$this->log("Backend ${backendName} must exist: $frontendName");
216+
$this->log("Backend {$backendName} must exist: {$frontendName}");
217217
}
218218
continue;
219219
}
@@ -231,7 +231,7 @@ public function doAction()
231231
foreach ($item['spec']['rules'] as $ruleKey => $rule) {
232232
$aclName = $frontend['name'].'-rule-'.$ruleKey;
233233
$host = $rule['host'] ?? '';
234-
//$host = "*.${host}"; // for testing purposes only
234+
//$host = "*.{$host}"; // for testing purposes only
235235
//$host = ""; // for testing purposes only
236236
if (!$this->shouldCreateRule($rule)) {
237237
continue;
@@ -280,7 +280,7 @@ public function doAction()
280280
/**
281281
* Matches the URL path exactly and with case sensitivity.
282282
*/
283-
$pathACL = "path -m str ${path}";
283+
$pathACL = "path -m str {$path}";
284284
break;
285285
case "Prefix":
286286
/**
@@ -289,24 +289,24 @@ public function doAction()
289289
* A path element refers to the list of labels in the path split by the / separator.
290290
* A request is a match for path p if every p is an element-wise prefix of p of the request path.
291291
*/
292-
$pathACL = "path -m beg ${path}";
292+
$pathACL = "path -m beg {$path}";
293293
break;
294294
case "ImplementationSpecific":
295295
/**
296296
* With this path type, matching is up to the IngressClass.
297297
* Implementations can treat this as a separate pathType or treat it identically to Prefix or Exact path types.
298298
*/
299-
$pathACL = "path -m beg ${path}";
299+
$pathACL = "path -m beg {$path}";
300300
break;
301301
default:
302-
$pathACL = "path -m beg ${path}";
302+
$pathACL = "path -m beg {$path}";
303303
break;
304304
}
305305

306306
if (empty($host)) {
307307
$hostACL = "";
308308
}
309-
$acl['value'] = trim("${hostACL} ${pathACL}");
309+
$acl['value'] = trim("{$hostACL} {$pathACL}");
310310
$frontend['ha_acls']['item'][] = $acl;
311311
break;
312312
case "https":
@@ -321,20 +321,20 @@ public function doAction()
321321
// sni should never have the port on the end as the host header may have
322322
$hostACL = "req_ssl_sni -m reg -i ^[^\.]+".str_replace([".", "-"], ["\.", "\-"], substr($host, 1));
323323
} else {
324-
$hostACL = "req_ssl_sni -m str -i ${host}"; // exact match case-insensitive
324+
$hostACL = "req_ssl_sni -m str -i {$host}"; // exact match case-insensitive
325325
}
326326

327327
if (empty($host)) {
328328
$hostACL = "";
329-
$this->log("WARN cannot create rule for ${frontendName} because host is required for parent frontends of type: ".$sharedFrontend['type']);
329+
$this->log("WARN cannot create rule for {$frontendName} because host is required for parent frontends of type: ".$sharedFrontend['type']);
330330
continue 3;
331331
}
332-
$acl['value'] = trim("${hostACL}");
332+
$acl['value'] = trim("{$hostACL}");
333333
$frontend['ha_acls']['item'][] = $acl;
334334
break;
335335
default:
336336
// should never get here based on checks above, but just in case
337-
$this->log("WARN haproxy frontend ${sharedFrontendName} has unsupported type: ".$sharedFrontend['type']);
337+
$this->log("WARN haproxy frontend {$sharedFrontendName} has unsupported type: ".$sharedFrontend['type']);
338338
continue 3;
339339
break;
340340
}
@@ -398,7 +398,7 @@ public function doAction()
398398
// actually remove them from config
399399
$toDeleteFrontends = array_diff($managedFrontendNames, $managedFrontendNamesPreSave);
400400
foreach ($toDeleteFrontends as $frontendName) {
401-
$this->log("removing frontend no longer needed: ${frontendName}");
401+
$this->log("removing frontend no longer needed: {$frontendName}");
402402
$haProxyConfig->removeFrontend($frontendName);
403403
}
404404

src/KubernetesPfSenseController/Plugin/MetalLB.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function init()
3232
$configMapName = explode("/", $configMap)[1];
3333

3434
// metallb config
35-
$watch = $controller->getKubernetesClient()->createWatch("/api/v1/watch/namespaces/${configMapNamespace}/configmaps/${configMapName}", [], $this->getMetalLbConfigWatchCallback());
35+
$watch = $controller->getKubernetesClient()->createWatch("/api/v1/watch/namespaces/{$configMapNamespace}/configmaps/{$configMapName}", [], $this->getMetalLbConfigWatchCallback());
3636
$this->addWatch($watch);
3737

3838
// initial load of nodes

src/KubernetesPfSenseController/Plugin/PfSenseAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function savePfSenseConfigBlock(PfSenseConfigBlock $config)
2222
$config->save();
2323
} catch (\Exception $e) {
2424
$sectionName = $config->getSectionName();
25-
$this->log("failed saving ${sectionName} config: ".$e->getMessage().' ('.$e->getCode().')');
25+
$this->log("failed saving {$sectionName} config: ".$e->getMessage().' ('.$e->getCode().')');
2626
throw $e;
2727
}
2828
}

src/KubernetesPfSenseController/Plugin/PfSenseConfigBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function save()
164164

165165
$response = $this->client->call($method, $params);
166166
if ($response !== true) {
167-
throw new \Exception("failed xmlrpc ${method} call");
167+
throw new \Exception("failed xmlrpc {$method} call");
168168
}
169169
} catch (\Exception $e) {
170170
throw $e;

0 commit comments

Comments
 (0)