{"action":"opened","issue":{"url":"https://api.github.com/repos/openshiftio/openshift.io/issues/1058","repository_url":"https://api.github.com/repos/openshiftio/openshift.io","labels_url":"https://api.github.com/repos/openshiftio/openshift.io/issues/1058/labels{/name}","comments_url":"https://api.github.com/repos/openshiftio/openshift.io/issues/1058/comments","events_url":"https://api.github.com/repos/openshiftio/openshift.io/issues/1058/events","html_url":"https://github.com/openshiftio/openshift.io/issues/1058","id":263116562,"number":1058,"title":"Spaces starting with non-alphanumeric characters should not be allowed","user":{"login":"jerboaa","id":357222,"avatar_url":"https://avatars0.githubusercontent.com/u/357222?v=4","gravatar_id":"","url":"https://api.github.com/users/jerboaa","html_url":"https://github.com/jerboaa","followers_url":"https://api.github.com/users/jerboaa/followers","following_url":"https://api.github.com/users/jerboaa/following{/other_user}","gists_url":"https://api.github.com/users/jerboaa/gists{/gist_id}","starred_url":"https://api.github.com/users/jerboaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerboaa/subscriptions","organizations_url":"https://api.github.com/users/jerboaa/orgs","repos_url":"https://api.github.com/users/jerboaa/repos","events_url":"https://api.github.com/users/jerboaa/events{/privacy}","received_events_url":"https://api.github.com/users/jerboaa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-05T13:00:22Z","updated_at":"2017-10-05T13:00:22Z","closed_at":null,"author_association":"NONE","body":"I've created a space on OSIO with name `1test`, which creates a `1test` source project on github, etc. When the pipeline tries to deploy it fails.\r\n\r\n![Failed pipeline](https://user-images.githubusercontent.com/357222/31228318-65488b38-a9dd-11e7-81b8-05ae792d030f.png)\r\n\r\nThe openshift online jenkins console shows this:\r\n\r\n    ERROR: Error during kubernetes apply: java.lang.RuntimeException: Failed to create Service from pipeline.json. io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://kubernetes.default/api/v1/namespaces/sgehwolf-stage/services. Message: Service \"1test\" is invalid: metadata.name: Invalid value: \"1test\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'). Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=metadata.name, message=Invalid value: \"1test\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'), reason=FieldValueInvalid, additionalProperties={})], group=null, kind=Service, name=1test, retryAfterSeconds=null, additionalProperties={}), kind=Status, message=Service \"1test\" is invalid: metadata.name: Invalid value: \"1test\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'), metadata=ListMeta(resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).. Service(apiVersion=v1, kind=Service, metadata=ObjectMeta(annotations={fabric8.io/git-commit=0f559ab499f6a706ee7086dd8909435f644445eb, fabric8.io/scm-con-url=scm:git:https://github.com/openshiftio/booster-parent.git/1test, prometheus.io/port=9779, fabric8.io/scm-url=https://github.com/openshiftio/1test, fabric8.io/iconUrl=img/icons/vertx.svg, fabric8.io/git-branch=jerboaa/1test/master-1.0.1, prometheus.io/scrape=true, fabric8.io/scm-devcon-url=scm:git:git:@github.com:openshiftio/booster-parent.git/1test, fabric8.io/scm-tag=booster-parent-8}, clusterName=null, creationTimestamp=null, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, labels={expose=true, space=1test, app=1test, provider=fabric8, version=1.0.1, group=io.openshift.booster}, name=1test, namespace=null, ownerReferences=[], resourceVersion=null, selfLink=null, uid=null, additionalProperties={}), spec=ServiceSpec(clusterIP=null, deprecatedPublicIPs=[], externalIPs=[], externalName=null, loadBalancerIP=null, loadBalancerSourceRanges=[], ports=[ServicePort(name=http, nodePort=null, port=8080, protocol=TCP, targetPort=IntOrString(IntVal=8080, Kind=null, StrVal=null, additionalProperties={}), additionalProperties={})], selector={app=1test, provider=fabric8, group=io.openshift.booster}, sessionAffinity=null, type=null, additionalProperties={}), status=null, additionalProperties={})\r\n            at io.fabric8.kubernetes.api.Controller.onApplyError(Controller.java:1459)\r\n            at io.fabric8.kubernetes.api.Controller.doCreateService(Controller.java:1103)\r\n            at io.fabric8.kubernetes.api.Controller.applyService(Controller.java:1030)\r\n            at io.fabric8.kubernetes.pipeline.devops.ApplyStepExecution.run(ApplyStepExecution.java:207)\r\n            at io.fabric8.kubernetes.pipeline.devops.ApplyStepExecution.run(ApplyStepExecution.java:92)\r\n            at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:42)\r\n            at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)\r\n            at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)\r\n            at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)\r\n            at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source)\r\n            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n            at java.lang.reflect.Method.invoke(Method.java:498)\r\n            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)\r\n            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)\r\n            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)\r\n            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)\r\n            at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)\r\n            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)\r\n            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)\r\n            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155)\r\n            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)\r\n            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:123)\r\n            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:110)\r\n            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:153)\r\n            at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:157)\r\n            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)\r\n            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)\r\n            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)\r\n            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)\r\n            at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)\r\n            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n            at java.lang.reflect.Method.invoke(Method.java:498)\r\n            at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)\r\n            at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)\r\n            at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)\r\n            at sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)\r\n            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n            at java.lang.reflect.Method.invoke(Method.java:498)\r\n            at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)\r\n            at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)\r\n            at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)\r\n            at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)\r\n            at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)\r\n            at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)\r\n            at com.cloudbees.groovy.cps.Next.step(Next.java:83)\r\n            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:173)\r\n            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)\r\n            at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)\r\n            at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)\r\n            at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)\r\n            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)\r\n            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)\r\n            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)\r\n            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)\r\n            at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)\r\n            at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)\r\n            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)\r\n            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)\r\n            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)\r\n            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)\r\n            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)\r\n            at java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n            at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)\r\n            at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)\r\n            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\r\n            at java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n            at java.lang.Thread.run(Thread.java:748)\r\n    Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://kubernetes.default/api/v1/namespaces/sgehwolf-stage/services. Message: Service \"1test\" is invalid: metadata.name: Invalid value: \"1test\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'). Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=metadata.name, message=Invalid value: \"1test\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'), reason=FieldValueInvalid, additionalProperties={})], group=null, kind=Service, name=1test, retryAfterSeconds=null, additionalProperties={}), kind=Status, message=Service \"1test\" is invalid: metadata.name: Invalid value: \"1test\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'), metadata=ListMeta(resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).\r\n            at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:470)\r\n            at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:409)\r\n            at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:379)\r\n            at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:343)\r\n            at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleCreate(OperationSupport.java:226)\r\n            at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(BaseOperation.java:769)\r\n            at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(BaseOperation.java:356)\r\n            at io.fabric8.kubernetes.api.Controller.doCreateService(Controller.java:1097)\r\n            ... 67 more\r\n\r\nI suggest to disallow spaces/codesource project starting with non-alphanumerics or translate them somehow to a valid name when deploying."}}
{"actor":{"display_login":"jerboaa"}}