Skip to content

Commit

Permalink
ensure deterministic cert name + names not too long
Browse files Browse the repository at this point in the history
Signed-off-by: Ashley Davis <[email protected]>
  • Loading branch information
SgtCoDFish committed Oct 2, 2024
1 parent 88600f5 commit 5b2d427
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 145 deletions.
6 changes: 3 additions & 3 deletions internal/controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,14 @@ func (r *RouteController) buildNextCert(ctx context.Context, route *routev1.Rout
revisionHistoryLimit = &typedLimit
}

secretName := route.Name + "-tls-cert"
secretName := safeKubernetesNameAppend(route.Name, "tls")

// Build the Certificate resource with the collected information
// https://cert-manager.io/docs/usage/certificate/
cert := &cmapi.Certificate{
ObjectMeta: metav1.ObjectMeta{
GenerateName: route.Name + "-",
Namespace: route.Namespace,
Name: safeKubernetesNameAppend(route.Name, "cert"),
Namespace: route.Namespace,
OwnerReferences: []metav1.OwnerReference{
*metav1.NewControllerRef(
route,
Expand Down
Loading

0 comments on commit 5b2d427

Please sign in to comment.