Use struct to pack Ingress and its annotations
This commit is contained in:
parent
bf7ad0daca
commit
12766cdfc6
8 changed files with 171 additions and 158 deletions
|
|
@ -20,6 +20,7 @@ import (
|
|||
apiv1 "k8s.io/api/core/v1"
|
||||
extensions "k8s.io/api/extensions/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/ingress-nginx/internal/ingress/annotations"
|
||||
"k8s.io/ingress-nginx/internal/ingress/annotations/modsecurity"
|
||||
|
||||
"k8s.io/ingress-nginx/internal/ingress/annotations/auth"
|
||||
|
|
@ -208,7 +209,7 @@ type Location struct {
|
|||
// uses the default backend.
|
||||
IsDefBackend bool `json:"isDefBackend"`
|
||||
// Ingress returns the ingress from which this location was generated
|
||||
Ingress *extensions.Ingress `json:"ingress"`
|
||||
Ingress *Ingress `json:"ingress"`
|
||||
// Backend describes the name of the backend to use.
|
||||
Backend string `json:"backend"`
|
||||
// Service describes the referenced services from the ingress
|
||||
|
|
@ -330,3 +331,9 @@ type ProxyProtocol struct {
|
|||
Decode bool `json:"decode"`
|
||||
Encode bool `json:"encode"`
|
||||
}
|
||||
|
||||
// Ingress holds the definition of an Ingress plus its annotations
|
||||
type Ingress struct {
|
||||
extensions.Ingress
|
||||
ParsedAnnotations *annotations.Ingress
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue