Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/crane/rebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ some compiler expected by the uppermost app layers, the resulting rebased image
might be invalid.

In general, it's a good practice to tag rebased images to some other tag than
the `original` tag, perform some sanity checks, then tag the image to the
the `original` tag, perform some confidence checks, then tag the image to the
`original` tag once it's determined the image is valid.

There is ongoing work to standardize and advertise base image contract
Expand Down
14 changes: 14 additions & 0 deletions pkg/v1/remote/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,20 @@ func (p *Pusher) writer(ctx context.Context, repo name.Repository, o *options) (
return rw, rw.init(ctx)
}

func (p *Pusher) Put(ctx context.Context, ref name.Reference, t Taggable) error {
w, err := p.writer(ctx, ref.Context(), p.o)
if err != nil {
return err
}

m, err := taggableToManifest(t)
if err != nil {
return err
}

return w.commitManifest(ctx, ref, m)
}

func (p *Pusher) Push(ctx context.Context, ref name.Reference, t Taggable) error {
w, err := p.writer(ctx, ref.Context(), p.o)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,5 +709,5 @@ func Put(ref name.Reference, t Taggable, options ...Option) error {
if err != nil {
return err
}
return newPusher(o).Push(o.context, ref, t)
return newPusher(o).Put(o.context, ref, t)
}
24 changes: 12 additions & 12 deletions pkg/v1/remote/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ func TestScopesForUploadingImage(t *testing.T) {
if err != nil {
t.Fatalf("img.Layers() = %v", err)
}
dummyLayer := layers[0]
wokeLayer := layers[0]

testCases := []struct {
name string
Expand All @@ -1122,7 +1122,7 @@ func TestScopesForUploadingImage(t *testing.T) {
reference: referenceToUpload,
layers: []v1.Layer{
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: sameReference,
},
},
Expand All @@ -1135,7 +1135,7 @@ func TestScopesForUploadingImage(t *testing.T) {
reference: referenceToUpload,
layers: []v1.Layer{
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo1,
},
},
Expand All @@ -1149,11 +1149,11 @@ func TestScopesForUploadingImage(t *testing.T) {
reference: referenceToUpload,
layers: []v1.Layer{
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo1,
},
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo1,
},
},
Expand All @@ -1167,11 +1167,11 @@ func TestScopesForUploadingImage(t *testing.T) {
reference: referenceToUpload,
layers: []v1.Layer{
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo1,
},
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo2,
},
},
Expand All @@ -1186,19 +1186,19 @@ func TestScopesForUploadingImage(t *testing.T) {
reference: referenceToUpload,
layers: []v1.Layer{
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo1,
},
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo2,
},
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo1,
},
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: anotherRepo2,
},
},
Expand All @@ -1213,7 +1213,7 @@ func TestScopesForUploadingImage(t *testing.T) {
reference: referenceToUpload,
layers: []v1.Layer{
&MountableLayer{
Layer: dummyLayer,
Layer: wokeLayer,
Reference: repoOnOtherRegistry,
},
},
Expand Down