Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update failing test expectations and fix typos
Browse files Browse the repository at this point in the history
Signed-off-by: Garrett Cheadle <[email protected]>
cari-lynn committed Aug 26, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3d74e40 commit e43b985
Showing 6 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions pkg/kbld/config/config.go
Original file line number Diff line number Diff line change
@@ -68,13 +68,13 @@ type ImageOverride struct {
NewImage string `json:"newImage"`
Preresolved bool `json:"preresolved,omitempty"`
TagSelection *versions.VersionSelection `json:"tagSelection,omitempty"`
ImageMetas []ImageMeta
ImageMetas []ImageMeta `json:",omitempty"`
}

type ImageMeta struct {
URL string `json:"URL"`
Type string `json:"Type"`
Tag string `json:"Tag"`
URL string `json:"URL,omitempty"`
Type string `json:"Type,omitempty"`
Tag string `json:"Tag,omitempty"`
}

type ImageDestination struct {
3 changes: 1 addition & 2 deletions pkg/kbld/image/preresolved.go
Original file line number Diff line number Diff line change
@@ -28,8 +28,7 @@ func (i PreresolvedImage) URL() (string, []Meta, error) {
if len(i.metas) > 0 {
var givenMetas []Meta
for _, m := range i.metas {
//TODO: should we change Type to 'preresolved' or keep whatever is given from lockfile?
givenMetas = append(givenMetas, PreresolvedImageSourceURL{Type: m.Type, URL: m.URL, Tag: m.Tag})
givenMetas = append(givenMetas, PreresolvedImageSourceURL{Type: "preresolved", URL: m.URL, Tag: m.Tag})
}
return i.url, givenMetas, nil
}
2 changes: 1 addition & 1 deletion pkg/kbld/image/resolved.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import (
ctlreg "github.com/k14s/kbld/pkg/kbld/registry"
)

// ResolvedImage respresents an image that will be resolved into url+digest
// ResolvedImage represents an image that will be resolved into url+digest
type ResolvedImage struct {
url string
registry ctlreg.Registry
2 changes: 1 addition & 1 deletion pkg/kbld/image/tag_selected.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
versions "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions/v1alpha1"
)

// TagSelectedImage respresents an image that will be resolved into url+digest
// TagSelectedImage represents an image that will be resolved into url+digest
type TagSelectedImage struct {
url string
selection *versions.VersionSelection
2 changes: 1 addition & 1 deletion pkg/kbld/image/tagged.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (
ctlreg "github.com/k14s/kbld/pkg/kbld/registry"
)

// TaggedImage respresents an image that will be tagged when its URL is requested
// TaggedImage represents an image that will be tagged when its URL is requested
type TaggedImage struct {
image Image
imgDst ctlconf.ImageDestination
5 changes: 2 additions & 3 deletions test/e2e/lock_output_test.go
Original file line number Diff line number Diff line change
@@ -20,14 +20,14 @@ images:
kbld.carvel.dev/id: nginx:1.14.2
kbld.carvel.dev/metas: |
- Tag: 1.14.2
Type: resolved
Type: preresolved
URL: nginx:1.14.2
image: index.docker.io/library/nginx@sha256:f7988fb6c02e0ce69257d9bd9cf37ae20a60f1df7563c3a2a6abe24160306b8d
- annotations:
kbld.carvel.dev/id: sample-app
kbld.carvel.dev/metas: |
- Tag: 1.15.1
Type: resolved
Type: preresolved
URL: nginx:1.15.1
image: index.docker.io/library/nginx@sha256:4a5573037f358b6cdfa2f3e8a9c33a5cf11bcd1675ca72ca76fbe5bd77d0d682
kind: ImagesLock
@@ -233,7 +233,6 @@ images:
})

expectedOut := `---
---
images:
- image: index.docker.io/library/nginx@sha256:f7988fb6c02e0ce69257d9bd9cf37ae20a60f1df7563c3a2a6abe24160306b8d
- image: index.docker.io/library/nginx@sha256:4a5573037f358b6cdfa2f3e8a9c33a5cf11bcd1675ca72ca76fbe5bd77d0d682

0 comments on commit e43b985

Please sign in to comment.