From b444d7d5076f7f15c501e00f17622e754c7fe688 Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Wed, 16 Jan 2019 13:07:29 -0500 Subject: [PATCH] Handle additional cleanups from prior PR Update comment and streamline getting the default platform spec Signed-off-by: Phil Estes --- images/oci/exporter.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/images/oci/exporter.go b/images/oci/exporter.go index 50b42c56e..8bb535489 100644 --- a/images/oci/exporter.go +++ b/images/oci/exporter.go @@ -41,7 +41,7 @@ type V1Exporter struct { AllPlatforms bool } -// V1ExporterOpt allows to set additional options to a newly V1Exporter +// V1ExporterOpt allows the caller to set additional options to a new V1Exporter type V1ExporterOpt func(c *V1Exporter) error // DefaultV1Exporter return a default V1Exporter pointer @@ -91,11 +91,7 @@ func (oe *V1Exporter) Export(ctx context.Context, store content.Provider, desc o if !oe.AllPlatforms { // get local default platform to fetch image manifest - p, err := platforms.Parse(platforms.DefaultString()) - if err != nil { - return errors.Wrapf(err, "invalid platform %s", platforms.DefaultString()) - } - childrenHandler = images.FilterPlatforms(childrenHandler, platforms.Any(p)) + childrenHandler = images.FilterPlatforms(childrenHandler, platforms.Any(platforms.DefaultSpec())) } handlers := images.Handlers(