From 86b5ff47e50249ef278a17f98bbcf6c640388dc1 Mon Sep 17 00:00:00 2001 From: KubeKyrie Date: Wed, 28 Aug 2024 18:17:24 +0800 Subject: [PATCH] fix kubean manifest helm keep policy Signed-off-by: KubeKyrie --- artifacts/cr_template.py | 3 +++ pkg/controllers/infomanifest/controller.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/artifacts/cr_template.py b/artifacts/cr_template.py index eded6109d..fd54a06aa 100644 --- a/artifacts/cr_template.py +++ b/artifacts/cr_template.py @@ -58,10 +58,13 @@ class CR_Template: kubean.io/sprayTimestamp: "{{ sprayInfo.sprayCommitTimestamp }}" kubean.io/sprayRelease: "{{ sprayInfo.sprayRlease }}" kubean.io/sprayCommit: "{{ sprayInfo.sprayCommitShort }}" + helm.sh/resource-policy: keep {%- else %} name: "manifest-{{ kubeanTag|replace('.', '-') }}" labels: kubean.io/sprayRelease: master + annotations: + helm.sh/resource-policy: keep {%- endif %} spec: kubesprayVersion: "{{ sprayInfo.sprayCommit }}" diff --git a/pkg/controllers/infomanifest/controller.go b/pkg/controllers/infomanifest/controller.go index 87b9e3a34..98caf877a 100644 --- a/pkg/controllers/infomanifest/controller.go +++ b/pkg/controllers/infomanifest/controller.go @@ -191,6 +191,9 @@ func (c *Controller) UpdateLocalService(manifests []manifestv1alpha1.Manifest) b // UpdateLocalAvailableImage update image infos into status. func (c *Controller) UpdateLocalAvailableImage(manifests []manifestv1alpha1.Manifest) { imageRepo := util.FetchKubeanConfigProperty(c.ClientSet).SprayJobImageRegistry + if imageRepo == "" { + imageRepo = "ghcr.m.daocloud.io" + } for _, manifest := range manifests { var newImageName string sprayRelease := manifest.ObjectMeta.Annotations[constants.KeySprayRelease]