Skip to content

Commit ba86ff5

Browse files
richabankerk8s-publishing-bot
authored andcommitted
discovery: Add profile-based content negotiation
Add support for 'profile=nopeer' in Accept headers to allow clients to opt out of peer-aggregated discovery and request local-only results. Updates discovery client to set appropriate Accept headers based on whether peer-aggregated discovery is desired. Part of KEP-4020: Unknown Version Interoperability Proxy Kubernetes-commit: 6a07342d37a762230209e362d383e1fbfc325b51
1 parent 07824e7 commit ba86ff5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/endpoints/handlers/negotiation/negotiate.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ type MediaTypeOptions struct {
168168
// has set
169169
Export bool
170170

171+
// profile controls the discovery profile (e.g., "local" for local (non peer-aggregated) discovery)
172+
Profile string
173+
171174
// unrecognized is a list of all unrecognized keys
172175
Unrecognized []string
173176

@@ -227,6 +230,10 @@ func acceptMediaTypeOptions(params map[string]string, accepts *runtime.Serialize
227230
case "pretty":
228231
options.Pretty = v == "1"
229232

233+
// controls the discovery profile (eg local vs peer-aggregated)
234+
case "profile":
235+
options.Profile = v
236+
230237
default:
231238
options.Unrecognized = append(options.Unrecognized, k)
232239
}

0 commit comments

Comments
 (0)