Allow proxy-ssl-* annotations without proxy-ssl-secret

Signed-off-by: Tamal Saha <tamal@appscode.com>
This commit is contained in:
Tamal Saha 2023-10-23 17:32:47 -07:00
parent 0c3d52bade
commit 555c5eb04d

View file

@ -17,6 +17,7 @@ limitations under the License.
package proxyssl package proxyssl
import ( import (
"errors"
"fmt" "fmt"
"regexp" "regexp"
"sort" "sort"
@ -190,10 +191,9 @@ func (p proxySSL) Parse(ing *networking.Ingress) (interface{}, error) {
config := &Config{} config := &Config{}
proxysslsecret, err := parser.GetStringAnnotation(proxySSLSecretAnnotation, ing, p.annotationConfig.Annotations) proxysslsecret, err := parser.GetStringAnnotation(proxySSLSecretAnnotation, ing, p.annotationConfig.Annotations)
if err != nil { if err != nil && !errors.Is(err, ing_errors.ErrMissingAnnotations) {
return &Config{}, err return &Config{}, err
} } else if err == nil {
ns, _, err := k8s.ParseNameNS(proxysslsecret) ns, _, err := k8s.ParseNameNS(proxysslsecret)
if err != nil { if err != nil {
return &Config{}, ing_errors.NewLocationDenied(err.Error()) return &Config{}, ing_errors.NewLocationDenied(err.Error())
@ -211,6 +211,7 @@ func (p proxySSL) Parse(ing *networking.Ingress) (interface{}, error) {
return &Config{}, ing_errors.LocationDeniedError{Reason: e} return &Config{}, ing_errors.LocationDeniedError{Reason: e}
} }
config.AuthSSLCert = *proxyCert config.AuthSSLCert = *proxyCert
}
config.Ciphers, err = parser.GetStringAnnotation(proxySSLCiphersAnnotation, ing, p.annotationConfig.Annotations) config.Ciphers, err = parser.GetStringAnnotation(proxySSLCiphersAnnotation, ing, p.annotationConfig.Annotations)
if err != nil { if err != nil {