Compare commits
110 Commits
37-optimiz
...
v0.0.3
| Author | SHA1 | Date | |
|---|---|---|---|
| a99de02594 | |||
| 893318ad53 | |||
| 201edb1b82 | |||
| b1c0a4ee11 | |||
| 13677136a7 | |||
| cb296c3881 | |||
| 3c6b48803d | |||
| f71fa2af8e | |||
| 1819ef2b60 | |||
| 74d7ca84a5 | |||
| 0f7ffe3c85 | |||
| 3020510c6f | |||
| 475e226b69 | |||
| a5521013b9 | |||
| 4aa3436f28 | |||
| 6e32555e9e | |||
| 13c23863be | |||
| 918b45c940 | |||
| 3cb65a5a14 | |||
| 4ae70ecf74 | |||
| 3aa4d1a24a | |||
| 1231bc50e5 | |||
| e1847f4cf9 | |||
| 55a206d509 | |||
| 00179595e4 | |||
| f09e008fb7 | |||
| 14a8155dcf | |||
| 93ef66f01d | |||
| 80746321a9 | |||
| 6423ef7d6e | |||
| fdefd05608 | |||
| 760fd3903f | |||
| cda1c7ddff | |||
| 1274fe610f | |||
| f091ec148b | |||
| 66e1d854d3 | |||
| f43c1f3b63 | |||
| 0046157633 | |||
| 56a781a260 | |||
| 29fb9601fd | |||
| c34eea5e13 | |||
| fe90ac7ea4 | |||
| 31679a3f53 | |||
| de38c76e24 | |||
| 2a396ad981 | |||
| f147ec8108 | |||
| b6a2b73eb8 | |||
| 2304e33586 | |||
| a40f1342fe | |||
| bd8d1f7c01 | |||
| ac47c880ed | |||
| 481091160b | |||
| 14e4fe1c46 | |||
| 4901dfbad5 | |||
| c454c78478 | |||
| c30e27efc4 | |||
| f2a943de3c | |||
| 720865c984 | |||
| 913a24a613 | |||
| 719ba853bc | |||
| 4e26fe02f5 | |||
| cd61d5c82a | |||
| 6983253c9e | |||
| 1d7c7c864e | |||
| 1a2def25bf | |||
| 6c8503bf15 | |||
| b9b86e0d5d | |||
| 2c9659409c | |||
| 20c4dda5ad | |||
| bb28850ca5 | |||
| f08c165628 | |||
| 46e6217557 | |||
| 36f337434d | |||
| 3f14d82679 | |||
| 2817272082 | |||
| 1545f05d53 | |||
| 47116c70b5 | |||
| 0eb5b5c2eb | |||
| 7e6573deb4 | |||
| e22a4c4992 | |||
| 401f4a7cf7 | |||
| 68e8782da4 | |||
| e95a4c13e6 | |||
| d82d7d2902 | |||
| 3091c89fa8 | |||
| 853fca1635 | |||
| 07208979e3 | |||
| c86196aa88 | |||
| a35bc7220d | |||
| 446fb89d00 | |||
| 4bf3adaf87 | |||
| d7f2d8031e | |||
| 604cc20505 | |||
| 572521747f | |||
| acea7fd46e | |||
| 634021854d | |||
| 1e0a51f83b | |||
| cab7bc2f5a | |||
| cef43b9c3e | |||
| 019a33a69a | |||
| c2ff504510 | |||
| 55ef068855 | |||
| babbf2ed97 | |||
| 8765a94893 | |||
| 54ade7cc49 | |||
| bf666f0a89 | |||
| b59fc563f3 | |||
| b444690400 | |||
| bcf73d64bf | |||
| d372e4c7a7 |
24
.gitea/workflows/build.yaml
Normal file
24
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Build project
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: golang:1.24
|
||||||
|
steps:
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
ssh-keyscan gitea-ssh.engen.priv.no >> ~/.ssh/known_hosts
|
||||||
|
- name: Install node and go
|
||||||
|
run: apt update && apt -y install nodejs
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: ssh repo
|
||||||
|
run: git config --global url.git@gitea-ssh.engen.priv.no:.insteadOf https://gitea.engen.priv.no/
|
||||||
|
- name: Build
|
||||||
|
run: go build cmd/main.go
|
||||||
26
.gitea/workflows/kobuild.yaml
Normal file
26
.gitea/workflows/kobuild.yaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Publish
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: golang:1.24
|
||||||
|
steps:
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
ssh-keyscan gitea-ssh.engen.priv.no >> ~/.ssh/known_hosts
|
||||||
|
- name: Install node and go
|
||||||
|
run: apt update && apt -y install nodejs
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: ssh repo
|
||||||
|
run: git config --global url.git@gitea-ssh.engen.priv.no:.insteadOf https://gitea.engen.priv.no/
|
||||||
|
- name: Install ko
|
||||||
|
run: go install github.com/google/ko@latest
|
||||||
|
- name: Build
|
||||||
|
run: KO_DOCKER_REPO=gitea.engen.priv.no/unifi-network-operator-controller PATH=~/go/bin:$PATH ko build --local ./cmd
|
||||||
40
.gitea/workflows/publish.yaml
Normal file
40
.gitea/workflows/publish.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Publish
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: golang:1.24-bookworm
|
||||||
|
env:
|
||||||
|
GITEA_USER: ${{ secrets.GITEAUSER }}
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
||||||
|
GITEA_REGISTRY: gitea.engen.priv.no
|
||||||
|
GITEA_ORG: klauvsteinen
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: apt update && apt -y install nodejs bash docker.io
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
ssh-keyscan gitea-ssh.engen.priv.no >> ~/.ssh/known_hosts
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: ssh repo
|
||||||
|
run: git config --global url.git@gitea-ssh.engen.priv.no:.insteadOf https://gitea.engen.priv.no/
|
||||||
|
- name: Install ko
|
||||||
|
run: go install github.com/google/ko@latest
|
||||||
|
- name: Extract tag (outside container)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
env
|
||||||
|
- name: Docker login
|
||||||
|
run: echo "${GITEA_TOKEN}" | docker login "${GITEA_REGISTRY}" --username "${GITEA_USER}" --password-stdin
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
export KO_DOCKER_REPO="${GITEA_REGISTRY}/${GITEA_ORG}/unifi-network-operator-controller"
|
||||||
|
ko publish ./cmd --tags "$TAG,latest" --bare
|
||||||
@@ -39,10 +39,10 @@ import (
|
|||||||
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
|
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/config"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/config"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/controller"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/controller"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/unifi"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/unifi"
|
||||||
// +kubebuilder:scaffold:imports
|
// +kubebuilder:scaffold:imports
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
952
dist/install.yaml
vendored
Normal file
952
dist/install.yaml
vendored
Normal file
@@ -0,0 +1,952 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
control-plane: controller-manager
|
||||||
|
name: unifi-network-operator-system
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
|
name: firewallpolicies.unifi.engen.priv.no
|
||||||
|
spec:
|
||||||
|
group: unifi.engen.priv.no
|
||||||
|
names:
|
||||||
|
kind: FirewallPolicy
|
||||||
|
listKind: FirewallPolicyList
|
||||||
|
plural: firewallpolicies
|
||||||
|
singular: firewallpolicy
|
||||||
|
scope: Namespaced
|
||||||
|
versions:
|
||||||
|
- name: v1beta1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: FirewallPolicy is the Schema for the firewallpolicies API.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: |-
|
||||||
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: |-
|
||||||
|
Kind is a string value representing the REST resource this object represents.
|
||||||
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
properties:
|
||||||
|
destination:
|
||||||
|
properties:
|
||||||
|
firewall_groups:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
services:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
match_firewall_groups_in_all_namespaces:
|
||||||
|
type: boolean
|
||||||
|
match_services_in_all_namespaces:
|
||||||
|
type: boolean
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
source:
|
||||||
|
properties:
|
||||||
|
from_networks:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
from_zones:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- destination
|
||||||
|
- name
|
||||||
|
- source
|
||||||
|
type: object
|
||||||
|
status:
|
||||||
|
description: FirewallPolicyStatus defines the observed state of FirewallPolicy.
|
||||||
|
properties:
|
||||||
|
resources_managed:
|
||||||
|
properties:
|
||||||
|
firewall_groups_managed:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
firewall_policies_managed:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
from:
|
||||||
|
type: string
|
||||||
|
tcpipv4_id:
|
||||||
|
type: string
|
||||||
|
tcpipv6_id:
|
||||||
|
type: string
|
||||||
|
to:
|
||||||
|
type: string
|
||||||
|
udpipv4_id:
|
||||||
|
type: string
|
||||||
|
udpipv6_id:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- from
|
||||||
|
- tcpipv4_id
|
||||||
|
- tcpipv6_id
|
||||||
|
- to
|
||||||
|
- udpipv4_id
|
||||||
|
- udpipv6_id
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
|
name: firewallzones.unifi.engen.priv.no
|
||||||
|
spec:
|
||||||
|
group: unifi.engen.priv.no
|
||||||
|
names:
|
||||||
|
kind: FirewallZone
|
||||||
|
listKind: FirewallZoneList
|
||||||
|
plural: firewallzones
|
||||||
|
singular: firewallzone
|
||||||
|
scope: Namespaced
|
||||||
|
versions:
|
||||||
|
- name: v1beta1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: FirewallZone is the Schema for the firewallzones API.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: |-
|
||||||
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: |-
|
||||||
|
Kind is a string value representing the REST resource this object represents.
|
||||||
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
description: FirewallZoneSpec defines the desired state of FirewallZone.
|
||||||
|
properties:
|
||||||
|
_id:
|
||||||
|
type: string
|
||||||
|
default_zone:
|
||||||
|
type: boolean
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
network_ids:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
zone_key:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
status:
|
||||||
|
description: FirewallZoneStatus defines the observed state of FirewallZone.
|
||||||
|
properties:
|
||||||
|
resources_managed:
|
||||||
|
properties:
|
||||||
|
firewall_zones_managed:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
|
name: networkconfigurations.unifi.engen.priv.no
|
||||||
|
spec:
|
||||||
|
group: unifi.engen.priv.no
|
||||||
|
names:
|
||||||
|
kind: Networkconfiguration
|
||||||
|
listKind: NetworkconfigurationList
|
||||||
|
plural: networkconfigurations
|
||||||
|
singular: networkconfiguration
|
||||||
|
scope: Namespaced
|
||||||
|
versions:
|
||||||
|
- name: v1beta1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: Networkconfiguration is the Schema for the networkconfigurations
|
||||||
|
API.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: |-
|
||||||
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: |-
|
||||||
|
Kind is a string value representing the REST resource this object represents.
|
||||||
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
description: NetworkconfigurationSpec defines the desired state of Networkconfiguration.
|
||||||
|
properties:
|
||||||
|
_id:
|
||||||
|
description: Foo is an example field of Networkconfiguration. Edit
|
||||||
|
networkconfiguration_types.go to remove/update
|
||||||
|
type: string
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
firewall_zone:
|
||||||
|
type: string
|
||||||
|
gateway_type:
|
||||||
|
type: string
|
||||||
|
ip_subnet:
|
||||||
|
type: string
|
||||||
|
ipv6_interface_type:
|
||||||
|
type: string
|
||||||
|
ipv6_pd_auto_prefixid_enabled:
|
||||||
|
type: boolean
|
||||||
|
ipv6_ra_enabled:
|
||||||
|
type: boolean
|
||||||
|
ipv6_setting_preference:
|
||||||
|
type: string
|
||||||
|
ipv6_subnet:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
networkgroup:
|
||||||
|
type: string
|
||||||
|
purpose:
|
||||||
|
type: string
|
||||||
|
setting_preference:
|
||||||
|
type: string
|
||||||
|
vlan:
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
vlan_enabled:
|
||||||
|
type: boolean
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
status:
|
||||||
|
description: NetworkconfigurationStatus defines the observed state of
|
||||||
|
Networkconfiguration.
|
||||||
|
properties:
|
||||||
|
firewall_zone_id:
|
||||||
|
description: |-
|
||||||
|
INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||||
|
Important: Run "make" to regenerate code after modifying this file
|
||||||
|
type: string
|
||||||
|
ipv6_subnet_status:
|
||||||
|
type: string
|
||||||
|
lastSyncTime:
|
||||||
|
description: LastSyncTime is the last time the object was synced
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
resources_managed:
|
||||||
|
properties:
|
||||||
|
networks_managed:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
syncedWithUnifi:
|
||||||
|
description: SyncedWithUnifi indicates whether the addresses are successfully
|
||||||
|
pushed
|
||||||
|
type: boolean
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
|
name: portforwards.unifi.engen.priv.no
|
||||||
|
spec:
|
||||||
|
group: unifi.engen.priv.no
|
||||||
|
names:
|
||||||
|
kind: PortForward
|
||||||
|
listKind: PortForwardList
|
||||||
|
plural: portforwards
|
||||||
|
singular: portforward
|
||||||
|
scope: Namespaced
|
||||||
|
versions:
|
||||||
|
- name: v1beta1
|
||||||
|
schema:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: |-
|
||||||
|
PortForward is a placeholder type to allow future CRD support if needed.
|
||||||
|
Right now, port forwards are managed entirely through annotations on Services.
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
description: |-
|
||||||
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
|
type: string
|
||||||
|
kind:
|
||||||
|
description: |-
|
||||||
|
Kind is a string value representing the REST resource this object represents.
|
||||||
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
type: object
|
||||||
|
status:
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-controller-manager
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-leader-election-role
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- configmaps
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- create
|
||||||
|
- update
|
||||||
|
- patch
|
||||||
|
- delete
|
||||||
|
- apiGroups:
|
||||||
|
- coordination.k8s.io
|
||||||
|
resources:
|
||||||
|
- leases
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- create
|
||||||
|
- update
|
||||||
|
- patch
|
||||||
|
- delete
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- patch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-firewallpolicy-admin-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallpolicies
|
||||||
|
verbs:
|
||||||
|
- '*'
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallpolicies/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-firewallpolicy-editor-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallpolicies
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallpolicies/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-firewallpolicy-viewer-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallpolicies
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallpolicies/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-firewallzone-admin-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallzones
|
||||||
|
verbs:
|
||||||
|
- '*'
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallzones/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-firewallzone-editor-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallzones
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallzones/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-firewallzone-viewer-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallzones
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallzones/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: unifi-network-operator-manager-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- configmaps
|
||||||
|
- services
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallgroups
|
||||||
|
- firewallpolicies
|
||||||
|
- firewallzones
|
||||||
|
- networkconfigurations
|
||||||
|
- portforwards
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallgroups/finalizers
|
||||||
|
- firewallpolicies/finalizers
|
||||||
|
- firewallzones/finalizers
|
||||||
|
- networkconfigurations/finalizers
|
||||||
|
- portforwards/finalizers
|
||||||
|
verbs:
|
||||||
|
- update
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- firewallgroups/status
|
||||||
|
- firewallpolicies/status
|
||||||
|
- firewallzones/status
|
||||||
|
- networkconfigurations/status
|
||||||
|
- portforwards/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: unifi-network-operator-metrics-auth-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- authentication.k8s.io
|
||||||
|
resources:
|
||||||
|
- tokenreviews
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- apiGroups:
|
||||||
|
- authorization.k8s.io
|
||||||
|
resources:
|
||||||
|
- subjectaccessreviews
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: unifi-network-operator-metrics-reader
|
||||||
|
rules:
|
||||||
|
- nonResourceURLs:
|
||||||
|
- /metrics
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-networkconfiguration-admin-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- networkconfigurations
|
||||||
|
verbs:
|
||||||
|
- '*'
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- networkconfigurations/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-networkconfiguration-editor-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- networkconfigurations
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- networkconfigurations/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-networkconfiguration-viewer-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- networkconfigurations
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- networkconfigurations/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-portforward-admin-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- portforwards
|
||||||
|
verbs:
|
||||||
|
- '*'
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- portforwards/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-portforward-editor-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- portforwards
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- portforwards/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-portforward-viewer-role
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- portforwards
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- unifi.engen.priv.no
|
||||||
|
resources:
|
||||||
|
- portforwards/status
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-leader-election-rolebinding
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: unifi-network-operator-leader-election-role
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: unifi-network-operator-controller-manager
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
name: unifi-network-operator-manager-rolebinding
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: unifi-network-operator-manager-role
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: unifi-network-operator-controller-manager
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: unifi-network-operator-metrics-auth-rolebinding
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: unifi-network-operator-metrics-auth-role
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: unifi-network-operator-controller-manager
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
control-plane: controller-manager
|
||||||
|
name: unifi-network-operator-controller-manager-metrics-service
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: https
|
||||||
|
port: 8443
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8443
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
control-plane: controller-manager
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
control-plane: controller-manager
|
||||||
|
name: unifi-network-operator-controller-manager
|
||||||
|
namespace: unifi-network-operator-system
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
control-plane: controller-manager
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
kubectl.kubernetes.io/default-container: manager
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: unifi-network-operator
|
||||||
|
control-plane: controller-manager
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- args:
|
||||||
|
- --metrics-bind-address=:8443
|
||||||
|
- --leader-elect
|
||||||
|
- --health-probe-bind-address=:8081
|
||||||
|
env:
|
||||||
|
- name: UNIFI_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: UNIFI_URL
|
||||||
|
name: unifi-configuration
|
||||||
|
- name: UNIFI_SITE
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: UNIFI_SITE
|
||||||
|
name: unifi-configuration
|
||||||
|
- name: UNIFI_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: UNIFI_USERNAME
|
||||||
|
name: unifi-configuration
|
||||||
|
- name: UNIFI_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: UNIFI_PASSWORD
|
||||||
|
name: unifi-configuration
|
||||||
|
image: registry.engen.priv.no/unifi-network-operator-controller:latest
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: 8081
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 20
|
||||||
|
name: manager
|
||||||
|
ports: []
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /readyz
|
||||||
|
port: 8081
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 128Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 64Mi
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
volumeMounts: []
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
serviceAccountName: unifi-network-operator-controller-manager
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
volumes: []
|
||||||
5
go.mod
5
go.mod
@@ -1,15 +1,14 @@
|
|||||||
module github.com/vegardengen/unifi-network-operator
|
module gitea.engen.priv.no/klauvsteinen/unifi-network-operator
|
||||||
|
|
||||||
go 1.24.0
|
go 1.24.0
|
||||||
|
|
||||||
toolchain go1.24.1
|
toolchain go1.24.1
|
||||||
|
|
||||||
godebug default=go1.23
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/onsi/ginkgo/v2 v2.23.4
|
github.com/onsi/ginkgo/v2 v2.23.4
|
||||||
github.com/onsi/gomega v1.37.0
|
github.com/onsi/gomega v1.37.0
|
||||||
github.com/vegardengen/go-unifi v0.0.1-alpha25
|
gitea.engen.priv.no/klauvsteinen/go-unifi v0.0.1-alpha26
|
||||||
k8s.io/api v0.32.1
|
k8s.io/api v0.32.1
|
||||||
k8s.io/apimachinery v0.32.1
|
k8s.io/apimachinery v0.32.1
|
||||||
k8s.io/client-go v0.32.1
|
k8s.io/client-go v0.32.1
|
||||||
|
|||||||
2
go.sum
2
go.sum
@@ -1,5 +1,7 @@
|
|||||||
cel.dev/expr v0.23.1 h1:K4KOtPCJQjVggkARsjG9RWXP6O4R73aHeJMa/dmCQQg=
|
cel.dev/expr v0.23.1 h1:K4KOtPCJQjVggkARsjG9RWXP6O4R73aHeJMa/dmCQQg=
|
||||||
cel.dev/expr v0.23.1/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
|
cel.dev/expr v0.23.1/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
|
||||||
|
gitea.engen.priv.no/klauvsteinen/go-unifi v0.0.1-alpha26 h1:nM5XNYGPCR+6U5ypssm5iuwJrubeKwD2axLZeZXl/EQ=
|
||||||
|
gitea.engen.priv.no/klauvsteinen/go-unifi v0.0.1-alpha26/go.mod h1:0cA32wEhA7BTHHI4frsPjXFctHkJq9VZe9yrOwVlpQE=
|
||||||
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
|
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
|
||||||
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
|
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ import (
|
|||||||
"sigs.k8s.io/controller-runtime/pkg/reconcile"
|
"sigs.k8s.io/controller-runtime/pkg/reconcile"
|
||||||
// "sigs.k8s.io/controller-runtime/pkg/source"
|
// "sigs.k8s.io/controller-runtime/pkg/source"
|
||||||
|
|
||||||
goUnifi "github.com/vegardengen/go-unifi/unifi"
|
goUnifi "gitea.engen.priv.no/klauvsteinen/go-unifi/unifi"
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/config"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/config"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/unifi"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
const firewallGroupFinalizer = "finalizer.unifi.engen.priv.no/firewallgroup"
|
const firewallGroupFinalizer = "finalizer.unifi.engen.priv.no/firewallgroup"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("FirewallGroup Controller", func() {
|
var _ = Describe("FirewallGroup Controller", func() {
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ import (
|
|||||||
"sigs.k8s.io/controller-runtime/pkg/handler"
|
"sigs.k8s.io/controller-runtime/pkg/handler"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/log"
|
"sigs.k8s.io/controller-runtime/pkg/log"
|
||||||
|
|
||||||
goUnifi "github.com/vegardengen/go-unifi/unifi"
|
goUnifi "gitea.engen.priv.no/klauvsteinen/go-unifi/unifi"
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/config"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/config"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/unifi"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FirewallPolicyReconciler reconciles a FirewallPolicy object
|
// FirewallPolicyReconciler reconciles a FirewallPolicy object
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("FirewallPolicy Controller", func() {
|
var _ = Describe("FirewallPolicy Controller", func() {
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ import (
|
|||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/log"
|
"sigs.k8s.io/controller-runtime/pkg/log"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/config"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/config"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/unifi"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FirewallZoneReconciler reconciles a FirewallZone object
|
// FirewallZoneReconciler reconciles a FirewallZone object
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("FirewallZone Controller", func() {
|
var _ = Describe("FirewallZone Controller", func() {
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ import (
|
|||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/log"
|
"sigs.k8s.io/controller-runtime/pkg/log"
|
||||||
|
|
||||||
unifiv1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/config"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/config"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/unifi"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NetworkconfigurationReconciler reconciles a Networkconfiguration object
|
// NetworkconfigurationReconciler reconciles a Networkconfiguration object
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Networkconfiguration Controller", func() {
|
var _ = Describe("Networkconfiguration Controller", func() {
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ import (
|
|||||||
// "sigs.k8s.io/controller-runtime/pkg/reconcile"
|
// "sigs.k8s.io/controller-runtime/pkg/reconcile"
|
||||||
// "sigs.k8s.io/controller-runtime/pkg/source"
|
// "sigs.k8s.io/controller-runtime/pkg/source"
|
||||||
|
|
||||||
goUnifi "github.com/vegardengen/go-unifi/unifi"
|
goUnifi "gitea.engen.priv.no/klauvsteinen/go-unifi/unifi"
|
||||||
// unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
// unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/config"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/config"
|
||||||
"github.com/vegardengen/unifi-network-operator/internal/unifi"
|
"gitea.engen.priv.no/klauvsteinen/unifi-network-operator/internal/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PortForwardReconciler struct {
|
type PortForwardReconciler struct {
|
||||||
@@ -133,7 +133,7 @@ func (r *PortForwardReconciler) Reconcile(ctx context.Context, req ctrl.Request)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_, err := r.UnifiClient.Client.CreatePortForward(context.Background(), r.UnifiClient.SiteID, &goUnifi.PortForward{Name: portforwardname, PfwdInterface: "wan", Src: "any", Log: true, DestinationIPs: []goUnifi.PortForwardDestinationIPs{}, Enabled: true, Fwd: ip, DestinationIP: "any", Proto: "tcp", DstPort: fmt.Sprintf("%d", portMap[port.Name]), SiteID: r.UnifiClient.SiteID, FwdPort: fmt.Sprintf("%d", port.Port)})
|
_, err := r.UnifiClient.Client.CreatePortForward(context.Background(), r.UnifiClient.SiteID, &goUnifi.PortForward{Name: portforwardname, PfwdInterface: "wan", Src: "any", Log: false, DestinationIPs: []goUnifi.PortForwardDestinationIPs{}, Enabled: true, Fwd: ip, DestinationIP: "any", Proto: "tcp", DstPort: fmt.Sprintf("%d", portMap[port.Name]), SiteID: r.UnifiClient.SiteID, FwdPort: fmt.Sprintf("%d", port.Port)})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err, "Portforward could not be created")
|
log.Error(err, "Portforward could not be created")
|
||||||
return ctrl.Result{RequeueAfter: 10 * time.Minute}, err
|
return ctrl.Result{RequeueAfter: 10 * time.Minute}, err
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("PortForward Controller", func() {
|
var _ = Describe("PortForward Controller", func() {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import (
|
|||||||
logf "sigs.k8s.io/controller-runtime/pkg/log"
|
logf "sigs.k8s.io/controller-runtime/pkg/log"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||||
|
|
||||||
unifiv1beta1 "github.com/vegardengen/unifi-network-operator/api/v1beta1"
|
unifiv1beta1 "gitea.engen.priv.no/klauvsteinen/unifi-network-operator/api/v1beta1"
|
||||||
// +kubebuilder:scaffold:imports
|
// +kubebuilder:scaffold:imports
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/vegardengen/go-unifi/unifi"
|
"gitea.engen.priv.no/klauvsteinen/go-unifi/unifi"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UnifiClient struct {
|
type UnifiClient struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user