From 0d5549689e8bf5f0427d340f13836dd3a5412c65 Mon Sep 17 00:00:00 2001 From: Ilya Bumarskov Date: Tue, 23 Nov 2021 16:44:43 +0400 Subject: [PATCH] Fix formatting --- .../zookeeper/v1beta1/zookeeperbackup_types.go | 6 +++--- .../zookeeperbackup_controller.go | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/apis/zookeeper/v1beta1/zookeeperbackup_types.go b/pkg/apis/zookeeper/v1beta1/zookeeperbackup_types.go index a796c635e..493f822cf 100644 --- a/pkg/apis/zookeeper/v1beta1/zookeeperbackup_types.go +++ b/pkg/apis/zookeeper/v1beta1/zookeeperbackup_types.go @@ -15,15 +15,15 @@ type ZookeeperBackupSpec struct { // Name of the ZookeeperCluster to backup // +kubebuilder:validation:Required - ZookeeperCluster string `json:"zookeeperCluster"` + ZookeeperCluster string `json:"zookeeperCluster"` // Schedule in Cron format // +kubebuilder:default:="0 0 */1 * *" // +optional - Schedule string `json:"schedule,omitempty"` + Schedule string `json:"schedule,omitempty"` // Number of backups to store // +kubebuilder:default:="7" // +optional - BackupsToKeep string `json:"backupsToKeep,omitempty"` + BackupsToKeep string `json:"backupsToKeep,omitempty"` // Data Storage Capacity // +kubebuilder:default:="1Gi" // +optional diff --git a/pkg/controller/zookeeperbackup/zookeeperbackup_controller.go b/pkg/controller/zookeeperbackup/zookeeperbackup_controller.go index 743d00b0a..01d79f1ac 100644 --- a/pkg/controller/zookeeperbackup/zookeeperbackup_controller.go +++ b/pkg/controller/zookeeperbackup/zookeeperbackup_controller.go @@ -97,7 +97,7 @@ type ReconcileZookeeperBackup struct { // that reads objects from the cache and writes to the apiserver client client.Client scheme *runtime.Scheme - log logr.Logger + log logr.Logger } // Reconcile reads that state of the cluster for a ZookeeperBackup object and makes changes based on the state read @@ -272,7 +272,7 @@ func (r *ReconcileZookeeperBackup) GetLeaderIP(zkCluster *zookeeperv1beta1.Zooke return "", err } - adminIp := foundSvcAdmin.Spec.ClusterIP + adminIp := foundSvcAdmin.Spec.ClusterIP svcPort := GetServicePortByName(foundSvcAdmin, "tcp-admin-server") resp, err := http.Get(fmt.Sprintf("http://%s:%d/commands/leader", adminIp, svcPort.Port)) @@ -355,24 +355,24 @@ func newCronJobForCR(cr *zookeeperv1beta1.ZookeeperBackup) *batchv1beta1.CronJob }, Spec: batchv1beta1.CronJobSpec{ Schedule: cr.Spec.Schedule, - Suspend: &suspend, - JobTemplate: batchv1beta1.JobTemplateSpec { + Suspend: &suspend, + JobTemplate: batchv1beta1.JobTemplateSpec{ Spec: batchv1.JobSpec{ Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec { + Spec: corev1.PodSpec{ RestartPolicy: "Never", Containers: []corev1.Container{ { - Name: "run-zookeeperbackup", - Image: cr.Spec.Image.ToString(), + Name: "run-zookeeperbackup", + Image: cr.Spec.Image.ToString(), ImagePullPolicy: cr.Spec.Image.PullPolicy, VolumeMounts: []corev1.VolumeMount{ { - Name: "zookeeperbackup-vol", + Name: "zookeeperbackup-vol", MountPath: backupMountPath, }, { - Name: "zookeeperbackup-data", + Name: "zookeeperbackup-data", MountPath: "/data", }, },