Skip to content

Commit

Permalink
fix: make autoapprove csr enabled by default (#146)
Browse files Browse the repository at this point in the history
* fix: make autoapprove csr enabled by default

* remove abilty to disable it

* change log
  • Loading branch information
aldor007 authored Oct 18, 2024
1 parent 18d06bc commit 2777889
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type Config struct {
LeaderElection LeaderElection
PodName string
NodeName string
AutoApproveCSR bool
}

type Log struct {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 2777889

Please sign in to comment.