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
Interesting issue I just ran into. I created a new project by running npm init. Since I'm logged into npm the resulting package.json looks like so (note the name field):
Attempting a deployment with this results in a failure like so:
2018-04-06T18:17:00.497Z INFO loading configuration
2018-04-06T18:17:00.523Z INFO using namespace myproject at https://127.0.0.1:8443
2018-04-06T18:17:00.530Z WARNING a file property was not found in your package.json, archiving the current directory.
2018-04-06T18:17:00.531Z INFO creating archive of .editorconfig, index.js, package-lock.json, package.json
2018-04-06T18:17:00.666Z ERROR User "developer" cannot get buildconfigs/node-app-s2i in the namespace "myproject": User "developer" cannot get buildconfigs/node-app-s2i in project "myproject"
2018-04-06T18:17:00.666Z ERROR Status code 403
Removing the @evanshortiss/ from package.name resolves the issue.
Interestingly, when I was first investigating the issue I thought it was related to permissions so I ran oc adm policy add-cluster-role-to-user cluster-admin developer and then retried, which resulted in a different error that gave me my clue to fix the issue:
2018-04-06T18:21:52.686Z INFO loading configuration
2018-04-06T18:21:52.713Z INFO using namespace myproject at https://127.0.0.1:8443
2018-04-06T18:21:52.720Z WARNING a file property was not found in your package.json, archiving the current directory.
2018-04-06T18:21:52.720Z INFO creating archive of .editorconfig, index.js, package-lock.json, package.json
2018-04-06T18:21:52.832Z INFO creating build configuration @evanshortiss/node-app-s2i
2018-04-06T18:21:52.832Z INFO Using s2i image bucharestgold/centos7-s2i-nodejs with tag latest
2018-04-06T18:21:52.916Z ERROR {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"BuildConfig \"@evanshortiss/node-app-s2i\" is invalid: [metadata.name: Invalid value: \"@evanshortiss/node-app-s2i\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.labels: Invalid value: \"@evanshortiss/node-app\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), spec.output.to.name: Invalid value: \"@evanshortiss/node-app\": ImageStreamTag name contains invalid syntax]","reason":"Invalid","details":{"name":"@evanshortiss/node-app-s2i","kind":"BuildConfig","causes":[{"reason":"FieldValueInvalid","message":"Invalid value: \"@evanshortiss/node-app-s2i\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')","field":"metadata.name"},{"reason":"FieldValueInvalid","message":"Invalid value: \"@evanshortiss/node-app\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","field":"metadata.labels"},{"reason":"FieldValueInvalid","message":"Invalid value: \"@evanshortiss/node-app\": ImageStreamTag name contains invalid syntax","field":"spec.output.to.name"}]},"code":422}
2018-04-06T18:21:52.916Z ERROR Status code 422
Sounds like nodeshift should add a check for package.name for alphanumeric only, and also hyphens?
Here's some version info that might be helpful too. I'd be happy to look into a PR since I found this while experimenting for a hackathon 😄
Interesting issue I just ran into. I created a new project by running
npm init
. Since I'm logged into npm the resultingpackage.json
looks like so (note thename
field):Attempting a deployment with this results in a failure like so:
Removing the
@evanshortiss/
frompackage.name
resolves the issue.Interestingly, when I was first investigating the issue I thought it was related to permissions so I ran
oc adm policy add-cluster-role-to-user cluster-admin developer
and then retried, which resulted in a different error that gave me my clue to fix the issue:Sounds like nodeshift should add a check for
package.name
for alphanumeric only, and also hyphens?Here's some version info that might be helpful too. I'd be happy to look into a PR since I found this while experimenting for a hackathon 😄
The text was updated successfully, but these errors were encountered: