@@ -472,16 +472,76 @@ pluginConfig:
472
472
options : & Options {
473
473
ConfigFile : unknownFieldConfig ,
474
474
},
475
- expectedError : "found unknown field: foo" ,
476
- checkErrFn : runtime .IsStrictDecodingError ,
475
+ // TODO (obitech): Remove this comment and add a new test for v1alpha2, when it's available, as this should fail then.
476
+ // expectedError: "found unknown field: foo",
477
+ // checkErrFn: runtime.IsStrictDecodingError,
478
+ expectedUsername : "config" ,
479
+ expectedConfig : kubeschedulerconfig.KubeSchedulerConfiguration {
480
+ SchedulerName : "default-scheduler" ,
481
+ AlgorithmSource : kubeschedulerconfig.SchedulerAlgorithmSource {Provider : & defaultSource },
482
+ HardPodAffinitySymmetricWeight : 1 ,
483
+ HealthzBindAddress : "0.0.0.0:10251" ,
484
+ MetricsBindAddress : "0.0.0.0:10251" ,
485
+ LeaderElection : kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration {
486
+ LeaderElectionConfiguration : componentbaseconfig.LeaderElectionConfiguration {
487
+ LeaderElect : true ,
488
+ LeaseDuration : metav1.Duration {Duration : 15 * time .Second },
489
+ RenewDeadline : metav1.Duration {Duration : 10 * time .Second },
490
+ RetryPeriod : metav1.Duration {Duration : 2 * time .Second },
491
+ ResourceLock : "endpointsleases" ,
492
+ ResourceNamespace : "kube-system" ,
493
+ ResourceName : "kube-scheduler" ,
494
+ },
495
+ },
496
+ ClientConnection : componentbaseconfig.ClientConnectionConfiguration {
497
+ Kubeconfig : configKubeconfig ,
498
+ QPS : 50 ,
499
+ Burst : 100 ,
500
+ ContentType : "application/vnd.kubernetes.protobuf" ,
501
+ },
502
+ BindTimeoutSeconds : & defaultBindTimeoutSeconds ,
503
+ PodInitialBackoffSeconds : & defaultPodInitialBackoffSeconds ,
504
+ PodMaxBackoffSeconds : & defaultPodMaxBackoffSeconds ,
505
+ Plugins : nil ,
506
+ },
477
507
},
478
508
{
479
509
name : "duplicate fields" ,
480
510
options : & Options {
481
511
ConfigFile : duplicateFieldConfig ,
482
512
},
483
- expectedError : `key "leaderElect" already set` ,
484
- checkErrFn : runtime .IsStrictDecodingError ,
513
+ // TODO (obitech): Remove this comment and add a new test for v1alpha2, when it's available, as this should fail then.
514
+ // expectedError: `key "leaderElect" already set`,
515
+ // checkErrFn: runtime.IsStrictDecodingError,
516
+ expectedUsername : "config" ,
517
+ expectedConfig : kubeschedulerconfig.KubeSchedulerConfiguration {
518
+ SchedulerName : "default-scheduler" ,
519
+ AlgorithmSource : kubeschedulerconfig.SchedulerAlgorithmSource {Provider : & defaultSource },
520
+ HardPodAffinitySymmetricWeight : 1 ,
521
+ HealthzBindAddress : "0.0.0.0:10251" ,
522
+ MetricsBindAddress : "0.0.0.0:10251" ,
523
+ LeaderElection : kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration {
524
+ LeaderElectionConfiguration : componentbaseconfig.LeaderElectionConfiguration {
525
+ LeaderElect : false ,
526
+ LeaseDuration : metav1.Duration {Duration : 15 * time .Second },
527
+ RenewDeadline : metav1.Duration {Duration : 10 * time .Second },
528
+ RetryPeriod : metav1.Duration {Duration : 2 * time .Second },
529
+ ResourceLock : "endpointsleases" ,
530
+ ResourceNamespace : "kube-system" ,
531
+ ResourceName : "kube-scheduler" ,
532
+ },
533
+ },
534
+ ClientConnection : componentbaseconfig.ClientConnectionConfiguration {
535
+ Kubeconfig : configKubeconfig ,
536
+ QPS : 50 ,
537
+ Burst : 100 ,
538
+ ContentType : "application/vnd.kubernetes.protobuf" ,
539
+ },
540
+ BindTimeoutSeconds : & defaultBindTimeoutSeconds ,
541
+ PodInitialBackoffSeconds : & defaultPodInitialBackoffSeconds ,
542
+ PodMaxBackoffSeconds : & defaultPodMaxBackoffSeconds ,
543
+ Plugins : nil ,
544
+ },
485
545
},
486
546
}
487
547
@@ -523,7 +583,7 @@ pluginConfig:
523
583
return
524
584
}
525
585
if username != tc .expectedUsername {
526
- t .Errorf ("expected server call with user %s , got %s " , tc .expectedUsername , username )
586
+ t .Errorf ("expected server call with user %q , got %q " , tc .expectedUsername , username )
527
587
}
528
588
})
529
589
}
0 commit comments