Skip to content

[k8s plugin] Implement ignoring istio virtual service on primary rollout stage#6258

Merged
khanhtc1202 merged 1 commit into
masterfrom
implement-ignoring-istio-resource-on-primary-rollout
Sep 22, 2025
Merged

[k8s plugin] Implement ignoring istio virtual service on primary rollout stage#6258
khanhtc1202 merged 1 commit into
masterfrom
implement-ignoring-istio-resource-on-primary-rollout

Conversation

@ffjlabo
Copy link
Copy Markdown
Member

@ffjlabo ffjlabo commented Sep 20, 2025

What this PR does:

Implemented the logic to ignore the virtual service from primary manifests.

This logic is implemented on the pipedv0.

switch routingMethod {
// In case of routing by Pod selector,
// all manifests can be used as primary manifests.
case config.KubernetesTrafficRoutingMethodPodSelector:
primaryManifests = manifests
// In case of routing by Istio,
// VirtualService manifest will be used to manipulate the traffic ratio.
// Other manifests can be used as primary manifests.
case config.KubernetesTrafficRoutingMethodIstio:
// Firstly, find the VirtualService manifests.
istioCfg := e.appCfg.TrafficRouting.Istio
if istioCfg == nil {
istioCfg = &config.IstioTrafficRouting{}
}
trafficRoutingManifests, err := findIstioVirtualServiceManifests(manifests, istioCfg.VirtualService)
if err != nil {
e.LogPersister.Errorf("Failed while finding traffic routing manifest: (%v)", err)
return model.StageStatus_STAGE_FAILURE
}
// Then remove them from the list of primary manifests.
if len(trafficRoutingManifests) > 0 {
primaryManifests = make([]provider.Manifest, 0, len(manifests)-1)
for _, m := range manifests {
if m.Key == trafficRoutingManifests[0].Key {
continue
}
primaryManifests = append(primaryManifests, m)
}
}

Why we need it:

Which issue(s) this PR fixes:

Part of #5764

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 20, 2025

Codecov Report

❌ Patch coverage is 63.15789% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.72%. Comparing base (8e46458) to head (22d2f4c).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...pp/pipedv1/plugin/kubernetes/deployment/primary.go 63.15% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6258      +/-   ##
==========================================
+ Coverage   28.69%   28.72%   +0.03%     
==========================================
  Files         560      560              
  Lines       59738    59754      +16     
==========================================
+ Hits        17140    17165      +25     
+ Misses      41281    41270      -11     
- Partials     1317     1319       +2     
Flag Coverage Δ
. 23.22% <ø> (ø)
.-pkg-app-pipedv1-plugin-analysis 32.64% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 58.19% <63.15%> (+0.29%) ⬆️
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 67.48% <ø> (ø)
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 39.25% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 35.51% <ø> (ø)
.-pkg-app-pipedv1-plugin-waitapproval 55.73% <ø> (ø)
.-pkg-plugin-sdk 50.47% <ø> (+0.19%) ⬆️
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@khanhtc1202
Copy link
Copy Markdown
Member

@ffjlabo, please approve PR #6255 first and rebase this PR branch to make the test/go CI pass 👀

@ffjlabo ffjlabo changed the title Implement ignoring istio virtual service on primary rollout stage [k8s plugin] Implement ignoring istio virtual service on primary rollout stage Sep 20, 2025
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo force-pushed the implement-ignoring-istio-resource-on-primary-rollout branch from 211d95e to 22d2f4c Compare September 20, 2025 17:48
@ffjlabo
Copy link
Copy Markdown
Member Author

ffjlabo commented Sep 20, 2025

@khanhtc1202
Thank you, I approved the PR and rebased this branch. The CI has passed.

Copy link
Copy Markdown
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

Copy link
Copy Markdown
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

thanks 👍

@khanhtc1202 khanhtc1202 merged commit f5b5d81 into master Sep 22, 2025
46 checks passed
@khanhtc1202 khanhtc1202 deleted the implement-ignoring-istio-resource-on-primary-rollout branch September 22, 2025 04:02
This was referenced Oct 7, 2025
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.

3 participants