Fastcgi configmap should be on the same namespace of ingress (#9863)

This commit is contained in:
Ricardo Katz 2023-04-16 21:32:43 -03:00 committed by GitHub
parent 297036e169
commit 11419a6837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 8 deletions

View file

@ -88,11 +88,11 @@ func (a fastcgi) Parse(ing *networking.Ingress) (interface{}, error) {
}
}
if cmns == "" {
cmns = ing.Namespace
if cmns != "" && cmns != ing.Namespace {
return fcgiConfig, fmt.Errorf("different namespace is not supported on fast_cgi param configmap")
}
cm = fmt.Sprintf("%v/%v", cmns, cmn)
cm = fmt.Sprintf("%v/%v", ing.Namespace, cmn)
cmap, err := a.r.GetConfigMap(cm)
if err != nil {
return fcgiConfig, ing_errors.LocationDenied{