From 27778898abfc7e802be2e99abcd97f3a85534d49 Mon Sep 17 00:00:00 2001 From: Marcin Kaciuba Date: Fri, 18 Oct 2024 13:13:03 +0200 Subject: [PATCH] fix: make autoapprove csr enabled by default (#146) * fix: make autoapprove csr enabled by default * remove abilty to disable it * change log --- internal/config/config.go | 2 -- main.go | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index a244804..037eff7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -19,7 +19,6 @@ type Config struct { LeaderElection LeaderElection PodName string NodeName string - AutoApproveCSR bool } type Log struct { @@ -76,7 +75,6 @@ func Get() Config { _ = viper.BindEnv("leaderelection.leaserenewdeadline", "LEADER_ELECTION_LEASE_RENEW_DEADLINE") _ = viper.BindEnv("nodename", "KUBERNETES_NODE_NAME") _ = viper.BindEnv("podname", "KUBERNETES_POD") - _ = viper.BindEnv("autoapprovecsr", "AUTO_APPROVE_CSR") cfg = &Config{} if err := viper.Unmarshal(&cfg); err != nil { diff --git a/main.go b/main.go index 973e5dc..e8e9ea4 100644 --- a/main.go +++ b/main.go @@ -211,8 +211,8 @@ func run( log.Fatalf("failed to determine if running on GKE: %v", err) } - log.Infof("auto approve csr: %v, running on GKE: %v", cfg.AutoApproveCSR, isGKE) - if cfg.AutoApproveCSR && isGKE { + if isGKE { + log.Info("auto approve csr started as running on GKE") csrMgr := csr.NewApprovalManager(log, clientset) csrMgr.Start(ctx) }