Fixed formatting errors with push.go and push_test.go
This commit is contained in:
parent
a0651436b5
commit
c8f089fdbb
|
|
@ -96,7 +96,7 @@ func CheckPushPermissions(opts *config.KanikoOptions) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDigest(image v1.Image) ([]byte, error){
|
func getDigest(image v1.Image) ([]byte, error) {
|
||||||
digest, err := image.Digest()
|
digest, err := image.Digest()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -205,19 +205,19 @@ func TestImageNameDigestFile(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := config.KanikoOptions{
|
opts := config.KanikoOptions{
|
||||||
NoPush: true,
|
NoPush: true,
|
||||||
Destinations: []string{"gcr.io/foo/bar:latest", "bob/image"},
|
Destinations: []string{"gcr.io/foo/bar:latest", "bob/image"},
|
||||||
ImageNameDigestFile: "tmpFile",
|
ImageNameDigestFile: "tmpFile",
|
||||||
}
|
}
|
||||||
|
|
||||||
defer os.Remove("tmpFile")
|
defer os.Remove("tmpFile")
|
||||||
|
|
||||||
if err := DoPush(image, &opts); err != nil {
|
if err := DoPush(image, &opts); err != nil {
|
||||||
t.Fatalf("could not push image: %s", err)
|
t.Fatalf("could not push image: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
want := []byte("gcr.io/foo/bar@" + digest.String() + "\nindex.docker.io/bob/image@" + digest.String() +"\n")
|
want := []byte("gcr.io/foo/bar@" + digest.String() + "\nindex.docker.io/bob/image@" + digest.String() + "\n")
|
||||||
|
|
||||||
got, err := ioutil.ReadFile("tmpFile")
|
got, err := ioutil.ReadFile("tmpFile")
|
||||||
|
|
||||||
testutil.CheckErrorAndDeepEqual(t, false, err, want, got)
|
testutil.CheckErrorAndDeepEqual(t, false, err, want, got)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue