Add new lints
This commit is contained in:
parent
2586542608
commit
0fb34f74fa
1 changed files with 20 additions and 0 deletions
|
@ -61,6 +61,8 @@ func (lint IngressLint) Version() string {
|
|||
// GetIngressLints returns all of the lints for ingresses
|
||||
func GetIngressLints() []IngressLint {
|
||||
return []IngressLint{
|
||||
removedAnnotation("secure-backends", 3203, "0.21.0"),
|
||||
removedAnnotation("grpc-backend", 3203, "0.21.0"),
|
||||
removedAnnotation("add-base-url", 3174, "0.22.0"),
|
||||
removedAnnotation("base-url-scheme", 3174, "0.22.0"),
|
||||
removedAnnotation("session-cookie-hash", 3743, "0.24.0"),
|
||||
|
@ -84,6 +86,10 @@ func GetIngressLints() []IngressLint {
|
|||
version: "0.24.0",
|
||||
f: xForwardedPrefixIsBool,
|
||||
},
|
||||
{
|
||||
message: "Contains an configuration-snippet that contains a Satisfy directive.\nPlease use https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#satisfy",
|
||||
f: satisfyDirective,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,3 +144,17 @@ func removedAnnotation(annotationName string, issueNumber int, version string) I
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
func satisfyDirective(ing networking.Ingress) bool {
|
||||
for name, val := range ing.Annotations {
|
||||
if strings.HasSuffix(name, "/configuration-snippet") {
|
||||
if strings.Index(val, "satisfy") != -1 {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue