fix: redeploy now sends CFS params from YAML (RunRedeployOperation + template + loader)
This commit is contained in:
@@ -4,7 +4,7 @@ TOKEN_FILE="secrets/dev.token"
|
||||
|
||||
# Release versions
|
||||
# Version
|
||||
VERSION="3.1.10"
|
||||
VERSION="3.1.11"
|
||||
|
||||
# Registry/S3 settings
|
||||
REGISTRY_HOST="registry.kube5s.ru"
|
||||
|
||||
@@ -4,7 +4,7 @@ TOKEN_FILE="secrets/prod.token"
|
||||
|
||||
# Release versions
|
||||
# Version
|
||||
VERSION="2.1.9"
|
||||
VERSION="2.1.10"
|
||||
|
||||
# Registry/S3 settings
|
||||
REGISTRY_HOST="registry.kube5s.ru"
|
||||
|
||||
@@ -3,7 +3,7 @@ NUBES_API_ENDPOINT="https://lk-api-gateway-test.ngcloud.ru/api/v1/svc"
|
||||
TOKEN_FILE="secrets/test.token"
|
||||
|
||||
# Version
|
||||
VERSION="5.1.12"
|
||||
VERSION="5.1.13"
|
||||
|
||||
# Docs generation — ONLY from docs_gen/<stand>/ (never from docs/)
|
||||
DOCS_GEN_DIR="provider/docs_gen/test"
|
||||
|
||||
@@ -120,6 +120,7 @@ func LoadSpecs(dir string) ([]types.GenResource, []types.GenSubresource, []types
|
||||
switch op.Action {
|
||||
case "redeploy":
|
||||
gr.HasRedeploy = true
|
||||
gr.RedeployParams = ConvertParams(op.Params)
|
||||
case "restart", "recovery", "reconcile":
|
||||
// Исключены
|
||||
default:
|
||||
|
||||
@@ -548,8 +548,20 @@ func (r *{{ToCamel .Name}}Resource) Update(ctx context.Context, req resource.Upd
|
||||
{{- if .HasRedeploy }}
|
||||
// --- Redeploy support (ARCHITECTURE.md) ---
|
||||
if redeployRequested {
|
||||
// Вызываем redeploy — пустой params (операция не требует CFS-параметров)
|
||||
if err := r.client.RunRedeployOperation(ctx, instanceID.ValueString(), operationTimeout); err != nil {
|
||||
{{- if .RedeployParams }}
|
||||
redeployParams := map[int]string{
|
||||
{{- range .RedeployParams }}
|
||||
{{- if (IsNested .) }}
|
||||
if plan.{{ToCamel .Code}} != nil {
|
||||
redeployParams[{{.ID}}] = {{NestedJSONExpr . "plan"}}
|
||||
}
|
||||
{{- else }}
|
||||
{{.ID}}: {{ParamFormat . (printf "plan.%s" (ToCamel .Code))}},
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
}
|
||||
{{- end }}
|
||||
if err := r.client.RunRedeployOperation(ctx, instanceID.ValueString(), operationTimeout{{if .RedeployParams}}, redeployParams{{end}}); err != nil {
|
||||
resp.Diagnostics.AddError("Ошибка клиента", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ type GenResource struct {
|
||||
// Правило из ARCHITECTURE.md: только redeploy включается как inline action.
|
||||
// restart, recovery, reconcile — исключены (ручные операции, только UI).
|
||||
HasRedeploy bool
|
||||
// RedeployParams — параметры redeploy-операции (если есть).
|
||||
RedeployParams []Param
|
||||
// NeedsJsonPlanMod: хотя бы один атрибут имеет data_type: json.
|
||||
// Управляет добавлением импорта planmodifier в сгенерированный файл.
|
||||
NeedsJsonPlanMod bool
|
||||
|
||||
Reference in New Issue
Block a user