-
Notifications
You must be signed in to change notification settings - Fork 14
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
Non Watched Namespace Labeled selectors #515
base: main
Are you sure you want to change the base?
Conversation
It will now update all resources if a namespace has been added.
pkg/code-generator/codegen/templates/snapshot_emitter_template.go
Outdated
Show resolved
Hide resolved
with the selectors
… into labeled-selectors
pkg/code-generator/codegen/templates/snapshot_emitter_template.go
Outdated
Show resolved
Hide resolved
… into labeled-selectors
rc.namespaceLock.Lock() | ||
rc.namespaceWhitelist = append(rc.namespaceWhitelist, namespace) | ||
rc.namespaceLock.Unlock() | ||
return nil | ||
} |
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.
should we consider getting rid of this white list?
// Note it might be best to use this as a Singleton instead of a Structure | ||
// if a Singleton suggestion is proposed, then Register will no long be needed, | ||
// and we can just use Register New Namespace. Also this would clear up some mutexes, that are being used. |
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.
Do we want to consider this idea, or at least consider registering and starting the resource client factory on NewFunction()
?
for _, ns := range missingNamespaces { | ||
mockResourceChan <- mockResourceListWithNamespace{list: MockResourceList{}, namespace: ns} | ||
} |
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 a namespace is deleted, this causes the namespace to be empty. The entry in the map is never deleted. I think this is fine.
Deleting the entry would require a RemoveRegisteredNamespace()
for the clients, and a deletion from the Kube-Controller. Since this was never handled originally, I think this is fine. Since clients make upgrades as well, I think this is fine as too.
… of the informers. added some comments, and some other things.
adding this closed PR solo-io/gloo#7097 |
Adding expression label filters to non-watched namespaces.
watchNamespaces
is empty andExpressionSelector
is emptywatchNamespaces
is set andExpressionSelector
is emptywatchNamespaces
watchNamespaces
is empty andExpressionSelector
is not emptyExpressionSelector
ExpressionSelector
watchNamespaces
is set andExpressionSelector
is setwatchNamespaces
BOT NOTES:
resolves [Migrated] fine-grained selector for watched CRs gloo#5868