Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 46b5a7f

Browse files
committed
check for empty CA cert/key when creating machine
1 parent 4775de1 commit 46b5a7f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cloud/packet/actuators/machine/actuator.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machi
106106
role = "master"
107107
caCert = clusterConfig.CAKeyPair.Cert
108108
caKey = clusterConfig.CAKeyPair.Key
109+
if len(caCert) == 0 {
110+
return fmt.Errorf("CA Certificate not yet created")
111+
}
112+
if len(caKey) == 0 {
113+
return fmt.Errorf("CA Key not yet created")
114+
}
109115
tags = append(tags, util.MasterTag)
110116
} else {
111117
token, err = a.deployer.NewBootstrapToken(cluster)

0 commit comments

Comments
 (0)