Skip to content

Commit e6df0dc

Browse files
shengnuoshivamerla
authored andcommitted
Fix router validation in webhook
Signed-off-by: Sheng Lin <shelin@nvidia.com>
1 parent 338ee25 commit e6df0dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,11 @@ func validateMetricsConfiguration(metrics *appsv1alpha1.Metrics, fldPath *field.
436436
func validateRouterConfiguration(router *appsv1alpha1.Router, fldPath *field.Path) (admission.Warnings, field.ErrorList) {
437437
warningList := admission.Warnings{}
438438
errList := field.ErrorList{}
439-
if router.HostDomainName == "" {
439+
if (router.Ingress != nil || router.Gateway != nil) && router.HostDomainName == "" {
440440
errList = append(errList, field.Required(fldPath.Child("hostDomainName"), "is required"))
441441
}
442442
if router.Ingress != nil && router.Gateway != nil {
443-
errList = append(errList, field.Forbidden(fldPath, "ingressClass and gateway cannot be specified together"))
443+
errList = append(errList, field.Forbidden(fldPath, "ingress and gateway cannot be specified together"))
444444
}
445445
return warningList, errList
446446
}

0 commit comments

Comments
 (0)