Skip to content

Commit

Permalink
Update APIEndpoint in ClusterStatus when adding master in non-ha (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojmhetar authored Jan 29, 2019
1 parent 5cb2891 commit d9e8798
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ func createMachine(ip string, port int, iface string, roleString string, publicK
if err == nil {
log.Fatal("Unable to create machine. This is a single master cluster.")
}

apiEndpoint := []clusterv1.APIEndpoint{
{
Host: ip,
Port: common.DefaultAPIServerPort,
},
}
cluster.Status.APIEndpoints = apiEndpoint
_, err = state.ClusterClient.ClusterV1alpha1().Clusters(common.DefaultNamespace).UpdateStatus(cluster)
if err != nil {
log.Fatalf("Unable to update cluster state: %v", err)
}
}

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

0 comments on commit d9e8798

Please sign in to comment.