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

Commit da79951

Browse files
committed
handle parseUserdata if no endpoints available
1 parent 967f7a2 commit da79951

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func parseUserdata(userdata, role string, cluster *clusterv1.Cluster, machine *c
3939
}
4040
vars := masterEnvironmentVariables
4141
if role == "node" {
42+
// is the cluster ready?
43+
if len(cluster.Status.APIEndpoints) == 0 {
44+
return "", fmt.Errorf("cluster not yet ready, has 0 API endpoints")
45+
}
4246
params.MasterEndpoint = endpoint(cluster.Status.APIEndpoints[0])
4347
vars = nodeEnvironmentVariables
4448
}

0 commit comments

Comments
 (0)