Refactoring of ingress class annotation and main flags
This commit is contained in:
parent
e937ed8134
commit
14b5259b0f
10 changed files with 155 additions and 35 deletions
|
|
@ -27,15 +27,12 @@ import (
|
|||
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
|
||||
"k8s.io/ingress-nginx/internal/ingress/annotations/class"
|
||||
"k8s.io/ingress-nginx/internal/ingress/controller"
|
||||
ngx_config "k8s.io/ingress-nginx/internal/ingress/controller/config"
|
||||
ing_net "k8s.io/ingress-nginx/internal/net"
|
||||
)
|
||||
|
||||
const (
|
||||
defIngressClass = "nginx"
|
||||
)
|
||||
|
||||
func parseFlags() (bool, *controller.Configuration, error) {
|
||||
var (
|
||||
flags = pflag.NewFlagSet("", pflag.ExitOnError)
|
||||
|
|
@ -152,9 +149,11 @@ func parseFlags() (bool, *controller.Configuration, error) {
|
|||
if *ingressClass != "" {
|
||||
glog.Infof("Watching for ingress class: %s", *ingressClass)
|
||||
|
||||
if *ingressClass != defIngressClass {
|
||||
if *ingressClass != class.DefaultClass {
|
||||
glog.Warningf("only Ingress with class \"%v\" will be processed by this ingress controller", *ingressClass)
|
||||
}
|
||||
|
||||
class.IngressClass = *ingressClass
|
||||
}
|
||||
|
||||
// check port collisions
|
||||
|
|
@ -198,7 +197,6 @@ func parseFlags() (bool, *controller.Configuration, error) {
|
|||
EnableSSLChainCompletion: *enableSSLChainCompletion,
|
||||
ResyncPeriod: *resyncPeriod,
|
||||
DefaultService: *defaultSvc,
|
||||
IngressClass: *ingressClass,
|
||||
Namespace: *watchNamespace,
|
||||
ConfigMapName: *configMap,
|
||||
TCPConfigMapName: *tcpConfigMapName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue