Skip to content

Commit

Permalink
remove PackManifestTypeImageV1_1_0_RC2
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
  • Loading branch information
qweeah committed Aug 9, 2023
1 parent 157c4f9 commit 09755f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions cmd/oras/internal/option/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import (
)

const (
v1_1 = "1.1"
V1_0 = "1.0"
v1_1 = "1.1"
v1_0 = "1.0"
PackManifestTypeImageV1_0 = 0
)

// ImageSpec option struct.
Expand All @@ -38,8 +39,8 @@ func (opts *ImageSpec) Parse() error {
switch opts.flag {
case v1_1:
opts.PackType = oras.PackManifestTypeImageV1_1_0_RC4
case V1_0:
opts.PackType = oras.PackManifestTypeImageV1_1_0_RC2
case v1_0:
opts.PackType = PackManifestTypeImageV1_0
default:
return fmt.Errorf("unknown image specification flag: %q", opts.flag)
}
Expand All @@ -48,7 +49,7 @@ func (opts *ImageSpec) Parse() error {

// ApplyFlags applies flags to a command flag set.
func (opts *ImageSpec) ApplyFlags(fs *pflag.FlagSet) {
fs.StringVar(&opts.flag, "image-spec", v1_1, fmt.Sprintf("[Experimental] specify manifest type for building artifact. options: %s, %s", v1_1, V1_0))
fs.StringVar(&opts.flag, "image-spec", v1_1, fmt.Sprintf("[Experimental] specify manifest type for building artifact. options: %s, %s", v1_1, v1_0))
}

// distributionSpec option struct.
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Example - Push file "hi.txt" into an OCI image layout folder 'layout-dir' with t
return err
}

if opts.ImageSpec.PackType == oras.PackManifestTypeImageV1_1_0_RC2 && opts.manifestConfigRef != "" && opts.artifactType != "" {
if opts.ImageSpec.PackType == option.PackManifestTypeImageV1_0 && opts.manifestConfigRef != "" && opts.artifactType != "" {
return errors.New("--artifact-type and --config cannot both be provided for 1.0 OCI image")
}
return nil
Expand Down

0 comments on commit 09755f2

Please sign in to comment.