예제 #1
0
func (c *MasterConfig) RunServiceServingCertController(client *kclient.Client) {
	if c.Options.ControllerConfig.ServiceServingCert.Signer == nil {
		return
	}
	ca, err := crypto.GetCA(c.Options.ControllerConfig.ServiceServingCert.Signer.CertFile, c.Options.ControllerConfig.ServiceServingCert.Signer.KeyFile, "")
	if err != nil {
		glog.Fatalf("service serving cert controller failed: %v", err)
	}

	servingCertController := servingcertcontroller.NewServiceServingCertController(client, client, ca, "cluster.local", 2*time.Minute)
	go servingCertController.Run(1, make(chan struct{}))
}
예제 #2
0
func (o SignerCertOptions) CA() (*crypto.CA, error) {
	o.lock.Lock()
	defer o.lock.Unlock()
	if o.ca != nil {
		return o.ca, nil
	}
	ca, err := crypto.GetCA(o.CertFile, o.KeyFile, o.SerialFile)
	if err != nil {
		return nil, err
	}
	o.ca = ca
	return ca, nil
}
예제 #3
0
func (o GetSignerCertOptions) GetSignerCert() (*crypto.CA, error) {
	return crypto.GetCA(o.CertFile, o.KeyFile, o.SerialFile)
}