1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-01-20 18:52:16 +00:00
kyverno/pkg/tls/props.go
Charles-Edouard Brétéché 8f825bb040
refactor: remove deployment hash on certs secrets (#3886)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-05-11 16:58:14 +02:00

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
}