fix: multiple fixes + pg-query e2e passed
upload.go:
- Update → Patch (MergeFrom) to avoid resourceVersion conflict when operator
modifies Function between Get() and Update()
terraform provider v0.1.1:
- trigger_resource.go: trToModel returns StringNull() for empty schedule
(fixes 'provider produced inconsistent result' for http triggers)
- main.go: bump version to 0.1.1
examples/pg-query:
- handler.py: fix column name started_at → created_at (matches migrations/001)
- main.tf: pin provider to ~> 0.1.1
.gitignore: add terraform state, lock, .terraform/, handler.zip
doc/errors/log.md: documented all 5 errors from this session:
- resourceVersion conflict → use Patch
- terraform inconsistent result for schedule → StringNull
- terraform import not implemented → delete+recreate workaround
- wrong column name → check migrations before writing handlers
- Deployment not restarting after image rebuild → rollout restart / TODO: restartedAt annotation
doc/progress.md: terraform apply e2e ✅
This commit is contained in:
@@ -184,10 +184,14 @@ func (h *Handler) UploadCode(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Обновляем Function CRD: новый s3Key и bucket → контроллер запустит kaniko
|
||||
// Обновляем Function CRD: новый s3Key и bucket → контроллер запустит kaniko.
|
||||
// Используем Patch вместо Update чтобы избежать конфликта resourceVersion:
|
||||
// между Get() выше и Update() контроллер может изменить статус объекта.
|
||||
// MergePatch обновляет только указанные поля, не требует точного resourceVersion.
|
||||
patch := client.MergeFrom(fn.DeepCopy())
|
||||
fn.Spec.S3Key = s3Key
|
||||
fn.Spec.S3Bucket = h.S3.Bucket()
|
||||
if err := h.K8s.Update(r.Context(), fn); err != nil {
|
||||
if err := h.K8s.Patch(r.Context(), fn, patch); err != nil {
|
||||
writeJSON(w, http.StatusInternalServerError, errResp("update function: "+err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user