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

Clean up network policies watches #2888

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

asincu
Copy link
Contributor

@asincu asincu commented Sep 20, 2023

Description

Remove watches for network policies from elastic log storage controller and add them to sub-controllers that are responsible for rendering them.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@marvin-tigera marvin-tigera added this to the v1.32.0 milestone Sep 20, 2023
@danudey danudey modified the milestones: v1.32.0, v1.32.1, v1.32.2 Dec 2, 2023
@asincu asincu force-pushed the clean_up_watches branch 2 times, most recently from 1e663f7 to 1c77d76 Compare December 15, 2023 18:58
@asincu asincu marked this pull request as ready for review December 15, 2023 19:25
@asincu asincu requested a review from a team as a code owner December 15, 2023 19:25
@danudey danudey modified the milestones: v1.32.2, v1.32.3 Dec 15, 2023
}

go utils.WaitToAddTierWatch(networkpolicy.TigeraComponentTierName, c, k8sClient, log, r.tierWatchReady)
go utils.WaitToAddNetworkPolicyWatches(c, k8sClient, log, []types.NamespacedName{
{Name: linseed.PolicyName, Namespace: render.ElasticsearchNamespace},
Copy link
Member

@caseydavenport caseydavenport Dec 15, 2023

Choose a reason for hiding this comment

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

There are a few types of watches:

  • Watches that are always in the Install namespace (helper.InstallNamespace())
  • Watches that are always in the truth namespace (helper.TruthNamespace())
  • Watches that are either in a specific namespace for single-tenant, and all namespaces for multi-tenant (like this one)

We actually define the helper above such that for multi-tenant clusters, helper.InstallNamespace returns "" so I think you can just use that here

@caseydavenport caseydavenport merged commit 1cca8a7 into tigera:master Dec 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants