Skip to content

Commit

Permalink
Merge pull request kubernetes#88149 from yue9944882/feat/flow-control-ob
Browse files Browse the repository at this point in the history
Flowcontrol Obserbiliity: Add FS/PL UIDs into response headers
  • Loading branch information
k8s-ci-robot authored Feb 20, 2020
2 parents 3ae1b0c + da6f892 commit afa72e9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ type priorityAndFairnessKeyType int

const priorityAndFairnessKey priorityAndFairnessKeyType = iota

const (
responseHeaderMatchedPriorityLevelConfigurationUID = "X-Kubernetes-PF-PriorityLevelUID"
responseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchemaUID"
)

// PriorityAndFairnessClassification identifies the results of
// classification for API Priority and Fairness
type PriorityAndFairnessClassification struct {
Expand Down Expand Up @@ -97,6 +102,8 @@ func WithPriorityAndFairness(
served = true
innerCtx := context.WithValue(ctx, priorityAndFairnessKey, classification)
innerReq := r.Clone(innerCtx)
w.Header().Set(responseHeaderMatchedPriorityLevelConfigurationUID, string(classification.PriorityLevelUID))
w.Header().Set(responseHeaderMatchedFlowSchemaUID, string(classification.FlowSchemaUID))
handler.ServeHTTP(w, innerReq)
}
digest := utilflowcontrol.RequestDigest{requestInfo, user}
Expand Down

0 comments on commit afa72e9

Please sign in to comment.