Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Feb 22, 2024
1 parent 690ea95 commit 4cf4aa3
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 41 deletions.
2 changes: 1 addition & 1 deletion pkg/v1/layout/layer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 The original author or authors
// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/layout/puller.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 The original author or authors
// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions pkg/v1/layout/pusher.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2019 The original author or authors
// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/partial/artifact.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 The original author or authors
// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
23 changes: 0 additions & 23 deletions pkg/v1/remote/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,10 @@ package remote

import (
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/partial"
"github.com/google/go-containerregistry/pkg/v1/types"
)

type descriptorArtifact struct {
desc Descriptor
}

func (d *descriptorArtifact) Digest() (v1.Hash, error) {
return d.desc.Digest, nil
}

func (d *descriptorArtifact) MediaType() (types.MediaType, error) {
return d.desc.MediaType, nil
}

func (d *descriptorArtifact) RawManifest() ([]byte, error) {
return d.desc.RawManifest()
}

func (d *descriptorArtifact) Size() (int64, error) {
return d.desc.Size, nil
}

var _ partial.Artifact = (*descriptorArtifact)(nil)

// Get returns a partial.Artifact for the given reference.
//
// See Head if you don't need the response body.
Expand Down
4 changes: 0 additions & 4 deletions pkg/v1/remote/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ type Descriptor struct {
platform v1.Platform
}

func (d *Descriptor) ToArtifact() partial.Artifact {
return &descriptorArtifact{desc: *d}
}

func (d *Descriptor) toDesc() v1.Descriptor {
return d.Descriptor
}
Expand Down
10 changes: 1 addition & 9 deletions pkg/v1/remote/puller.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,7 @@ func (p *puller) artifact(ctx context.Context, ref name.Reference, acceptable []
if desc.MediaType.IsImage() {
return desc.Image()
} else if desc.MediaType.IsIndex() {
idx, err := desc.ImageIndex()
if err != nil {
return nil, err
}
fmt.Println(platform.String())
if platform.String() != "" {
return idx, nil
}
return idx, nil
return desc.ImageIndex()
} else if desc.MediaType.IsSchema1() {
return desc.Schema1()
}
Expand Down

0 comments on commit 4cf4aa3

Please sign in to comment.