Skip to content

Commit

Permalink
Fix API validation for webhook DNS solver
Browse files Browse the repository at this point in the history
Signed-off-by: James Munnelly <james@munnelly.eu>
  • Loading branch information
munnerz committed Apr 30, 2019
1 parent 235697d commit 285b864
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/apis/certmanager/validation/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,16 @@ func ValidateACMEIssuerDNS01Config(iss *v1alpha1.ACMEIssuerDNS01Config, fldPath
}
}
}
if p.Webhook != nil {
if numProviders > 0 {
el = append(el, field.Forbidden(fldPath.Child("webhook"), "may not specify more than one provider type"))
} else {
numProviders++
if len(p.Webhook.SolverName) == 0 {
el = append(el, field.Required(fldPath.Child("webhook", "solverName"), "solver name must be specified"))
}
}
}
if numProviders == 0 {
el = append(el, field.Required(fldPath, "at least one provider must be configured"))
}
Expand Down

0 comments on commit 285b864

Please sign in to comment.