-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add validation enforcing that network subdomain adheres to RFC 1035 #278
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,11 @@ func (js *JobSet) ValidateCreate() (admission.Warnings, error) { | |
for _, errMessage := range validation.IsDNS1123Subdomain(js.Spec.Network.Subdomain) { | ||
allErrs = append(allErrs, fmt.Errorf(errMessage)) | ||
} | ||
|
||
// Since subdomain name is also used as service name, it must adhere to RFC 1035 as well. | ||
for _, errMessage := range validation.IsDNS1035Label(js.Spec.Network.Subdomain) { | ||
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. the subdomain field in the podspec is validated at: https://github.com/kubernetes/kubernetes/blob/6c39a3724d5ff33564d31d5097704f15852c036f/pkg/apis/core/validation/validation.go#L3990 we should do the same here 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. ah, you are trying to validate for service too, sgtm. /lgtm |
||
allErrs = append(allErrs, fmt.Errorf(errMessage)) | ||
} | ||
} | ||
|
||
for _, rjob := range js.Spec.ReplicatedJobs { | ||
|
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.
Is RFC 1035 more emcompassing than DNS 1123? ie does validating DNS1035 mean that we also satisfy DNS 1123?