@@ -20,7 +20,6 @@ import (
20
20
kclientsetinternal "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
21
21
kubeletclient "k8s.io/kubernetes/pkg/kubelet/client"
22
22
23
- "github.com/openshift/origin/pkg/client"
24
23
cmdutil "github.com/openshift/origin/pkg/cmd/util"
25
24
)
26
25
@@ -379,30 +378,6 @@ func GetExternalKubeClient(kubeConfigFile string, overrides *ClientConnectionOve
379
378
return clientset , kubeConfig , nil
380
379
}
381
380
382
- // TODO: clients should be copied and instantiated from a common client config, tweaked, then
383
- // given to individual controllers and other infrastructure components. Overrides are optional
384
- // and may alter the default configuration.
385
- func GetOpenShiftClient (kubeConfigFile string , overrides * ClientConnectionOverrides ) (* client.Client , * restclient.Config , error ) {
386
- loadingRules := & clientcmd.ClientConfigLoadingRules {}
387
- loadingRules .ExplicitPath = kubeConfigFile
388
- loader := clientcmd .NewNonInteractiveDeferredLoadingClientConfig (loadingRules , & clientcmd.ConfigOverrides {})
389
-
390
- kubeConfig , err := loader .ClientConfig ()
391
- if err != nil {
392
- return nil , nil , err
393
- }
394
-
395
- applyClientConnectionOverrides (overrides , kubeConfig )
396
-
397
- kubeConfig .WrapTransport = DefaultClientTransport
398
- openshiftClient , err := client .New (kubeConfig )
399
- if err != nil {
400
- return nil , nil , err
401
- }
402
-
403
- return openshiftClient , kubeConfig , nil
404
- }
405
-
406
381
// applyClientConnectionOverrides updates a kubeConfig with the overrides from the config.
407
382
func applyClientConnectionOverrides (overrides * ClientConnectionOverrides , kubeConfig * restclient.Config ) {
408
383
if overrides == nil {
@@ -455,31 +430,6 @@ func GetNamedCertificateMap(namedCertificates []NamedCertificate) (map[string]*t
455
430
return namedCerts , nil
456
431
}
457
432
458
- // GetClientCertCAPool returns a cert pool containing all client CAs that could be presented (union of API and OAuth)
459
- func GetClientCertCAPool (options MasterConfig ) (* x509.CertPool , error ) {
460
- roots := x509 .NewCertPool ()
461
-
462
- // Add CAs for OAuth
463
- certs , err := GetOAuthClientCertCAs (options )
464
- if err != nil {
465
- return nil , err
466
- }
467
- for _ , root := range certs {
468
- roots .AddCert (root )
469
- }
470
-
471
- // Add CAs for API
472
- certs , err = getAPIClientCertCAs (options )
473
- if err != nil {
474
- return nil , err
475
- }
476
- for _ , root := range certs {
477
- roots .AddCert (root )
478
- }
479
-
480
- return roots , nil
481
- }
482
-
483
433
func GetOAuthClientCertCAs (options MasterConfig ) ([]* x509.Certificate , error ) {
484
434
allCerts := []* x509.Certificate {}
485
435
@@ -504,22 +454,6 @@ func GetOAuthClientCertCAs(options MasterConfig) ([]*x509.Certificate, error) {
504
454
return allCerts , nil
505
455
}
506
456
507
- func GetRequestHeaderClientCertCAs (options MasterConfig ) ([]* x509.Certificate , error ) {
508
- if options .AuthConfig .RequestHeader == nil {
509
- return nil , nil
510
- }
511
-
512
- certs , err := cmdutil .CertificatesFromFile (options .AuthConfig .RequestHeader .ClientCA )
513
- if err != nil {
514
- return nil , fmt .Errorf ("Error reading %s: %s" , options .AuthConfig .RequestHeader .ClientCA , err )
515
- }
516
- return certs , nil
517
- }
518
-
519
- func getAPIClientCertCAs (options MasterConfig ) ([]* x509.Certificate , error ) {
520
- return cmdutil .CertificatesFromFile (options .ServingInfo .ClientCA )
521
- }
522
-
523
457
func GetKubeletClientConfig (options MasterConfig ) * kubeletclient.KubeletClientConfig {
524
458
config := & kubeletclient.KubeletClientConfig {
525
459
Port : options .KubeletClientInfo .Port ,
@@ -595,11 +529,6 @@ func IsOAuthIdentityProvider(provider IdentityProvider) bool {
595
529
return false
596
530
}
597
531
598
- func HasOpenShiftAPILevel (config MasterConfig , apiLevel string ) bool {
599
- apiLevelSet := sets .NewString (config .APILevels ... )
600
- return apiLevelSet .Has (apiLevel )
601
- }
602
-
603
532
const kubeAPIEnablementFlag = "runtime-config"
604
533
605
534
// GetKubeAPIServerFlagAPIEnablement parses the available flag at the groupVersion level
0 commit comments