Skip to content

Commit afa72e9

Browse files
authored
Merge pull request kubernetes#88149 from yue9944882/feat/flow-control-ob
Flowcontrol Obserbiliity: Add FS/PL UIDs into response headers
2 parents 3ae1b0c + da6f892 commit afa72e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ type priorityAndFairnessKeyType int
3737

3838
const priorityAndFairnessKey priorityAndFairnessKeyType = iota
3939

40+
const (
41+
responseHeaderMatchedPriorityLevelConfigurationUID = "X-Kubernetes-PF-PriorityLevelUID"
42+
responseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchemaUID"
43+
)
44+
4045
// PriorityAndFairnessClassification identifies the results of
4146
// classification for API Priority and Fairness
4247
type PriorityAndFairnessClassification struct {
@@ -97,6 +102,8 @@ func WithPriorityAndFairness(
97102
served = true
98103
innerCtx := context.WithValue(ctx, priorityAndFairnessKey, classification)
99104
innerReq := r.Clone(innerCtx)
105+
w.Header().Set(responseHeaderMatchedPriorityLevelConfigurationUID, string(classification.PriorityLevelUID))
106+
w.Header().Set(responseHeaderMatchedFlowSchemaUID, string(classification.FlowSchemaUID))
100107
handler.ServeHTTP(w, innerReq)
101108
}
102109
digest := utilflowcontrol.RequestDigest{requestInfo, user}

0 commit comments

Comments
 (0)