Skip to content

Commit 8eaeb5a

Browse files
authored
fix: knative deployer should choose last built image by default (#3100)
1 parent e17167d commit 8eaeb5a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/knative/deployer.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ func (d *Deployer) Deploy(ctx context.Context, f fn.Function) (fn.DeploymentResu
144144
return fn.DeploymentResult{}, fmt.Errorf("deployer requires either a target namespace or that the function be already deployed")
145145
}
146146

147+
// Choosing an image to deploy:
148+
// If the service has not been deployed before, but there exists a
149+
// build image, this build image should be used for the deploy.
150+
// TODO: test/consdier the case where it HAS been deployed, and the
151+
// build image has been updated /since/ deployment: do we need a
152+
// timestamp? Incrementation?
153+
if f.Deploy.Image == "" {
154+
f.Deploy.Image = f.Build.Image
155+
}
156+
147157
// Clients
148158
client, err := NewServingClient(namespace)
149159
if err != nil {

0 commit comments

Comments
 (0)