/
openshift.go
44 lines (37 loc) · 1.98 KB
/
openshift.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package pki
import (
"fmt"
corev1 "k8s.io/api/core/v1"
"github.com/openshift/hypershift/support/config"
)
func ReconcileOpenShiftAPIServerCertSecret(secret, ca *corev1.Secret, ownerRef config.OwnerRef) error {
dnsNames := []string{
"openshift-apiserver",
fmt.Sprintf("openshift-apiserver.%s.svc", secret.Namespace),
fmt.Sprintf("openshift-apiserver.%s.svc.cluster.local", secret.Namespace),
"openshift-apiserver.default.svc",
"openshift-apiserver.default.svc.cluster.local",
}
return reconcileSignedCertWithAddresses(secret, ca, ownerRef, "openshift-apiserver", []string{"openshift"}, X509UsageClientServerAuth, dnsNames, nil)
}
func ReconcileOpenShiftOAuthAPIServerCertSecret(secret, ca *corev1.Secret, ownerRef config.OwnerRef) error {
dnsNames := []string{
"openshift-oauth-apiserver",
fmt.Sprintf("openshift-oauth-apiserver.%s.svc", secret.Namespace),
fmt.Sprintf("openshift-oauth-apiserver.%s.svc.cluster.local", secret.Namespace),
"openshift-oauth-apiserver.default.svc",
"openshift-oauth-apiserver.default.svc.cluster.local",
}
return reconcileSignedCertWithAddresses(secret, ca, ownerRef, "openshift-oauth-apiserver", []string{"openshift"}, X509UsageClientServerAuth, dnsNames, nil)
}
func ReconcileOpenShiftAuthenticatorCertSecret(secret, ca *corev1.Secret, ownerRef config.OwnerRef) error {
return reconcileSignedCertWithAddresses(secret, ca, ownerRef, "system:serviceaccount:openshift-oauth-apiserver:openshift-authenticator", []string{"openshift"}, X509UsageClientAuth, nil, nil)
}
func ReconcileOpenShiftControllerManagerCertSecret(secret, ca *corev1.Secret, ownerRef config.OwnerRef) error {
dnsNames := []string{
"openshift-controller-manager",
fmt.Sprintf("openshift-controller-manager.%s.svc", secret.Namespace),
fmt.Sprintf("openshift-controller-manager.%s.svc.cluster.local", secret.Namespace),
}
return reconcileSignedCertWithAddresses(secret, ca, ownerRef, "openshift-controller-manager", []string{"openshift"}, X509UsageClientServerAuth, dnsNames, nil)
}