Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AthenZ/k8s-athenz-sia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 627d67ba5f756425afaf7d0475d03eb6e86d4e3d
Choose a base ref
..
head repository: AthenZ/k8s-athenz-sia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 27d95e81f7730579a8e2e263cd948262604bafbe
Choose a head ref
Showing with 10 additions and 6 deletions.
  1. +10 −6 pkg/certificate/service.go
16 changes: 10 additions & 6 deletions pkg/certificate/service.go
Original file line number Diff line number Diff line change
@@ -235,9 +235,11 @@ func New(ctx context.Context, idConfig *config.IdentityConfig) (daemon.Daemon, e
keyPEM = k8sSecretBackupKeyPEM
log.Infof("Successfully loaded x509 certificate from kubernetes secret")

err = idConfig.Reloader.UpdateCertificate([]byte(identity.X509CertificatePEM), keyPEM)
if err != nil {
log.Errorf("Failed to reload x509 certificate from identity provider: %s", err.Error())
if identity != nil && len(keyPEM) != 0 {
err = idConfig.Reloader.UpdateCertificate([]byte(identity.X509CertificatePEM), keyPEM)
if err != nil {
log.Errorf("Failed to reload x509 certificate from identity provider: %s", err.Error())
}
}
}
} else {
@@ -257,9 +259,11 @@ func New(ctx context.Context, idConfig *config.IdentityConfig) (daemon.Daemon, e
} else {
identity = forceInitIdentity
keyPEM = forceInitKeyPEM
err = idConfig.Reloader.UpdateCertificate([]byte(identity.X509CertificatePEM), keyPEM)
if err != nil {
log.Errorf("Failed to reload x509 certificate from identity provider: %s", err.Error())
if identity != nil && len(keyPEM) != 0 {
err = idConfig.Reloader.UpdateCertificate([]byte(identity.X509CertificatePEM), keyPEM)
if err != nil {
log.Errorf("Failed to reload x509 certificate from identity provider: %s", err.Error())
}
}
}
}