mirror of
https://github.com/kyverno/kyverno.git
synced 2025-01-20 18:52:16 +00:00
8f825bb040
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
23 lines
530 B
Go
23 lines
530 B
Go
package tls
|
|
|
|
import (
|
|
"net/url"
|
|
|
|
"k8s.io/client-go/rest"
|
|
)
|
|
|
|
// certificateProps Properties of TLS certificate which should be issued for webhook server
|
|
type certificateProps struct {
|
|
apiServerHost string
|
|
}
|
|
|
|
// newCertificateProps creates CertificateProps from a *rest.Config
|
|
func newCertificateProps(configuration *rest.Config) (*certificateProps, error) {
|
|
apiServerURL, err := url.Parse(configuration.Host)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &certificateProps{
|
|
apiServerHost: apiServerURL.Hostname(),
|
|
}, nil
|
|
}
|