Skip to content

Commit d51298c

Browse files
Edited the comments
Signed-off-by: pallavi jaini <pallavi.jaini@intel.com>
1 parent 197299b commit d51298c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/plugins/pre-request/pd_prerequest.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424

2525
type prefillHeaderHandlerParameters struct {
2626
PrefillProfile string `json:"prefillProfile"`
27-
PrefillTargetPort int `json:"prefillTargetPort,omitempty"` // Optional field
27+
PrefillTargetPort int `json:"prefillTargetPort,omitempty"` // Optional field
2828
}
2929

3030
// compile-time type assertion
@@ -57,7 +57,7 @@ func NewPrefillHeaderHandler(prefillProfile string, prefillTargetPort int) *Pref
5757
type PrefillHeaderHandler struct {
5858
typedName plugins.TypedName
5959
prefillProfile string
60-
prefillTargetPort int // 0 means "not configured"
60+
prefillTargetPort int // 0 means "not configured"
6161
}
6262

6363
// TypedName returns the typed name of the plugin.
@@ -82,11 +82,10 @@ func (p *PrefillHeaderHandler) PreRequest(_ context.Context, request *types.LLMR
8282
return // prefill profile failed to run or we chose not to run it, no-op in this case
8383
}
8484

85-
portToUse := targetPort // Default: use existing behavior
86-
if p.prefillTargetPort > 0 { // Only override if configured
85+
portToUse := targetPort // Default: use existing behavior
86+
if p.prefillTargetPort > 0 { // Only override if configured
8787
portToUse = p.prefillTargetPort
88-
}
89-
88+
}
9089
prefillHostPort := net.JoinHostPort(prefillProfileRunResult.TargetPods[0].GetPod().Address, strconv.Itoa(portToUse))
9190
request.Headers[prefillPodHeader] = prefillHostPort // in the form of <ip:port>
9291
}

0 commit comments

Comments
 (0)