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

Support labelSelectors to filter out services before syncing to the host cluster #2378

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ApsTomar
Copy link

@ApsTomar ApsTomar commented Jan 6, 2025

What issue type does this pull request address? (keep at least one, remove the others)
/kind enhancement

What does this pull request do? Which issues does it resolve? (use resolves #<issue_number> if possible)
resolves #1622

Please provide a short message that should be published in the vcluster release notes
Added a feature enhancement to support filtering out services using label selectors, in particular MatchExpressions (for eg. label/export-service NotIn ["false"]

What else do we need to know?

Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for vcluster-docs canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 06163dc
🔍 Latest deploy log https://app.netlify.com/sites/vcluster-docs/deploys/678128552d0cc20007b1d457

@ApsTomar ApsTomar marked this pull request as draft January 6, 2025 09:13
@ApsTomar ApsTomar force-pushed the issue-1622-label-selector-in-sync-ops branch from a35c144 to 9907de7 Compare January 6, 2025 13:21
@ApsTomar ApsTomar force-pushed the issue-1622-label-selector-in-sync-ops branch from 9907de7 to bb8ba3f Compare January 10, 2025 08:04
@ApsTomar ApsTomar changed the title [WIP]: Support labelSelectors to filter out services before syncing to the host cluster Support labelSelectors to filter out services before syncing to the host cluster Jan 10, 2025
@ApsTomar ApsTomar marked this pull request as ready for review January 10, 2025 08:14
Signed-off-by: abhay.tomar <[email protected]>
@@ -500,10 +501,21 @@ type EnableSwitchWithPatches struct {
// Enabled defines if this option should be enabled.
Enabled bool `json:"enabled,omitempty"`

// Selector defines the labelSelector based filtering for syncing the resources to the host cluster.
Selector *SyncSelector `json:"selector,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Adding this here would also apply to other resources that use EnableSwitchWithPatches, is that wanted?

Copy link
Author

Choose a reason for hiding this comment

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

We can have a separate object specifically for this purpose. But I've added this in EnableSwitchWithPatches, keeping in mind that it would provide us an option to enable such selector based filtering for other resources as well. And the user can user let it be empty if they don't require any filtering.

Copy link
Member

@FabianKramm FabianKramm left a comment

Choose a reason for hiding this comment

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

I'm not sure if we actually want to do this, whats the use case for allowing something like this? Services wouldn't work at all if they are not synced, so it seems to me this is not something we want to support

@ApsTomar
Copy link
Author

ApsTomar commented Jan 14, 2025

it seems to me this is not something we want to support

@FabianKramm If I understood this correctly then this feature enhancement which is requested is not a desirable one and hence the issue can be closed?
In that case, let me know if there is anything in the PR which is worth adding to the codebase, if not then I'll close this PR once the issue is closed.

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.

Support filtering exported services or other resources
2 participants