From ceb2bda493792f181176c2d12fa20d2e322cafec Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 3 Oct 2023 06:45:22 -0700 Subject: [PATCH] Use apply: Always for restart command (#725) Signed-off-by: Tamal Saha --- pkg/restarter/elasticsearch.go | 1 + pkg/restarter/mariadb.go | 1 + pkg/restarter/mongodb.go | 1 + pkg/restarter/mysql.go | 1 + pkg/restarter/postgres.go | 1 + pkg/restarter/redis.go | 1 + 6 files changed, 6 insertions(+) diff --git a/pkg/restarter/elasticsearch.go b/pkg/restarter/elasticsearch.go index 974d646fc..a9bc9b99b 100644 --- a/pkg/restarter/elasticsearch.go +++ b/pkg/restarter/elasticsearch.go @@ -73,6 +73,7 @@ func (e *ElasticsearchRestarter) Restart(name, namespace string) (string, error) Name: name, }, Restart: &v1alpha1.RestartSpec{}, + Apply: v1alpha1.ApplyOptionAlways, }, } _, err = e.opsClient.ElasticsearchOpsRequests(namespace).Create(context.TODO(), restartOpsRequest, metav1.CreateOptions{}) diff --git a/pkg/restarter/mariadb.go b/pkg/restarter/mariadb.go index dc966341e..00dc98514 100644 --- a/pkg/restarter/mariadb.go +++ b/pkg/restarter/mariadb.go @@ -73,6 +73,7 @@ func (e *MariaDBRestarter) Restart(name, namespace string) (string, error) { Name: name, }, Restart: &v1alpha1.RestartSpec{}, + Apply: v1alpha1.ApplyOptionAlways, }, } _, err = e.opsClient.MariaDBOpsRequests(namespace).Create(context.TODO(), restartOpsRequest, metav1.CreateOptions{}) diff --git a/pkg/restarter/mongodb.go b/pkg/restarter/mongodb.go index b7584e94d..706cf8884 100644 --- a/pkg/restarter/mongodb.go +++ b/pkg/restarter/mongodb.go @@ -73,6 +73,7 @@ func (e *MongoDBRestarter) Restart(name, namespace string) (string, error) { Name: name, }, Restart: &v1alpha1.RestartSpec{}, + Apply: v1alpha1.ApplyOptionAlways, }, } _, err = e.opsClient.MongoDBOpsRequests(namespace).Create(context.TODO(), restartOpsRequest, metav1.CreateOptions{}) diff --git a/pkg/restarter/mysql.go b/pkg/restarter/mysql.go index 93f91694e..c04a660e8 100644 --- a/pkg/restarter/mysql.go +++ b/pkg/restarter/mysql.go @@ -74,6 +74,7 @@ func (e *MySQLRestarter) Restart(name, namespace string) (string, error) { Name: name, }, Restart: &v1alpha1.RestartSpec{}, + Apply: v1alpha1.ApplyOptionAlways, }, } _, err = e.opsClient.MySQLOpsRequests(namespace).Create(context.TODO(), restartOpsRequest, metav1.CreateOptions{}) diff --git a/pkg/restarter/postgres.go b/pkg/restarter/postgres.go index ef48a8bf0..2f4fc746c 100644 --- a/pkg/restarter/postgres.go +++ b/pkg/restarter/postgres.go @@ -73,6 +73,7 @@ func (e *PostgresRestarter) Restart(name, namespace string) (string, error) { Name: name, }, Restart: &v1alpha1.RestartSpec{}, + Apply: v1alpha1.ApplyOptionAlways, }, } _, err = e.opsClient.PostgresOpsRequests(namespace).Create(context.TODO(), restartOpsRequest, metav1.CreateOptions{}) diff --git a/pkg/restarter/redis.go b/pkg/restarter/redis.go index d850c11b1..f5e8cc3b7 100644 --- a/pkg/restarter/redis.go +++ b/pkg/restarter/redis.go @@ -73,6 +73,7 @@ func (e *RedisRestarter) Restart(name, namespace string) (string, error) { Name: name, }, Restart: &v1alpha1.RestartSpec{}, + Apply: v1alpha1.ApplyOptionAlways, }, } _, err = e.opsClient.RedisOpsRequests(namespace).Create(context.TODO(), restartOpsRequest, metav1.CreateOptions{})