This repository was archived by the owner on Oct 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,10 @@ import (
99 "k8s.io/apimachinery/pkg/runtime"
1010 "k8s.io/kubectl/pkg/util/podutils"
1111
12+ "github.com/argoproj/gitops-engine/pkg/sync/common"
1213 "github.com/argoproj/gitops-engine/pkg/utils/kube"
1314)
1415
15- const (
16- AnnotationIgnoreRestartPolicy = "argocd.argoproj.io/ignore-restart-policy"
17- )
18-
1916func getPodHealth (obj * unstructured.Unstructured ) (* HealthStatus , error ) {
2017 gvk := obj .GroupVersionKind ()
2118 switch gvk {
@@ -123,7 +120,7 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) {
123120 }, nil
124121 }
125122 policy := pod .Spec .RestartPolicy
126- if _ , ok := pod .Annotations [AnnotationIgnoreRestartPolicy ]; ok || policy == corev1 .RestartPolicyAlways {
123+ if _ , ok := pod .Annotations [common . AnnotationIgnoreRestartPolicy ]; ok || policy == corev1 .RestartPolicyAlways {
127124 return getHealthStatus (pod )
128125 }
129126
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ const (
1717 // AnnotationKeyHookDeletePolicy is the policy of deleting a hook
1818 AnnotationKeyHookDeletePolicy = "argocd.argoproj.io/hook-delete-policy"
1919 AnnotationDeletionApproved = "argocd.argoproj.io/deletion-approved"
20+ // AnnotationIgnoreRestartPolicy ignores restart policy, useful for operator-managed
21+ // pods to be considered healthy
22+ AnnotationIgnoreRestartPolicy = "argocd.argoproj.io/ignore-restart-policy"
2023
2124 // Sync option that disables dry run in resource is missing in the cluster
2225 SyncOptionSkipDryRunOnMissingResource = "SkipDryRunOnMissingResource=true"
You can’t perform that action at this time.
0 commit comments