From 488c7b90bfe30e7a61d15807fa399daf948932e7 Mon Sep 17 00:00:00 2001 From: loveuer Date: Thu, 13 Nov 2025 14:49:18 +0800 Subject: [PATCH] fix: preserve Service spec fields including NodePort information --- internal/module/k8s/handler.resource.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/module/k8s/handler.resource.go b/internal/module/k8s/handler.resource.go index 42a911e..5b02e09 100644 --- a/internal/module/k8s/handler.resource.go +++ b/internal/module/k8s/handler.resource.go @@ -581,6 +581,7 @@ func K8sResourceFetch(ctx context.Context, db *gorm.DB, store store.Store) fiber service.CreationTimestamp = metav1.Time{} service.SelfLink = "" service.Generation = 0 + // Don't clean spec fields as they contain important information like NodePort yamlData, err = yaml.Marshal(service) case "ConfigMap": var configmap *corev1.ConfigMap