Change:
ci-kubernetes-e2e-gci-gce-alpha-features kubetest.Up Jul 02 2021, 01:26:42 UTC+0200 /sig release
based on testgrid probably cc <img width="1203" alt="Screen Shot 2021-07-02 at 4 24 25 PM" src="https://user-"
/cc working on it
/assign
the scheduler fails to start with this error: it seems the feature gates from the command line does not take effect in the defaulting phrase, do you know how to fix it?
ah, found there is a cycle here: The scheduler options , but the default config's default values depend on the feature gates options. I think this disables other feature gate controlled logic in the defaulting too:
I tried to fix it by updating the component config after the CLI flags (including the feature gates) are parsed: PTAL
fixed the flake. is back green now.
thanks!

Discussion:
return errs } <del> // ApplyPolicySourceTo sets cfg.PolicySource from flags passed on the command line in the following precedence order: </del> <ins> // ApplyTo sets cfg.PolicySource from flags passed on the command line in the following precedence order: </ins> // // 1. --use-legacy-policy-config to use a policy file. // 2. --policy-configmap to use a policy config map value.

// NewOptions returns default scheduler app options. func NewOptions() (*Options, error) { <del> cfg, err := latest.Default() if err != nil { return nil, err } hhost, hport, err := splitHostIntPort(cfg.HealthzBindAddress) if err != nil { return nil, err } </del> o := &Options{ <del> ComponentConfig: *cfg, SecureServing:   apiserveroptions.NewSecureServingOptions().WithLoopback(), </del> <ins> SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(), </ins> CombinedInsecureServing: &CombinedInsecureServingOptions{ Healthz: (&apiserveroptions.DeprecatedInsecureServingOptions{ BindNetwork: "tcp", }).WithLoopback(), Metrics: (&apiserveroptions.DeprecatedInsecureServingOptions{ <del> BindNetwork: "tcp", }).WithLoopback(), BindPort:    hport, BindAddress: hhost, </del> <ins> BindNetwork: "tcp"}).WithLoopback(), </ins> }, Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(), Authorization:  apiserveroptions.NewDelegatingAuthorizationOptions(),

return o, nil } <ins> // Complete completes the remaining instantiation of the options obj. // In particular, it injects the latest internal versioned ComponentConfig. func (o *Options) Complete(nfs *cliflag.NamedFlagSets) error { cfg, err := latest.Default() if err != nil { return err } hhost, hport, err := splitHostIntPort(cfg.HealthzBindAddress) if err != nil { return err } // Obtain CLI args related with insecure serving. // If not specified in command line, derive the default settings from cfg. insecureServing := nfs.FlagSet("insecure serving") if !insecureServing.Changed("address") { o.CombinedInsecureServing.BindAddress = hhost } if !insecureServing.Changed("port") { o.CombinedInsecureServing.BindPort = hport } // Obtain deprecated CLI args. Set them to cfg if specified in command line. deprecated := nfs.FlagSet("deprecated") if deprecated.Changed("profiling") { cfg.EnableProfiling = o.ComponentConfig.EnableProfiling } if deprecated.Changed("contention-profiling") { cfg.EnableContentionProfiling = o.ComponentConfig.EnableContentionProfiling } if deprecated.Changed("kubeconfig") { cfg.ClientConnection.Kubeconfig = o.ComponentConfig.ClientConnection.Kubeconfig } if deprecated.Changed("kube-api-content-type") { cfg.ClientConnection.ContentType = o.ComponentConfig.ClientConnection.ContentType } if deprecated.Changed("kube-api-qps") { cfg.ClientConnection.QPS = o.ComponentConfig.ClientConnection.QPS } if deprecated.Changed("kube-api-burst") { cfg.ClientConnection.Burst = o.ComponentConfig.ClientConnection.Burst } if deprecated.Changed("lock-object-namespace") { cfg.LeaderElection.ResourceNamespace = o.ComponentConfig.LeaderElection.ResourceNamespace } if deprecated.Changed("lock-object-name") { cfg.LeaderElection.ResourceName = o.ComponentConfig.LeaderElection.ResourceName } // Obtain CLI args related with leaderelection. Set them to cfg if specified in command line. leaderelection := nfs.FlagSet("leader election") if leaderelection.Changed("leader-elect") { cfg.LeaderElection.LeaderElect = o.ComponentConfig.LeaderElection.LeaderElect } if leaderelection.Changed("leader-elect-lease-duration") { cfg.LeaderElection.LeaseDuration = o.ComponentConfig.LeaderElection.LeaseDuration } if leaderelection.Changed("leader-elect-renew-deadline") { cfg.LeaderElection.RenewDeadline = o.ComponentConfig.LeaderElection.RenewDeadline } if leaderelection.Changed("leader-elect-retry-period") { cfg.LeaderElection.RetryPeriod = o.ComponentConfig.LeaderElection.RetryPeriod } if leaderelection.Changed("leader-elect-resource-lock") { cfg.LeaderElection.ResourceLock = o.ComponentConfig.LeaderElection.ResourceLock } if leaderelection.Changed("leader-elect-resource-name") { cfg.LeaderElection.ResourceName = o.ComponentConfig.LeaderElection.ResourceName } if leaderelection.Changed("leader-elect-resource-namespace") { cfg.LeaderElection.ResourceNamespace = o.ComponentConfig.LeaderElection.ResourceNamespace } o.ComponentConfig = *cfg return nil } </ins> func splitHostIntPort(s string) (string, int, error) { host, port, err := net.SplitHostPort(s) if err != nil {

