Fix bugs in http challenge solver
This commit is contained in:
parent
36c825fa48
commit
cfc11f324b
@ -73,10 +73,10 @@ func (s *Solver) ensureIngress(crt *v1alpha1.Certificate, svcName, domain, token
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(existingIngresses) > 0 {
|
||||
errMsg := fmt.Sprintf("multiple challenge solver pods found for certificate '%s/%s'. Cleaning up existing pods.", crt.Namespace, crt.Name)
|
||||
if len(existingIngresses) > 1 {
|
||||
errMsg := fmt.Sprintf("multiple challenge solver ingresses found for certificate '%s/%s'. Cleaning up existing pods.", crt.Namespace, crt.Name)
|
||||
glog.Infof(errMsg)
|
||||
err := s.cleanupPods(crt, domain)
|
||||
err := s.cleanupIngresses(crt, domain, token)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -85,7 +85,7 @@ func (s *Solver) ensureIngress(crt *v1alpha1.Certificate, svcName, domain, token
|
||||
if len(existingIngresses) == 1 {
|
||||
return existingIngresses[0], nil
|
||||
}
|
||||
glog.Infof("No existing HTTP01 challenge solver pod found for Certificate %q. One will be created.")
|
||||
glog.Infof("No existing HTTP01 challenge solver ingress found for Certificate %q. One will be created.")
|
||||
return s.createIngress(crt, svcName, domain, token, *httpDomainCfg)
|
||||
}
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ func (s *Solver) ensurePod(crt *v1alpha1.Certificate, domain, token, key string)
|
||||
return nil, err
|
||||
}
|
||||
var pod *corev1.Pod
|
||||
if len(existingPods) > 0 {
|
||||
if len(existingPods) > 1 {
|
||||
errMsg := fmt.Sprintf("multiple challenge solver pods found for certificate '%s/%s'. Cleaning up existing pods.", crt.Namespace, crt.Name)
|
||||
glog.Infof(errMsg)
|
||||
err := s.cleanupPods(crt, domain)
|
||||
|
||||
@ -20,7 +20,7 @@ func (s *Solver) ensureService(crt *v1alpha1.Certificate, domain, token, key str
|
||||
return nil, err
|
||||
}
|
||||
var service *corev1.Service
|
||||
if len(existingServices) > 0 {
|
||||
if len(existingServices) > 1 {
|
||||
errMsg := fmt.Sprintf("multiple challenge solver services found for certificate '%s/%s'. Cleaning up existing services.", crt.Namespace, crt.Name)
|
||||
glog.Infof(errMsg)
|
||||
err := s.cleanupServices(crt, domain)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user