Skip to content

Commit

Permalink
fix: when blue-green upgreda, should selector old version sts for req…
Browse files Browse the repository at this point in the history
…uest API

Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
Rory-Z committed Oct 8, 2023
1 parent 935bf8a commit aec37c6
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions controllers/apps/v2beta1/emqx_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,12 @@ func newRequester(k8sClient client.Client, instance *appsv2beta1.EMQX) (innerReq
}

labels := appsv2beta1.DefaultCoreLabels(instance)
if instance.Status.IsConditionTrue(appsv2beta1.Available) {
if instance.Status.CoreNodesStatus.UpdateRevision != "" {
labels = appsv2beta1.CloneAndAddLabel(
labels,
appsv2beta1.LabelsPodTemplateHashKey,
instance.Status.CoreNodesStatus.UpdateRevision,
)
}
} else {
if instance.Status.CoreNodesStatus.CurrentRevision != "" {
labels = appsv2beta1.CloneAndAddLabel(
labels,
appsv2beta1.LabelsPodTemplateHashKey,
instance.Status.CoreNodesStatus.CurrentRevision,
)

}
if instance.Status.CoreNodesStatus.CurrentRevision != "" {
labels = appsv2beta1.CloneAndAddLabel(
labels,
appsv2beta1.LabelsPodTemplateHashKey,
instance.Status.CoreNodesStatus.CurrentRevision,
)
}

podList := &corev1.PodList{}
Expand Down

0 comments on commit aec37c6

Please sign in to comment.