Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCCO: Use cpo manifests for references #1645

Merged
merged 1 commit into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,3 @@ func IngressDefaultIngressControllerCert() *corev1.Secret {
},
}
}

func IngressCert(ns string) *corev1.Secret {
return &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "ingress-crt",
Namespace: ns,
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ func OAuthCABundle() *corev1.ConfigMap {
}
}

func OpenShiftOAuthServerCert(ns string) *corev1.Secret {
return &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "oauth-server-crt",
Namespace: ns,
},
}
}

func OAuthServerChallengingClient() *oauthv1.OAuthClient {
return &oauthv1.OAuthClient{
ObjectMeta: metav1.ObjectMeta{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ func (r *reconciler) reconcileIngressController(ctx context.Context, hcp *hyperv
errs = append(errs, fmt.Errorf("failed to reconcile default ingress controller: %w", err))
}

sourceCert := manifests.IngressCert(hcp.Namespace)
sourceCert := cpomanifests.IngressCert(hcp.Namespace)
if err := r.cpClient.Get(ctx, client.ObjectKeyFromObject(sourceCert), sourceCert); err != nil {
errs = append(errs, fmt.Errorf("failed to get ingress cert (%s/%s) from control plane: %w", sourceCert.Namespace, sourceCert.Name, err))
} else {
Expand Down Expand Up @@ -761,7 +761,7 @@ func secretHash(data []byte) string {
}

func (r *reconciler) reconcileOAuthServingCertCABundle(ctx context.Context, hcp *hyperv1.HostedControlPlane) error {
oauthServingCert := manifests.OpenShiftOAuthServerCert(hcp.Namespace)
oauthServingCert := cpomanifests.OpenShiftOAuthServerCert(hcp.Namespace)
if err := r.cpClient.Get(ctx, client.ObjectKeyFromObject(oauthServingCert), oauthServingCert); err != nil {
return fmt.Errorf("cannot get oauth serving cert: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

hyperv1 "github.com/openshift/hypershift/api/v1alpha1"
cpomanifests "github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/manifests"
"github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/api"
"github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/controllers/resources/manifests"
"github.com/openshift/hypershift/support/globalconfig"
Expand Down Expand Up @@ -148,7 +149,7 @@ func fakeHCP() *hyperv1.HostedControlPlane {
}

func fakeIngressCert() *corev1.Secret {
s := manifests.IngressCert("bar")
s := cpomanifests.IngressCert("bar")
s.Data = map[string][]byte{
"tls.crt": []byte("12345"),
"tls.key": []byte("12345"),
Expand Down Expand Up @@ -201,7 +202,7 @@ func fakeKubeadminPasswordSecret() *corev1.Secret {
}

func fakeOAuthServingCert() *corev1.Secret {
s := manifests.OpenShiftOAuthServerCert("bar")
s := cpomanifests.OpenShiftOAuthServerCert("bar")
s.Data = map[string][]byte{"tls.crt": []byte("test")}
return s
}
Expand Down