fix: modify only if hasServiceParamChanges (skip when git_revision only), bump TEST 5.1.16

This commit is contained in:
“Naeel”
2026-07-20 10:30:19 +04:00
parent d05456c4f9
commit 757aa2de98
5 changed files with 29 additions and 35 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ locals {
pg_db_name = "db4crudpg" pg_db_name = "db4crudpg"
# ─── Lucee ─────────────────────────────────────────────────────────────── # ─── Lucee ───────────────────────────────────────────────────────────────
lucee_git_revision = "94e14" lucee_git_revision = "94d"
lucee_resource_name = "luceeresource" lucee_resource_name = "luceeresource"
lucee_domain = "tflucee" lucee_domain = "tflucee"
lucee_version = "5.4" lucee_version = "5.4"
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
nubes = { nubes = {
source = "registry.kube5s.ru/nubes-test/nubes" source = "registry.kube5s.ru/nubes-test/nubes"
version = "5.1.13" version = "5.1.15"
} }
} }
} }
+1 -1
View File
@@ -3,7 +3,7 @@ NUBES_API_ENDPOINT="https://lk-api-gateway-test.ngcloud.ru/api/v1/svc"
TOKEN_FILE="secrets/test.token" TOKEN_FILE="secrets/test.token"
# Version # Version
VERSION="5.1.15" VERSION="5.1.16"
# Docs generation — ONLY from docs_gen/<stand>/ (never from docs/) # Docs generation — ONLY from docs_gen/<stand>/ (never from docs/)
DOCS_GEN_DIR="provider/docs_gen/test" DOCS_GEN_DIR="provider/docs_gen/test"
@@ -547,32 +547,8 @@ func (r *{{ToCamel .Name}}Resource) Update(ctx context.Context, req resource.Upd
{{- if .HasRedeploy }} {{- if .HasRedeploy }}
// --- Redeploy support (ARCHITECTURE.md) --- // --- Redeploy support (ARCHITECTURE.md) ---
if redeployRequested { // 1. Modify — только если изменились параметры сервиса
redeployParams := map[int]string{} if hasServiceParamChanges {
{{- range .RedeployParams }}
{{- if (IsNested .) }}
if plan.{{ToCamel .Code}} != nil {
redeployParams[{{.ID}}] = {{NestedJSONExpr . "plan"}}
}
{{- else }}
redeployParams[{{.ID}}] = {{ParamFormat . (printf "plan.%s" (ToCamel .Code))}}
{{- end }}
{{- end }}
// Merge modify-params into redeploy to avoid state drift
{{- range .ModifyParams }}
{{- if (IsNested .) }}
if plan.{{ToCamel .Code}} != nil {
redeployParams[{{.ID}}] = {{NestedJSONExpr . "plan"}}
}
{{- else }}
redeployParams[{{.ID}}] = {{ParamFormat . (printf "plan.%s" (ToCamel .Code))}}
{{- end }}
{{- end }}
if err := r.client.RunRedeployOperation(ctx, instanceID.ValueString(), operationTimeout, redeployParams); err != nil {
resp.Diagnostics.AddError("Ошибка клиента", err.Error())
return
}
} else {
{{- end }} {{- end }}
params := map[int]string{ params := map[int]string{
{{- range .ModifyParams }} {{- range .ModifyParams }}
@@ -594,6 +570,24 @@ func (r *{{ToCamel .Name}}Resource) Update(ctx context.Context, req resource.Upd
} }
{{- if .HasRedeploy }} {{- if .HasRedeploy }}
} }
// 2. Redeploy — только если изменился git_revision
if redeployRequested {
redeployParams := map[int]string{}
{{- range .RedeployParams }}
{{- if (IsNested .) }}
if plan.{{ToCamel .Code}} != nil {
redeployParams[{{.ID}}] = {{NestedJSONExpr . "plan"}}
}
{{- else }}
redeployParams[{{.ID}}] = {{ParamFormat . (printf "plan.%s" (ToCamel .Code))}}
{{- end }}
{{- end }}
if err := r.client.RunRedeployOperation(ctx, instanceID.ValueString(), operationTimeout, redeployParams); err != nil {
resp.Diagnostics.AddError("Ошибка клиента", err.Error())
return
}
}
{{- end }} {{- end }}
plan.ID = instanceID plan.ID = instanceID
Submodule tfluceecrud updated: 7b6ab4c8b7...f5a2b23258