Skip to content

Commit b4d0f2b

Browse files
authored
Only update middleware when function is deployed already (#13)
1 parent c6b4a6c commit b4d0f2b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

internal/controller/function_controller.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,8 @@ func (r *FunctionReconciler) ensureDeployment(ctx context.Context, function *v1a
233233
}
234234

235235
if !deployed {
236-
logger.Info("Function is not deployed. Deploying now")
237-
if err := r.deploy(ctx, function, repo); err != nil {
238-
function.MarkDeployNotReady("DeployFailed", "Deployment failed: %s", err.Error())
239-
return fmt.Errorf("failed to deploy function: %w", err)
240-
}
241-
function.MarkDeployReady()
236+
logger.Info("Function is not deployed")
237+
function.MarkDeployNotReady("NotDeployed", "Function not deployed yet")
242238
return nil
243239
}
244240

0 commit comments

Comments
 (0)