Skip to content

Commit

Permalink
Let nscert's wildcard certs create secret with domain name instead of…
Browse files Browse the repository at this point in the history
… the name of namespace (#5539)

Currently wildcard creates secret with the name of its namespace. This
causes error when the secret name is duplicated with other secret
name. In fact, it always fails when domain name is changed.

This patch changes wildcard cert to create secret name with domain
name.
  • Loading branch information
nak3 authored and knative-prow-robot committed Oct 25, 2019
1 parent 995194b commit 0176914
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/reconciler/nscert/nscert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func knCertWithStatus(namespace *corev1.Namespace, status *v1alpha1.CertificateS
},
Spec: v1alpha1.CertificateSpec{
DNSNames: wildcardDNSNames,
SecretName: namespace.Name,
SecretName: defaultCertName,
},
Status: *status,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/nscert/resources/wildcard_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func MakeWildcardCertificate(namespace *corev1.Namespace, dnsName, domain string
},
Spec: v1alpha1.CertificateSpec{
DNSNames: []string{dnsName},
SecretName: namespace.Name,
SecretName: names.WildcardCertificate(dnsName),
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestMakeWildcardCertificate(t *testing.T) {
},
Spec: v1alpha1.CertificateSpec{
DNSNames: []string{dnsName},
SecretName: namespace.Name,
SecretName: names.WildcardCertificate(dnsName),
},
}

Expand Down

0 comments on commit 0176914

Please sign in to comment.