From 33febe6e6453a947729a2a69421d0ef0c89eeccf Mon Sep 17 00:00:00 2001 From: Iceber Gu Date: Thu, 13 Jun 2024 15:01:00 +0800 Subject: [PATCH] update code for kubernetes v1.30.2 Signed-off-by: Iceber Gu --- cmd/apiserver/app/options/options.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cmd/apiserver/app/options/options.go b/cmd/apiserver/app/options/options.go index d83b9c823..da529dfc4 100644 --- a/cmd/apiserver/app/options/options.go +++ b/cmd/apiserver/app/options/options.go @@ -128,26 +128,27 @@ func (o *ClusterPediaServerOptions) genericOptionsApplyTo(config *genericapiserv config.MaxRequestsInFlight = o.MaxRequestsInFlight config.MaxMutatingRequestsInFlight = o.MaxMutatingRequestsInFlight - if err := o.SecureServing.ApplyTo(&config.SecureServing, &config.LoopbackClientConfig); err != nil { + if err := o.CoreAPI.ApplyTo(config); err != nil { return err } - if err := o.Authentication.ApplyTo(&config.Authentication, config.SecureServing, config.OpenAPIConfig); err != nil { + client, err := kubernetes.NewForConfig(config.ClientConfig) + if err != nil { return err } - if err := o.Authorization.ApplyTo(&config.Authorization); err != nil { + + if err := o.SecureServing.ApplyTo(&config.SecureServing, &config.LoopbackClientConfig); err != nil { return err } - if err := o.Audit.ApplyTo(&config.Config); err != nil { + if err := o.Authentication.ApplyTo(&config.Authentication, config.SecureServing, config.OpenAPIConfig); err != nil { return err } - if err := o.Features.ApplyTo(&config.Config); err != nil { + if err := o.Authorization.ApplyTo(&config.Authorization); err != nil { return err } - if err := o.CoreAPI.ApplyTo(config); err != nil { + if err := o.Audit.ApplyTo(&config.Config); err != nil { return err } - client, err := kubernetes.NewForConfig(config.ClientConfig) - if err != nil { + if err := o.Features.ApplyTo(&config.Config, client, config.SharedInformerFactory); err != nil { return err } dynamicClient := dynamic.NewForConfigOrDie(config.ClientConfig)