From 7cddf350e30febd3781ef69fd4c94a6ab5ffeff5 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 6 Mar 2023 18:24:32 +0900 Subject: [PATCH] Use constant to define restart policy ... instead hard-coding the string in our own logic. --- pkg/keystone/bootstrap.go | 2 +- pkg/keystone/dbsync.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/keystone/bootstrap.go b/pkg/keystone/bootstrap.go index 9d056f26..7736f08b 100644 --- a/pkg/keystone/bootstrap.go +++ b/pkg/keystone/bootstrap.go @@ -78,7 +78,7 @@ func BootstrapJob( Annotations: annotations, }, Spec: corev1.PodSpec{ - RestartPolicy: "OnFailure", + RestartPolicy: corev1.RestartPolicyOnFailure, ServiceAccountName: ServiceAccount, Containers: []corev1.Container{ { diff --git a/pkg/keystone/dbsync.go b/pkg/keystone/dbsync.go index a3f5a71b..0b1dfe97 100644 --- a/pkg/keystone/dbsync.go +++ b/pkg/keystone/dbsync.go @@ -62,7 +62,7 @@ func DbSyncJob( Annotations: annotations, }, Spec: corev1.PodSpec{ - RestartPolicy: "OnFailure", + RestartPolicy: corev1.RestartPolicyOnFailure, ServiceAccountName: ServiceAccount, Containers: []corev1.Container{ {