Skip to content
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

Merged
merged 1 commit into from
Mar 6, 2019
Merged

Conversation

huydinhle
Copy link
Contributor

@huydinhle huydinhle commented Mar 5, 2019

  • introduce the namespace flag for flagger to watch a single namespace for Canary Objects

Fix: #38

@stefanprodan

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" {
Copy link
Member

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

@@ -7,6 +7,9 @@ image:

metricsServer: "http://prometheus.istio-system.svc.cluster.local:9090"

# Namespace that flagger will watch for Canary objects
# namespace: default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be namespace: ""

@stefanprodan stefanprodan changed the title Added Namespace Flag for Flagger Add namespace flag Mar 5, 2019
@huydinhle huydinhle force-pushed the namespace-watcher branch 2 times, most recently from 893a146 to d8cb8f1 Compare March 6, 2019 04:56
@huydinhle
Copy link
Contributor Author

@stefanprodan addressed the comments

- introduce the namespace flag for flagger to watch a single namespace
for Canary Objects
Copy link
Member

@stefanprodan stefanprodan left a 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

@stefanprodan stefanprodan merged commit a5d4382 into fluxcd:master Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants