Skip to content

Commit f837c55

Browse files
loresusopoiana
authored andcommitted
new(cmd): introduce annotation-source flag
Signed-off-by: Lorenzo Susini <[email protected]>
1 parent e38a30c commit f837c55

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

cmd/registry_push.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ func (o *pushOptions) RunPush(ctx context.Context, args []string) error {
131131

132132
opts := ocipusher.Options{
133133
ocipusher.WithTags(o.Tags...),
134+
ocipusher.WithAnnotationSource(o.AnnotationSource),
134135
}
135136

136137
switch o.ArtifactType {

pkg/options/artifact_options.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ import (
2727
// ArtifactOptions artifact specific options. Commands that need these options
2828
// may embed this struct in their options.
2929
type ArtifactOptions struct {
30-
ArtifactType oci.ArtifactType
31-
Platforms []string // orders matter (same as args)
32-
Dependencies []string
33-
Tags []string
30+
ArtifactType oci.ArtifactType
31+
Platforms []string // orders matter (same as args)
32+
Dependencies []string
33+
Tags []string
34+
AnnotationSource string
3435
}
3536

3637
var platformRgx = regexp.MustCompile(`^[a-z]+/[a-z0-9_]+$`)
@@ -68,6 +69,9 @@ func (art *ArtifactOptions) AddFlags(cmd *cobra.Command) error {
6869

6970
cmd.Flags().StringArrayVarP(&art.Dependencies, "depends-on", "d", nil,
7071
`set an artifact dependency (can be specified multiple times). Example: "--depends-on my-plugin:1.2.3"`)
72+
73+
cmd.Flags().StringVar(&art.AnnotationSource, "annotation-source", "",
74+
`set annotation source for the artifact`)
7175
case "pull":
7276
if len(art.Platforms) > 1 {
7377
return fmt.Errorf("--platform can be specified only one time for pull")

0 commit comments

Comments
 (0)