klog.Fatalf("unable to initialize command options: %v", err) } <ins> namedFlagSets := opts.Flags() </ins> cmd := &cobra.Command{ Use: "kube-scheduler", Long: `The Kubernetes scheduler is a control plane process which assigns

See [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/) for more information about scheduling and the kube-scheduler component.`, Run: func(cmd *cobra.Command, args []string) { <ins> if err := opts.Complete(&namedFlagSets); err != nil { fmt.Fprintf(os.Stderr, "%vn", err) os.Exit(1) } </ins> if err := runCommand(cmd, opts, registryOptions...); err != nil { fmt.Fprintf(os.Stderr, "%vn", err) os.Exit(1)

}, } fs := cmd.Flags() <del> namedFlagSets := opts.Flags() </del> verflag.AddFlags(namedFlagSets.FlagSet("global")) globalflag.AddGlobalFlags(namedFlagSets.FlagSet("global"), cmd.Name()) for _, f := range namedFlagSets.FlagSets {

t.Fatal(err) } <ins> nfs := opts.Flags() for _, f := range nfs.FlagSets { fs.AddFlagSet(f) } if err := fs.Parse(tc.flags); err != nil { t.Fatal(err) } if err := opts.Complete(&nfs); err != nil { t.Fatal(err) } </ins> // use listeners instead of static ports so parallel test runs don't conflict opts.SecureServing.Listener = makeListener(t) defer opts.SecureServing.Listener.Close()

opts.CombinedInsecureServing.Healthz.Listener = makeListener(t) defer opts.CombinedInsecureServing.Healthz.Listener.Close() <del> for _, f := range opts.Flags().FlagSets { fs.AddFlagSet(f) } if err := fs.Parse(tc.flags); err != nil { t.Fatal(err) } </del> ctx, cancel := context.WithCancel(context.Background()) defer cancel() _, sched, err := Setup(ctx, opts)

if err != nil { return TestServer{}, err } namedFlagSets := opts.Flags() for _, f := range namedFlagSets.FlagSets { fs.AddFlagSet(f) } fs.Parse(customFlags) <ins> if err := opts.Complete(&namedFlagSets); err != nil { return TestServer{}, err } </ins> if opts.SecureServing.BindPort != 0 { opts.SecureServing.Listener, opts.SecureServing.BindPort, err = createListenerOnFreePort() if err != nil {

"k8s.io/kubernetes/pkg/scheduler/apis/config/scheme" ) <del> // Default creates a default configuration of the latset versioned type. </del> <ins> // Default creates a default configuration of the latest versioned type. </ins> // This function needs to be updated whenever we bump the scheduler's component config version. func Default() (*config.KubeSchedulerConfiguration, error) { versionedCfg := v1beta2.KubeSchedulerConfiguration{}