Closed displague closed 4 years ago
Thanks @displague ! It appears that what's happening here is that the :
is not being handled properly (or at all really). If we want to generate a default name from the image name, we'll want the code to account for :
characters.
I ran into this as well, I think this will be a pretty common error to run into when using stack images that have a version tag (which itself is pretty common). It would be nice to fix this so that stacks with a version tag can install cleanly without having to supply the extra stack name option.
> kubectl crossplane stack install --cluster crossplane/stack-gcp:v0.3.1
The ClusterStackInstall "crossplane-stack-gcp:v0.3.1" is invalid: metadata.name: Invalid value:
"crossplane-stack-gcp:v0.3.1": 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])?)*')
I edited the title to reflect the common scenario that fails due to this issue
@jbw976 does this still repro?
I am able to reproduce this behavior still on the latest version, but only when not providing the positional name parameter. The documentation that we have in https://crossplane.io/docs/master/stacks-guide.html#install-support-for-our-application-into-crossplane provides that named parameter, so we won't hit this at least on mainline paths from the documentation.
We can punt on this and fix sometime in the future.
STACK_NAME appears to be optional in the stack install help. This is reasonable as a default STACK_NAME could be derived from the image name presented in the STACK_IMAGE_NAME (org/name:version).
However, STACK_NAME appears to be required when using real-world images. I can see how local image names would not contain slashes ("/") and could potentially omit a version, so STACK_NAME may technically be optional today in some limited cases.