From 17b830992d930623d18656a55504801ecaa19091 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 23 Sep 2021 12:38:05 +1000 Subject: [PATCH] fix: minor typos and fixes --- handlers/paused.go | 5 ++--- main.go | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/handlers/paused.go b/handlers/paused.go index 1e3352f..6c952b6 100644 --- a/handlers/paused.go +++ b/handlers/paused.go @@ -36,15 +36,14 @@ func NewCleanup(client client.Client, enableDebug bool) *Cleanup { // upload their certificate to fastly and will unpause them to allow them to retry // after 5 attempts it will give up func (h *Cleanup) CheckPausedCertStatus() { - fmt.Println("paused") opLog := ctrl.Log.WithName("handlers").WithName("PausedCertStatusCheck") namespaces := &corev1.NamespaceList{} if err := h.Client.List(context.Background(), namespaces); err != nil { - opLog.Error(err, fmt.Sprintf("Unable to list namespaces created by Lagoon, there may be none or something went wrong")) + opLog.Error(err, fmt.Sprintf("Unable to list namespaces, there may be none or something went wrong")) return } for _, ns := range namespaces.Items { - opLog.Info(fmt.Sprintf("Checking LagoonBuilds in namespace %s", ns.ObjectMeta.Name)) + opLog.Info(fmt.Sprintf("Checking ingresses in namespace %s", ns.ObjectMeta.Name)) ingresses := &networkv1beta1.IngressList{} listOption := (&client.ListOptions{}).ApplyOptions([]client.ListOption{ client.InNamespace(ns.ObjectMeta.Name), diff --git a/main.go b/main.go index f8c6975..3e8eb5d 100644 --- a/main.go +++ b/main.go @@ -72,7 +72,7 @@ func main() { fastlyAPIToken = getEnv("FASTLY_API_TOKEN", fastlyAPIToken) fastlyPlatformTLSConfiguration = getEnv("FASTLY_PLATFORM_TLS_CONFIGURATION_ID", fastlyPlatformTLSConfiguration) clusterName = getEnv("CLUSTER_NAME", clusterName) - enablePausedStatusCron = getEnvBool("ENABEL_PAUSED_STATUS_CRON", enablePausedStatusCron) + enablePausedStatusCron = getEnvBool("ENABLE_PAUSED_STATUS_CRON", enablePausedStatusCron) pausedStatusCron = getEnv("PAUSED_STATUS_CRON", pausedStatusCron) if fastlyAPIToken == "" { @@ -108,14 +108,15 @@ func main() { true, ) c := cron.New() - setupLog.Info("setting paused status check cron") // use cron to run a paused status check // this will check any `Ingress` resources for the paused status // and attempt to unpause them if enablePausedStatusCron { + setupLog.Info("setting paused status check cron") // use cron to run a paused status check c.AddFunc(pausedStatusCron, func() { resourceCleanup.CheckPausedCertStatus() }) } + c.Start() // +kubebuilder:scaffold:builder