Skip to content

Commit 6207baa

Browse files
committed
added s3 as a valid scheme for registries
Signed-off-by: munishchouhan <[email protected]>
1 parent f3648a5 commit 6207baa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/groovy/io/seqera/wave/model/ContainerCoordinates.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import static io.seqera.wave.WaveDefault.DOCKER_IO
3232
@CompileStatic
3333
class ContainerCoordinates implements ContainerPath {
3434

35+
private final static List<String> VALID_SCHEMES = Arrays.asList('oras', 's3')
36+
3537
final String scheme
3638
final String registry
3739
final String image
@@ -57,8 +59,8 @@ class ContainerCoordinates implements ContainerPath {
5759
throw new IllegalArgumentException("Invalid container name - offending image: '$path'")
5860
final scheme = StringUtils.getUrlProtocol(path)
5961
if( scheme ) {
60-
if( scheme!='oras') throw new IllegalArgumentException("Invalid container scheme: '$scheme' - offending image: '$path'")
61-
path = path.substring(7)
62+
if( !VALID_SCHEMES.contains(scheme) ) throw new IllegalArgumentException("Invalid container scheme: '$scheme' - offending image: '$path'")
63+
path = path.substring(scheme.length() + 3) // 3 is the length of '://' after scheme
6264
}
6365

6466
final coordinates = path.tokenize('/')

0 commit comments

Comments
 (0)