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

added a cluster allowlist param for vs based routing #346

Conversation

shriramsharma
Copy link
Collaborator

Description

What does this change do and why?
Added a cluster allow list to specify on which source clusters VS based routing should be enabled.

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 66.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 71.90%. Comparing base (3f7eb67) to head (bf20985).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
admiral/pkg/clusters/serviceentry.go 50.00% 4 Missing and 3 partials ⚠️
admiral/pkg/clusters/virtualservice_routing.go 60.00% 2 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #346      +/-   ##
==========================================
+ Coverage   71.76%   71.90%   +0.13%     
==========================================
  Files          66       66              
  Lines        9355     9365      +10     
==========================================
+ Hits         6714     6734      +20     
+ Misses       2279     2266      -13     
- Partials      362      365       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if !wrapper.params.EnableVSRouting {
return false
}
for _, c := range wrapper.params.VSRoutingEnabledClusters {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If EnableVSRouting is true and VSRoutingEnabledClusters is "[]", does that mean no clusters should get the VS?

What is the correct way to enable it across the board without adding clusters to the list?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@adilfulara , I'll be adding a check for *. If that exists in the cluster list, then it will be enabled for all clusters.

Copy link
Collaborator

@adilfulara adilfulara left a comment

Choose a reason for hiding this comment

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

overall looks good. added comments. lmk wdyt?

@@ -254,6 +254,7 @@ func GetRootCmd(args []string) *cobra.Command {

// Flags pertaining to VS based routing
rootCmd.PersistentFlags().BoolVar(&params.EnableVSRouting, "enable_vs_routing", false, "Enable/Disable VS Based Routing")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This probably needs to be a string with enabled/disabled/all or something

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vinay-g would this work? #346 (comment)

continue
}

if remoteRegistry == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this check be done only once ?

Signed-off-by: Shriram Sharma <[email protected]>
{
name: "Given enableVSRouting is true, and all VS routing is enabled in all clusters using '*'" +
"When DoVSRoutingForCluster is called" +
"Then it should return false",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Then it should return true :)

@shriramsharma shriramsharma merged commit c0444fb into istio-ecosystem:master Sep 19, 2024
3 checks passed
@shriramsharma shriramsharma deleted the cluster-allowlist-vs-routing branch September 19, 2024 04:51
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.

5 participants