mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Move feature gate check to crdInfo construction time
This commit is contained in:
parent
205d5c5829
commit
f03290c390
@ -329,11 +329,9 @@ func (r *crdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.WarningHeaders) {
|
|
||||||
for _, w := range crdInfo.warnings[requestInfo.APIVersion] {
|
for _, w := range crdInfo.warnings[requestInfo.APIVersion] {
|
||||||
warning.AddWarning(req.Context(), "", w)
|
warning.AddWarning(req.Context(), "", w)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
verb := strings.ToUpper(requestInfo.Verb)
|
verb := strings.ToUpper(requestInfo.Verb)
|
||||||
resource := requestInfo.Resource
|
resource := requestInfo.Resource
|
||||||
@ -883,6 +881,7 @@ func (r *crdHandler) getOrCreateServingInfoFor(uid types.UID, name string) (*crd
|
|||||||
statusScopes[v.Name] = &statusScope
|
statusScopes[v.Name] = &statusScope
|
||||||
|
|
||||||
if v.Deprecated {
|
if v.Deprecated {
|
||||||
|
if utilfeature.DefaultFeatureGate.Enabled(features.WarningHeaders) {
|
||||||
if v.DeprecationWarning != nil {
|
if v.DeprecationWarning != nil {
|
||||||
warnings[v.Name] = append(warnings[v.Name], *v.DeprecationWarning)
|
warnings[v.Name] = append(warnings[v.Name], *v.DeprecationWarning)
|
||||||
} else {
|
} else {
|
||||||
@ -890,6 +889,7 @@ func (r *crdHandler) getOrCreateServingInfoFor(uid types.UID, name string) (*crd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret := &crdInfo{
|
ret := &crdInfo{
|
||||||
spec: &crd.Spec,
|
spec: &crd.Spec,
|
||||||
|
Loading…
Reference in New Issue
Block a user