func (r *LambdaDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { ld := &LambdaDeployment{} err := r.Get(ctx, req.NamespacedName, ld) switch e := err; { case apierrors.IsNotFound(e): // This corresponds to a DELETE action so we can ignore it log.Println("LambdaDeployment is deleted... Doing nothing?") return ctrl.Result{}, nil case e != nil: log.Printf("Could not GET the LambdaDeployment: %s", err) return ctrl.Result{}, nil } // This is the "lambda.Client" from "github.com/aws/aws-sdk-go-v2/service/lambda" _, err = r.LambdaClient.UpdateFunctionCode(ctx, &lambda.UpdateFunctionCodeInput{ FunctionName: &ld.Spec.FunctionARN, // The ARN is the input to "FunctionName" parameter confusingly S3Bucket: "lambda-zips", S3Key: fmt.Sprintf("%s/%s.zip", ld.Spec.FunctionName, ld.Spec.Commit), }) return ctrl.Result{}, nil }