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 (
9
9
"k8s.io/apimachinery/pkg/runtime"
10
10
"k8s.io/kubectl/pkg/util/podutils"
11
11
12
+ "github.com/argoproj/gitops-engine/pkg/sync/common"
12
13
"github.com/argoproj/gitops-engine/pkg/utils/kube"
13
14
)
14
15
15
- const (
16
- AnnotationIgnoreRestartPolicy = "argocd.argoproj.io/ignore-restart-policy"
17
- )
18
-
19
16
func getPodHealth (obj * unstructured.Unstructured ) (* HealthStatus , error ) {
20
17
gvk := obj .GroupVersionKind ()
21
18
switch gvk {
@@ -123,7 +120,7 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) {
123
120
}, nil
124
121
}
125
122
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 {
127
124
return getHealthStatus (pod )
128
125
}
129
126
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ const (
17
17
// AnnotationKeyHookDeletePolicy is the policy of deleting a hook
18
18
AnnotationKeyHookDeletePolicy = "argocd.argoproj.io/hook-delete-policy"
19
19
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"
20
23
21
24
// Sync option that disables dry run in resource is missing in the cluster
22
25
SyncOptionSkipDryRunOnMissingResource = "SkipDryRunOnMissingResource=true"
You can’t perform that action at this time.
0 commit comments