Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  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{})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement