-
Notifications
You must be signed in to change notification settings - Fork 775
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
podprobemarker support serverless pod #1875
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1875 +/- ##
==========================================
+ Coverage 47.91% 50.96% +3.04%
==========================================
Files 162 194 +32
Lines 23491 25137 +1646
==========================================
+ Hits 11256 12810 +1554
+ Misses 11014 11004 -10
- Partials 1221 1323 +102
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
6ce7494
to
0b4d1b3
Compare
@@ -109,6 +109,14 @@ func (h *PodCreateHandler) Handle(ctx context.Context, req admission.Request) ad | |||
} | |||
} | |||
|
|||
if utilfeature.DefaultFeatureGate.Enabled(features.EnablePodProbeMarkerOnServerless) { | |||
if skip, err := h.podProbeMakerMutatingPod(ctx, req, obj); err != 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.
podProbeMakerMutatingPod -> podProbeMarkerMutatingPod
req.AdmissionRequest.Resource.Resource != "pods" { | ||
return true, nil | ||
} | ||
ppmList := &appsv1alpha1.PodProbeMarkerList{} |
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.
why not reuse the func getPodProbeMarkerForPod
@@ -116,14 +120,56 @@ func (p *enqueueRequestForPod) Update(ctx context.Context, evt event.UpdateEvent | |||
}) | |||
} | |||
} | |||
|
|||
// serverless pod | |||
if utilfeature.DefaultFeatureGate.Enabled(features.EnablePodProbeMarkerOnServerless) { |
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 -> else if ?
serverless pod can also entry the if clause of L107
matchedProbes = append(matchedProbes, probe) | ||
matchedProbeKey.Insert(key) | ||
matchedConditions.Insert(probe.PodConditionType) | ||
if !matchedPodProbeMarkerName.Has(obj.Name) { |
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.
no need to check agaist the existence of entry, set operation will ensure only one entry exists
Signed-off-by: liheng.zms <[email protected]>
0b4d1b3
to
66151df
Compare
Ⅰ. Describe what this PR does
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews