Extract common functions and implement mwan3rule 90/3490/3
authorchengli3 <cheng1.li@intel.com>
Thu, 14 May 2020 03:18:36 +0000 (03:18 +0000)
committerchengli3 <cheng1.li@intel.com>
Thu, 21 May 2020 02:30:31 +0000 (02:30 +0000)
commit92997e7048c9fa0a97893a4b77457df685046f67
tree2e7ab1af9459c5e51602eb2d7e314d91cc3e7cf9
parent94e1f2607252b93e9491fbc753dee9a892b36977
Extract common functions and implement mwan3rule

As we will have several crd/controllers, they have almost the same
reconcile logic. So we extract the common logic and make them as
functions. Controllers call these functions instead of code duplication.

This patch extracts common functions and implements the mwan3rule
crd/controller.

Signed-off-by: chengli3 <cheng1.li@intel.com>
Change-Id: Ie9fe7ddcac6700605dbcb48ed9d88f96981b898a
33 files changed:
platform/crd-ctrlr/README.md
platform/crd-ctrlr/examples/sdewan-controller.yaml
platform/crd-ctrlr/src/Dockerfile
platform/crd-ctrlr/src/Makefile
platform/crd-ctrlr/src/PROJECT
platform/crd-ctrlr/src/api/v1alpha1/common_types.go
platform/crd-ctrlr/src/api/v1alpha1/mwan3rule_types.go [new file with mode: 0644]
platform/crd-ctrlr/src/api/v1alpha1/zz_generated.deepcopy.go
platform/crd-ctrlr/src/basehandler/isdewanhandler.go [new file with mode: 0644]
platform/crd-ctrlr/src/cnfprovider/cnfprovider.go [deleted file]
platform/crd-ctrlr/src/cnfprovider/openprovider.go [new file with mode: 0644]
platform/crd-ctrlr/src/cnfprovider/wrtprovider.go [deleted file]
platform/crd-ctrlr/src/config/crd/bases/batch.sdewan.akraino.org_mwan3policies.yaml
platform/crd-ctrlr/src/config/crd/bases/batch.sdewan.akraino.org_mwan3rules.yaml [new file with mode: 0644]
platform/crd-ctrlr/src/config/crd/kustomization.yaml
platform/crd-ctrlr/src/config/crd/patches/cainjection_in_mwan3rules.yaml [new file with mode: 0644]
platform/crd-ctrlr/src/config/crd/patches/webhook_in_mwan3rules.yaml [new file with mode: 0644]
platform/crd-ctrlr/src/config/rbac/mwan3policy_editor_role.yaml [deleted file]
platform/crd-ctrlr/src/config/rbac/mwan3policy_viewer_role.yaml [deleted file]
platform/crd-ctrlr/src/config/rbac/role.yaml
platform/crd-ctrlr/src/config/samples/batch_v1alpha1_mwan3policy.yaml
platform/crd-ctrlr/src/config/samples/batch_v1alpha1_mwan3rule.yaml [new file with mode: 0644]
platform/crd-ctrlr/src/controllers/base_controller.go [new file with mode: 0644]
platform/crd-ctrlr/src/controllers/mwan3policy_controller.go
platform/crd-ctrlr/src/controllers/mwan3rule_controller.go [new file with mode: 0644]
platform/crd-ctrlr/src/controllers/suite_test.go
platform/crd-ctrlr/src/go.mod
platform/crd-ctrlr/src/go.sum
platform/crd-ctrlr/src/main.go
platform/crd-ctrlr/src/openwrt/firewall.go
platform/crd-ctrlr/src/openwrt/ipsec.go
platform/crd-ctrlr/src/openwrt/mwan3.go
platform/crd-ctrlr/src/openwrt/openwrtclient.go