Skip to content

Commit

Permalink
do not panic if no public key is set (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos authored Apr 25, 2024
1 parent cd5330a commit 10f061a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/k8s/pkg/k8sd/app/hooks_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ func (a *App) onStart(s *state.State) error {
if err != nil {
return nil, fmt.Errorf("failed to load RSA key from configuration: %w", err)
}
keyPEM := cfg.Certificates.GetK8sdPublicKey()
key, err := pki.LoadRSAPublicKey(cfg.Certificates.GetK8sdPublicKey())
if err != nil {
if err != nil && keyPEM != "" {
return nil, fmt.Errorf("failed to load RSA key: %w", err)
}
return key, nil
Expand Down

0 comments on commit 10f061a

Please sign in to comment.