@@ -5,8 +5,10 @@ import (
55 "context"
66 "fmt"
77 "io"
8+ "path"
89 "reflect"
910 "slices"
11+ "strings"
1012 "time"
1113
1214 "github.com/davidmdm/x/xcontainer"
@@ -290,13 +292,18 @@ func Stow(ctx context.Context, params StowParams) error {
290292
291293 sha256 := internal .SHA256HexString (wasm )
292294
293- tags := slices .Sorted (xcontainer .ToSet (append (params .Tags , "sha256_" + sha256 )).All ())
295+ tags := xcontainer .ToSet (params .Tags )
296+ tags .Add ("sha256_" + sha256 , "latest" )
297+
298+ if _ , tag , _ := strings .Cut (path .Base (params .URL ), ":" ); tag != "" {
299+ tags .Add (tag )
300+ }
294301
295302 digestURL , err := oci .PushArtifact (ctx , oci.PushArtifactParams {
296303 Data : wasm ,
297304 URL : params .URL ,
298305 Insecure : params .Insecure ,
299- Tags : tags ,
306+ Tags : tags . Collect () ,
300307 })
301308 if err != nil {
302309 return fmt .Errorf ("failed to stow wasm artifact: %w" , err )
@@ -306,7 +313,7 @@ func Stow(ctx context.Context, params StowParams) error {
306313 DigestURL string `yaml:"digestUrl"`
307314 ModuleSHA string `yaml:"moduleSHA"`
308315 Tags []string `yaml:"tags"`
309- }{digestURL , sha256 , tags })
316+ }{digestURL , sha256 , slices . Sorted ( tags . All ()) })
310317}
311318
312319type UnlockParams struct {
0 commit comments