Skip to content

Commit d9e8798

Browse files
authored
Update APIEndpoint in ClusterStatus when adding master in non-ha (#161)
1 parent 5cb2891 commit d9e8798

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/machine.go

+12
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ func createMachine(ip string, port int, iface string, roleString string, publicK
157157
if err == nil {
158158
log.Fatal("Unable to create machine. This is a single master cluster.")
159159
}
160+
161+
apiEndpoint := []clusterv1.APIEndpoint{
162+
{
163+
Host: ip,
164+
Port: common.DefaultAPIServerPort,
165+
},
166+
}
167+
cluster.Status.APIEndpoints = apiEndpoint
168+
_, err = state.ClusterClient.ClusterV1alpha1().Clusters(common.DefaultNamespace).UpdateStatus(cluster)
169+
if err != nil {
170+
log.Fatalf("Unable to update cluster state: %v", err)
171+
}
160172
}
161173

162174
sshCredentialSecret, err := state.KubeClient.CoreV1().Secrets(common.DefaultNamespace).Get(common.DefaultSSHCredentialSecretName, metav1.GetOptions{})

0 commit comments

Comments
 (0)