diff --git a/contrib/nydusify/cmd/nydusify.go b/contrib/nydusify/cmd/nydusify.go index ae13d737caf..8a56b786076 100644 --- a/contrib/nydusify/cmd/nydusify.go +++ b/contrib/nydusify/cmd/nydusify.go @@ -338,6 +338,12 @@ func main() { Usage: "Convert to OCI-referenced nydus zran image", EnvVars: []string{"OCI_REF"}, }, + &cli.BoolFlag{ + Name: "with-referrer", + Value: false, + Usage: "Associate a reference to the source image, see https://github.com/opencontainers/distribution-spec/blob/main/spec.md#listing-referrers", + EnvVars: []string{"WITH_REFERRER"}, + }, &cli.BoolFlag{ Name: "oci", Value: false, @@ -510,6 +516,7 @@ func main() { BatchSize: c.String("batch-size"), OCIRef: c.Bool("oci-ref"), + WithReferrer: c.Bool("with-referrer"), AllPlatforms: c.Bool("all-platforms"), Platforms: c.String("platform"), diff --git a/contrib/nydusify/pkg/converter/config.go b/contrib/nydusify/pkg/converter/config.go index 388fcf23ab8..c1f58f19e67 100644 --- a/contrib/nydusify/pkg/converter/config.go +++ b/contrib/nydusify/pkg/converter/config.go @@ -22,6 +22,7 @@ func getConfig(opt Opt) map[string]string { cfg["docker2oci"] = strconv.FormatBool(opt.Docker2OCI) cfg["merge_manifest"] = strconv.FormatBool(opt.MergePlatform) cfg["oci_ref"] = strconv.FormatBool(opt.OCIRef) + cfg["with_referrer"] = strconv.FormatBool(opt.WithReferrer) cfg["prefetch_patterns"] = opt.PrefetchPatterns cfg["compressor"] = opt.Compressor diff --git a/contrib/nydusify/pkg/converter/converter.go b/contrib/nydusify/pkg/converter/converter.go index 4629b96a449..49a5a36bd89 100644 --- a/contrib/nydusify/pkg/converter/converter.go +++ b/contrib/nydusify/pkg/converter/converter.go @@ -45,6 +45,7 @@ type Opt struct { BatchSize string PrefetchPatterns string OCIRef bool + WithReferrer bool AllPlatforms bool Platforms string