fix: building resets image digest (#1691)

Fixes a bug where the image digest was being cleared on a subsequent
deploy, resulting in incorrect metadata and a build stamp which was
always out-of-date (effectively disabling cached builds).
This commit is contained in:
Luke Kingland 2023-04-25 22:59:46 +09:00 committed by GitHub
parent 135dba049d
commit fd3aca35a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -430,10 +430,13 @@ func (c deployConfig) Configure(f fn.Function) (fn.Function, error) {
// ImageDigest
// Parsed off f.Image if provided. Deploying adds the ability to specify a
// digest on the associated image (not available on build as nonsensical).
f.ImageDigest, err = imageDigest(f.Image)
newDigest, err := imageDigest(f.Image)
if err != nil {
return f, err
}
if newDigest != "" {
f.ImageDigest = newDigest
}
// Envs
// Preprocesses any Envs provided (which may include removals) into a final