SHARE
TWEET

Untitled

a guest Aug 21st, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/cmd/controller/main.go b/cmd/controller/main.go
  2. index 537513c..347dfe2 100644
  3. --- a/cmd/controller/main.go
  4. +++ b/cmd/controller/main.go
  5. @@ -29,10 +29,11 @@ import (
  6.  )
  7.  
  8.  var (
  9. -       keyName  = flag.String("key-name", "sealed-secrets-key", "Name of Secret containing public/private key.")
  10. -       keySize  = flag.Int("key-size", 4096, "Size of encryption key.")
  11. -       validFor = flag.Duration("key-ttl", 10*365*24*time.Hour, "Duration that certificate is valid for.")
  12. -       myCN     = flag.String("my-cn", "", "CN to use in generated certificate.")
  13. +       keyName   = flag.String("key-name", "sealed-secrets-key", "Name of Secret containing public/private key.")
  14. +       keySize   = flag.Int("key-size", 4096, "Size of encryption key.")
  15. +       namespace = flag.String("namespace", "kube-system", "Namespace")
  16. +       validFor  = flag.Duration("key-ttl", 10*365*24*time.Hour, "Duration that certificate is valid for.")
  17. +       myCN      = flag.String("my-cn", "", "CN to use in generated certificate.")
  18.  )
  19.  
  20.  func init() {
  21. @@ -190,7 +191,11 @@ func main2() error {
  22.                 return err
  23.         }
  24.  
  25. -       ssinformer := ssinformers.NewSharedInformerFactory(ssclient, 0)
  26. +       if ns := os.Getenv("POD_NAMESPACE"); ns != "" && *namespace == "" {
  27. +               namespace = &ns
  28. +       }
  29. +
  30. +       ssinformer := ssinformers.NewFilteredSharedInformerFactory(ssclient, 0, *namespace, nil)
  31.         controller := NewController(clientset, ssinformer, privKey)
  32.  
  33.         stop := make(chan struct{})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top