@@ -40,26 +40,26 @@ import (
4040 "github.com/api7/gopkg/pkg/log"
4141)
4242
43- type ControlPlanesFlag struct {
44- ControlPlanes []* config.ControlPlaneConfig
43+ type GatewayConfigsFlag struct {
44+ GatewayConfigs []* config.GatewayConfig
4545}
4646
47- func (f * ControlPlanesFlag ) String () string {
48- data , _ := yaml .Marshal (f .ControlPlanes )
47+ func (f * GatewayConfigsFlag ) String () string {
48+ data , _ := yaml .Marshal (f .GatewayConfigs )
4949 return string (data )
5050}
5151
52- func (f * ControlPlanesFlag ) Set (value string ) error {
53- var controlPlanes []* config.ControlPlaneConfig
54- if err := yaml .Unmarshal ([]byte (value ), & controlPlanes ); err != nil {
52+ func (f * GatewayConfigsFlag ) Set (value string ) error {
53+ var gatewayConfigs []* config.GatewayConfig
54+ if err := yaml .Unmarshal ([]byte (value ), & gatewayConfigs ); err != nil {
5555 return err
5656 }
57- f .ControlPlanes = controlPlanes
57+ f .GatewayConfigs = gatewayConfigs
5858 return nil
5959}
6060
61- func (f * ControlPlanesFlag ) Type () string {
62- return "controlPlanes "
61+ func (f * GatewayConfigsFlag ) Type () string {
62+ return "gateway_configs "
6363}
6464
6565func NewRootCmd () * cobra.Command {
@@ -91,7 +91,7 @@ func newAPI7IngressController() *cobra.Command {
9191 cfg := config .ControllerConfig
9292 var configPath string
9393
94- var controlPlanesFlag ControlPlanesFlag
94+ var controlPlanesFlag GatewayConfigsFlag
9595 cmd := & cobra.Command {
9696 Use : "api7-ingress-controller [command]" ,
9797 Long : "Yet another Ingress controller for Kubernetes using api7ee Gateway as the high performance reverse proxy." ,
@@ -105,7 +105,7 @@ func newAPI7IngressController() *cobra.Command {
105105 cfg = c
106106 config .SetControllerConfig (c )
107107 } else {
108- cfg .ControlPlanes = controlPlanesFlag .ControlPlanes
108+ cfg .GatewayConfigs = controlPlanesFlag .GatewayConfigs
109109 }
110110
111111 if err := cfg .Validate (); err != nil {
0 commit comments