Skip to content

Commit 2a3ec04

Browse files
authored
Fix selector for sentinel pods
The second -l overwrote the first which meant it picked up the first sentinel for any redis instead of the one you wanted.
1 parent 8ed2ce1 commit 2a3ec04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

k

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,7 @@ def redis_cli
26172617
name
26182618
else
26192619
# Rely on Reclaim the Stack's sentinel based approach without operator
2620-
sentinel_pod_yaml = read_kubectl("get pods -l redis.reclaim-the-stack.com/cluster=#{redis_cluster} -l redis.reclaim-the-stack.com/component=sentinel --field-selector=status.phase=Running -o yaml")
2620+
sentinel_pod_yaml = read_kubectl("get pods -l redis.reclaim-the-stack.com/cluster=#{redis_cluster},redis.reclaim-the-stack.com/component=sentinel --field-selector=status.phase=Running -o yaml")
26212621

26222622
sentinel_pod = YAML.safe_load(sentinel_pod_yaml).dig("items", 0, "metadata", "name")
26232623
abort "Error: no sentinel pod found for '#{redis_cluster}'" unless sentinel_pod
@@ -2702,7 +2702,7 @@ def redis_failover
27022702
end
27032703
else
27042704
# Rely on Reclaim the Stack's sentinel based approach without operator
2705-
sentinel_pod_yaml = read_kubectl("get pods -l redis.reclaim-the-stack.com/cluster=#{redis_cluster} -l redis.reclaim-the-stack.com/component=sentinel --field-selector=status.phase=Running -o yaml")
2705+
sentinel_pod_yaml = read_kubectl("get pods -l redis.reclaim-the-stack.com/cluster=#{redis_cluster},redis.reclaim-the-stack.com/component=sentinel --field-selector=status.phase=Running -o yaml")
27062706
abort "Error: no sentinel pod found for #{redis_cluster}" if sentinel_pod_yaml.empty?
27072707

27082708
sentinel_pod = YAML.safe_load(sentinel_pod_yaml).dig("items", 0, "metadata", "name")

0 commit comments

Comments
 (0)