Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/oci-image-tool/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ func createAction(context *cli.Context) error {
return fmt.Errorf("ref must be provided")
}

for index, ref := range v.refs {
for i := index + 1; i < len(v.refs); i++ {
if ref == v.refs[i] {
fmt.Printf("WARNING: refs contains duplicate reference %q.\n", v.refs[i])
}
}
}

if v.typ == "" {
typ, err := image.Autodetect(context.Args()[0])
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions cmd/oci-image-tool/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ func unpackAction(context *cli.Context) error {
return fmt.Errorf("ref must be provided")
}

for index, ref := range v.refs {
for i := index + 1; i < len(v.refs); i++ {
if ref == v.refs[i] {
fmt.Printf("WARNING: refs contains duplicate reference %q.\n", v.refs[i])
}
}
}

if v.typ == "" {
typ, err := image.Autodetect(context.Args()[0])
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions cmd/oci-image-tool/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ func validateAction(context *cli.Context) error {
refs: context.StringSlice("ref"),
}

for index, ref := range v.refs {
for i := index + 1; i < len(v.refs); i++ {
if ref == v.refs[i] {
fmt.Printf("WARNING: refs contains duplicate reference %q.\n", v.refs[i])
}
}
}

var errs []string
for _, arg := range context.Args() {
err := validatePath(arg)
Expand Down