Skip to content

Commit

Permalink
chore: useless change
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrinux committed Dec 6, 2024
1 parent 2afc70f commit 3351af5
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions internal/controller/dragonfly_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,25 +168,15 @@ func (dfi *DragonflyInstance) masterExists(ctx context.Context) (bool, error) {
}

func (dfi *DragonflyInstance) getMasterIp(ctx context.Context) (string, error) {
dfi.log.Info("retrieving IP of the master")
dfi.log.Info("retrieving ip of the master")
pods, err := dfi.getPods(ctx)
if err != nil {
return "", err
}

for _, pod := range pods.Items {
if pod.Status.Phase == corev1.PodRunning &&
pod.Status.ContainerStatuses[0].Ready &&
pod.Labels[resources.Role] == resources.Master {

masterIp, hasMasterIp := pod.Annotations[resources.MasterIp]
if hasMasterIp {
dfi.log.Info("Retrieved Master IP from annotation", "masterIp", masterIp)
return masterIp, nil
}

masterIp = pod.Status.PodIP
return masterIp, nil
if pod.Status.Phase == corev1.PodRunning && pod.Status.ContainerStatuses[0].Ready && pod.Labels[resources.Role] == resources.Master {
return pod.Status.PodIP, nil
}
}

Expand Down

0 comments on commit 3351af5

Please sign in to comment.