Skip to content
Open
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
3 changes: 3 additions & 0 deletions pkg/functions/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,9 @@ func (f Function) ImageNameWithDigest(newDigest string) string {
return f.Build.Image
}
image := f.Build.Image
if image == "" {
return ""
}
Comment on lines 864 to +867

// overwrite current digest
shaIndex := strings.Index(image, "@sha256:")
Expand Down
5 changes: 5 additions & 0 deletions pkg/functions/function_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func TestFunction_ImageWithDigest(t *testing.T) {
fields: fields{Image: "image-registry.openshift-image-registry.svc.cluster.local:50000/default/bar@sha256:42", ImageDigest: ""},
want: "image-registry.openshift-image-registry.svc.cluster.local:50000/default/bar@sha256:42",
},
{
name: "Empty image with digest",
fields: fields{Image: "", ImageDigest: "sha256:42"},
want: "",
},
}
//TODO: gauron99 - this is gonna need to be changed (probably) because:
// 1: imageDigest now doesn't have a dedicated structure member (resolved?)
Expand Down
Loading