-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add namespace flag #78
Conversation
cmd/flagger/main.go
Outdated
flaggerInformerFactory := informers.NewSharedInformerFactory(flaggerClient, time.Second*30) | ||
var flaggerInformerFactory informers.SharedInformerFactory | ||
logger.Infof("Flagger Canary 's Watcher is on namespace %s", namespace) | ||
if namespace == "all" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the namespace is string empty then NewSharedInformerFactoryWithOptions will create an informer for all namespaces. Please replace the default all
with ""
and you can delete the if condition.
See https://github.com/kubernetes/client-go/blob/master/informers/factory.go#L110 and https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/v1/types.go#L294
charts/flagger/values.yaml
Outdated
@@ -7,6 +7,9 @@ image: | |||
|
|||
metricsServer: "http://prometheus.istio-system.svc.cluster.local:9090" | |||
|
|||
# Namespace that flagger will watch for Canary objects | |||
# namespace: default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be namespace: ""
893a146
to
d8cb8f1
Compare
@stefanprodan addressed the comments |
- introduce the namespace flag for flagger to watch a single namespace for Canary Objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @huydinhle
Fix: #38
@stefanprodan