Skip to content

Commit

Permalink
use operator util function to get TLS cert secret name
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsgstrabo committed Apr 4, 2024
1 parent 4ed2614 commit 4103158
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/models/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func getComponentExternalDNS(component radixv1.RadixCommonDeployComponent, secre
var certData, keyData []byte
status := deploymentModels.TLSStatusConsistent

if secretValue, ok := slice.FindFirst(secretList, isSecretWithName(externalAlias.FQDN)); ok {
if secretValue, ok := slice.FindFirst(secretList, isSecretWithName(operatorutils.GetExternalDnsTlsSecretName(externalAlias))); ok {
certData = secretValue.Data[corev1.TLSCertKey]
keyData = secretValue.Data[corev1.TLSPrivateKeyKey]
if certValue, keyValue := strings.TrimSpace(string(certData)), strings.TrimSpace(string(keyData)); len(certValue) == 0 || len(keyValue) == 0 || strings.EqualFold(certValue, secretDefaultData) || strings.EqualFold(keyValue, secretDefaultData) {
Expand Down
2 changes: 1 addition & 1 deletion api/secrets/secret_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (eh *SecretHandler) UpdateComponentExternalDNSSecretData(ctx context.Contex
}

ns := operatorutils.GetEnvironmentNamespace(appName, envName)
if err := eh.setSecretKeyValue(ctx, ns, fqdn, map[string][]byte{corev1.TLSCertKey: certificateBytes, corev1.TLSPrivateKeyKey: privateKeyBytes}); err != nil {
if err := eh.setSecretKeyValue(ctx, ns, operatorutils.GetExternalDnsTlsSecretName(externalDNS), map[string][]byte{corev1.TLSCertKey: certificateBytes, corev1.TLSPrivateKeyKey: privateKeyBytes}); err != nil {
return radixhttp.UnexpectedError(fmt.Sprintf("Failed to update TLS private key and certificate for %q", fqdn), err)
}

Expand Down

0 comments on commit 4103158

Please sign in to comment.