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
Currently there is an option to enable WeakValidation when using ParseReference.
However, for my particular usecase I would like to ignore the character validation part of some of the steps during ParseReference, namely I would like to parse a reference with the following example string:
const (
defaultNamespace="library"repositoryChars="abcdefghijklmnopqrstuvwxyz0123456789_-./"regRepoDelimiter="/"
)
...iferr:=checkRepository(repo); err!=nil {
returnRepository{}, err
}
...funccheckRepository(repositorystring) error {
returncheckElement("repository", repository, repositoryChars, 2, 255)
}
...funccheckElement(name, element, allowedRunesstring, minRunes, maxRunesint) error {
numRunes:=utf8.RuneCountInString(element)
if (numRunes<minRunes) || (maxRunes<numRunes) {
returnnewErrBadName("%s must be between %d and %d characters in length: %s", name, minRunes, maxRunes, element)
} elseiflen(strings.Map(stripRunesFn(allowedRunes), element)) !=0 {
returnnewErrBadName("%s can only contain the characters `%s`: %s", name, allowedRunes, element)
}
returnnil
}
For these steps, I would like to add an option ignoreValidation for example, that will not check the chars for a tag or repository, that defaults to false, so the behavior stays the same unless somebody sets the option to true.
Let me know what you think.
Kind regards,
Stef Graces
The text was updated successfully, but these errors were encountered:
Hi,
Currently there is an option to enable WeakValidation when using ParseReference.
However, for my particular usecase I would like to ignore the character validation part of some of the steps during ParseReference, namely I would like to parse a reference with the following example string:
It is important that for this step, the env variables remain what they are as I require them to be written as this literal string in a later step.
Relevant go code, found here (https://github.com/google/go-containerregistry/blob/main/pkg/name/repository.go):
For these steps, I would like to add an option
ignoreValidation
for example, that will not check the chars for a tag or repository, that defaults to false, so the behavior stays the same unless somebody sets the option totrue
.Let me know what you think.
Kind regards,
Stef Graces
The text was updated successfully, but these errors were encountered: