travisghansen / kubernetes-pfsense-controller

Integrate Kubernetes and pfSense
Apache License 2.0
197 stars 22 forks source link

PHP Fatal error: Uncaught Error: Only variables can be passed by reference in ... DNSResourceTrait.php:75 #12

Closed dspereira-avlino closed 3 years ago

dspereira-avlino commented 3 years ago

Hello Travis,

I'm trying to set this up but unfortunately, I'm getting the following error:

2021-02-09T17:56:40+00:00 store successfully initialized 2021-02-09T17:56:41+00:00 controller config loaded/updated 2021-02-09T17:56:41+00:00 loading plugin pfsense-dns-ingresses 2021-02-09T17:56:41+00:00 loading plugin pfsense-dns-services PHP Warning: Illegal string offset 'hosts' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php on line 71 PHP Warning: Illegal string offset 'hosts' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php on line 72 2021-02-09T17:56:58+00:00 plugin (pfsense-dns-services): successfully reloaded dnsmasq service 2021-02-09T17:57:07+00:00 plugin (pfsense-dns-services): successfully reloaded unbound service 2021-02-09T17:57:09+00:00 plugin (pfsense-dns-services): successfully reloaded DHCP service 2021-02-09T17:57:10+00:00 plugin (pfsense-dns-ingresses): setting hostname entry: Host - vsphere-cluster.xxxxxx.dc, IP - 172.16.1.251 PHP Warning: Illegal string offset 'hosts' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php on line 71 PHP Warning: Illegal string offset 'hosts' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php on line 72 PHP Warning: Illegal string offset 'hosts' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php on line 75 PHP Fatal error: Uncaught Error: Only variables can be passed by reference in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php:75 Stack trace:

0 phar:///usr/local/bin/kubernetes-pfsense-controller/vendor/travisghansen/kubernetes-controller-php/src/KubernetesController/Plugin/AbstractPlugin.php(108): KubernetesPfSenseController\Plugin\DNSIngresses->doAction()

1 phar:///usr/local/bin/kubernetes-pfsense-controller/vendor/travisghansen/kubernetes-controller-php/src/KubernetesController/Controller.php(525): KubernetesController\Plugin\AbstractPlugin->invokeAction()

2 phar:///usr/local/bin/kubernetes-pfsense-controller/controller.php(87): KubernetesController\Controller->main()

3 /usr/local/bin/kubernetes-pfsense-controller(2): include('phar:///usr/loc...')

4 {main}

thrown in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php on line 75 stream closed

This is happening with the following:

Also, the config is the following (I'm using the helm chart and just omitting the "pfsense" part here):

config:
  controller-id: "vsphere-cluster"
  enabled: true
  plugins:
    pfsense-dns-services:
      enabled: true
      serviceLabelSelector:
      serviceFieldSelector:
      #allowedHostRegex: "/.*/"
      dnsBackends:
        dnsmasq:
          enabled: true
        unbound:
          enabled: true
    pfsense-dns-ingresses:
      enabled: true
      ingressLabelSelector:
      ingressFieldSelector:
      # works in conjunction with the ingress annotation 'dns.pfsense.org/enabled'
      # if defaultEnabled is empty or true, you can disable specific ingresses by setting the annotation to false
      # if defaultEnabled is false, you can enable specific ingresses by setting the annotation to true
      defaultEnabled: true
      #allowedHostRegex: "/.*/"
      dnsBackends:
        dnsmasq:
          enabled: true
        unbound:
          enabled: true

Any ideas of what could be the problem?

Thanks,

travisghansen commented 3 years ago

Are you currently running dnsmasq or unbound?

dspereira-avlino commented 3 years ago

I'm currently running DNS Resolver/unbound

travisghansen commented 3 years ago

Let’s start by setting enabled to false beneath both dnsmasq entries.

dspereira-avlino commented 3 years ago

Yes, you were (obviously) right, I should have checked that better instead of blindlessly copying the config. Everything is working as expected now...

Thanks for the reply and for this awesome project!

travisghansen commented 3 years ago

Great! Glad it's working!