mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #96989 from tkashem/comment
add comment to describe why we set the UID in the response headers
This commit is contained in:
commit
f21b79c823
@ -122,8 +122,13 @@ func WithPriorityAndFairness(
|
|||||||
served = true
|
served = true
|
||||||
innerCtx := context.WithValue(ctx, priorityAndFairnessKey, classification)
|
innerCtx := context.WithValue(ctx, priorityAndFairnessKey, classification)
|
||||||
innerReq := r.Clone(innerCtx)
|
innerReq := r.Clone(innerCtx)
|
||||||
|
|
||||||
|
// We intentionally set the UID of the flow-schema and priority-level instead of name. This is so that
|
||||||
|
// the names that cluster-admins choose for categorization and priority levels are not exposed, also
|
||||||
|
// the names might make it obvious to the users that they are rejected due to classification with low priority.
|
||||||
w.Header().Set(flowcontrol.ResponseHeaderMatchedPriorityLevelConfigurationUID, string(classification.PriorityLevelUID))
|
w.Header().Set(flowcontrol.ResponseHeaderMatchedPriorityLevelConfigurationUID, string(classification.PriorityLevelUID))
|
||||||
w.Header().Set(flowcontrol.ResponseHeaderMatchedFlowSchemaUID, string(classification.FlowSchemaUID))
|
w.Header().Set(flowcontrol.ResponseHeaderMatchedFlowSchemaUID, string(classification.FlowSchemaUID))
|
||||||
|
|
||||||
handler.ServeHTTP(w, innerReq)
|
handler.ServeHTTP(w, innerReq)
|
||||||
}
|
}
|
||||||
digest := utilflowcontrol.RequestDigest{RequestInfo: requestInfo, User: user}
|
digest := utilflowcontrol.RequestDigest{RequestInfo: requestInfo, User: user}
|
||||||
|
Loading…
Reference in New Issue
Block a user