-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Host wildcard policy for supporting wildcard routes #11550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3117d54
0e75c1d
1b98d1c
629921f
fead74e
438b1df
482a044
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,7 @@ import "k8s.io/kubernetes/pkg/runtime" | |
|
||
func SetDefaults_RouteSpec(obj *RouteSpec) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same defaulting of the wildcardpolicy in RouteIngress if we add the field there |
||
if len(obj.WildcardPolicy) == 0 { | ||
obj.WildcardPolicy = "None" | ||
} | ||
switch obj.WildcardPolicy { | ||
case WildcardPolicyType("None"): | ||
obj.WildcardPolicy = WildcardPolicyNone | ||
case WildcardPolicyType("Subdomain"): | ||
obj.WildcardPolicy = WildcardPolicySubdomain | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to do something on the case where something else is encountered? Log an error and default to None? Log and ignore the route (with appropriate status)? Or is that definitely impossible by some other mechanism I haven't spotted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know too much about this part - AFAICT, it was just setting defaults if no values were set on fields in an object. And there's no errors thrown back/logging here in similar defaults code. @liggitt may be able to tell more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not in conversion/defaulting, only in validation |
||
|
||
|
@@ -38,10 +32,17 @@ func SetDefaults_TLSConfig(obj *TLSConfig) { | |
} | ||
} | ||
|
||
func SetDefaults_RouteIngress(obj *RouteIngress) { | ||
if len(obj.WildcardPolicy) == 0 { | ||
obj.WildcardPolicy = WildcardPolicyNone | ||
} | ||
} | ||
|
||
func addDefaultingFuncs(scheme *runtime.Scheme) error { | ||
return scheme.AddDefaultingFuncs( | ||
SetDefaults_RouteSpec, | ||
SetDefaults_RouteTargetReference, | ||
SetDefaults_TLSConfig, | ||
SetDefaults_RouteIngress, | ||
) | ||
} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simpler: