-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Labels
SimpleNice for a quick look on a minute or twoNice for a quick look on a minute or two
Description
This error confused me a bit at first, why was it invalid? Eventually I noticed a length of 3 characters for a slice key was successful. Looked up the source and the restriction appears to be due to a regex pattern constraint.
Perhaps in this case the error message could better indicate the failure was due to a minimum expected length?
$ chisel find --release /opt/chisel-release base-distroless
2024/09/11 04:48:18 Processing /opt/chisel-release release...
error: invalid slice name "cc" in slices/base-distroless.yamlchisel/internal/setup/setup.go
Lines 562 to 566 in ae52f84
| for sliceName, yamlSlice := range yamlPkg.Slices { | |
| match := snameExp.FindStringSubmatch(sliceName) | |
| if match == nil { | |
| return nil, fmt.Errorf("invalid slice name %q in %s", sliceName, pkgPath) | |
| } |
chisel/internal/setup/setup.go
Lines 283 to 284 in ae52f84
| // snameExp matches only the slice name, without the leading package name. | |
| var snameExp = regexp.MustCompile(`^([a-z](?:-?[a-z0-9]){2,})$`) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SimpleNice for a quick look on a minute or twoNice for a quick look on a minute or two