You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
new-project only allows lowercase dns names as project names #1080
$ openshift ex new-project MyNewProjectName
F0220 12:01:27.888377 24304 new_project.go:45] project "MyNewProjectName" is invalid: Name: invalid value 'MyNewProjectName': does not conform to lower-cased dns952
If we're going to require lowercased dns names for projects, should new-project lowercase and set the original name as a display name if it differs from the lowercased version?
Hmm... if we normalize project names to lowercase in new-project to satisfy name validation, we need to be really careful. Namespace is not validated/normalized currently, so the following does weird things:
Fails with invalid project name: openshift ex new-project NewProjectName --admin=foo
Creates project, namespace, and rolebinding in namespace with lowercase name: openshift ex new-project newprojectname --admin=foo
Creates rolebinding in namespace with mixed case name: openshift ex policy add-user admin bar -n NewProjectName
@derekwaynecarr do you have an opinion on namespace validation when the API processes normal commands (either requiring the namespace validate as a DNS name, and/or requiring the namespace entity to exist)
F0223 08:14:59.232918 25310 create.go:81] Namespace "BIG" is invalid: metadata.name: invalid value 'BIG': must have at most 253 characters and match regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
So we probably want to decide what to do about illegal namespaces on the command line. Errors?
The only namespace validation I could see doing client-side is preventing . and .., since that can mess up the actual URI of the request sent to the server.
@derekwaynecarr was it intentional that project name validation is more strict than namespace name validation? Looks like projects use IsDNS952Label and namespaces use IsDNSSubdomain, which is less strict (allows leading digit, or internal periods, I think).
A lot of the weird issues around #1080 (comment) and mixed-case namespaces would go away if all our objects used ValidateObjectMeta... that ensures consistency with lower-case namespaces.
Yeah, we need to do that soon. Was hoping we could cut over to generic etcd in one swell foop.
On Feb 23, 2015, at 6:56 PM, Jordan Liggitt [email protected] wrote:
A lot of the weird issues around #1080 (comment) and mixed-case namespaces would go away if all our objects used ValidateObjectMeta... that ensures consistency with lower-case namespaces.
—
Reply to this email directly or view it on GitHub.
It should not be more restrictive. Will review this.
Sent from my iPhone
On Feb 23, 2015, at 9:46 PM, Jordan Liggitt [email protected] wrote:
@derekwaynecarr was it intentional that project name validation is more strict than namespace name validation? Looks like projects use IsDNS952Label and namespaces use IsDNSSubdomain, which is less strict (allows leading digit, or internal periods, I think).
—
Reply to this email directly or view it on GitHub.
Activity
liggitt commentedon Feb 20, 2015
Hmm... if we normalize project names to lowercase in
new-projectto satisfy name validation, we need to be really careful. Namespace is not validated/normalized currently, so the following does weird things:Fails with invalid project name:
openshift ex new-project NewProjectName --admin=fooCreates project, namespace, and rolebinding in namespace with lowercase name:
openshift ex new-project newprojectname --admin=fooCreates rolebinding in namespace with mixed case name:
openshift ex policy add-user admin bar -n NewProjectNamesmarterclayton commentedon Feb 20, 2015
Ugh
liggitt commentedon Feb 21, 2015
@derekwaynecarr do you have an opinion on namespace validation when the API processes normal commands (either requiring the namespace validate as a DNS name, and/or requiring the namespace entity to exist)
deads2k commentedon Feb 23, 2015
To be clear, this isn't new-project. This is validation for creating any project: https://github.com/openshift/origin/blob/master/pkg/project/api/validation/validation.go#L16. I presume it's done to match the restriction requirements on namespace.
So we probably want to decide what to do about illegal namespaces on the command line. Errors?
liggitt commentedon Feb 23, 2015
Let the validation and errors happen server-side. Looks like namespace validation needs to change globally upstream, which will be exciting, I'm sure
liggitt commentedon Feb 23, 2015
The only namespace validation I could see doing client-side is preventing
.and.., since that can mess up the actual URI of the request sent to the server.deads2k commentedon Feb 23, 2015
Ah, kapi.ValidNamespace, doesn't do what you'd think it should do: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/context.go#L77.
liggitt commentedon Feb 24, 2015
@derekwaynecarr was it intentional that project name validation is more strict than namespace name validation? Looks like projects use
IsDNS952Labeland namespaces useIsDNSSubdomain, which is less strict (allows leading digit, or internal periods, I think).liggitt commentedon Feb 24, 2015
A lot of the weird issues around #1080 (comment) and mixed-case namespaces would go away if all our objects used ValidateObjectMeta... that ensures consistency with lower-case namespaces.
smarterclayton commentedon Feb 24, 2015
Yeah, we need to do that soon. Was hoping we could cut over to generic etcd in one swell foop.
derekwaynecarr commentedon Feb 24, 2015
It should not be more restrictive. Will review this.
Sent from my iPhone
liggitt commentedon Apr 11, 2015
fixed in #1174
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
Rename resources. closes openshift#1080 (openshift#1142)