Skip to content

Commit 9772029

Browse files
authored
fix: check tag existence during build (#85)
Signed-off-by: chlins <[email protected]>
1 parent c6d639f commit 9772029

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/CloudNativeAI/modctl
33
go 1.23.3
44

55
require (
6-
github.com/CloudNativeAI/model-spec v0.0.0-20250212030633-7aabe2b8eadc
6+
github.com/CloudNativeAI/model-spec v0.0.1
77
github.com/distribution/distribution/v3 v3.0.0-rc.3
88
github.com/distribution/reference v0.6.0
99
github.com/dustin/go-humanize v1.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/CloudNativeAI/model-spec v0.0.0-20250212030633-7aabe2b8eadc h1:EmVmYn5o4jGweOlvjsbsdeSlSpNYvWPQ2muLaQXT1L8=
2-
github.com/CloudNativeAI/model-spec v0.0.0-20250212030633-7aabe2b8eadc/go.mod h1:3U/4zubBfbUkW59ATSg41HnkYyKrKUcKFH/cVdoPQnk=
1+
github.com/CloudNativeAI/model-spec v0.0.1 h1:BgVIStKTLuL1DrLC5A/gmHcR8TEhFCDz9+fYdCUa/CY=
2+
github.com/CloudNativeAI/model-spec v0.0.1/go.mod h1:3U/4zubBfbUkW59ATSg41HnkYyKrKUcKFH/cVdoPQnk=
33
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
44
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
55
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=

pkg/backend/build.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ func (b *backend) Build(ctx context.Context, modelfilePath, workDir, target stri
4343
}
4444

4545
repo, tag := ref.Repository(), ref.Tag()
46+
if tag == "" {
47+
return fmt.Errorf("tag is required")
48+
}
49+
4650
layers := []ocispec.Descriptor{}
4751
layerDescs, err := b.process(ctx, workDir, repo, b.getProcessors(modelfile)...)
4852
if err != nil {

0 commit comments

Comments
 (0)