Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
postgres-operator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
zalando
postgres-operator
Commits
3b8c0641
Commit
3b8c0641
authored
Oct 5, 2017
by
Murat Kabilov
Committed by
GitHub
Oct 5, 2017
Browse files
Options
Downloads
Patches
Plain Diff
skip manual failover for 1-pod clusters
parent
bd9b0b61
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/cluster/pod.go
+5
-3
5 additions, 3 deletions
pkg/cluster/pod.go
with
5 additions
and
3 deletions
pkg/cluster/pod.go
+
5
−
3
View file @
3b8c0641
...
@@ -146,10 +146,12 @@ func (c *Cluster) recreatePods() error {
...
@@ -146,10 +146,12 @@ func (c *Cluster) recreatePods() error {
if
masterPod
.
Name
==
""
{
if
masterPod
.
Name
==
""
{
c
.
logger
.
Warningln
(
"no master pod in the cluster"
)
c
.
logger
.
Warningln
(
"no master pod in the cluster"
)
}
else
{
}
else
{
if
len
(
replicas
)
>
0
{
err
:=
c
.
ManualFailover
(
&
masterPod
,
masterCandidate
(
replicas
))
err
:=
c
.
ManualFailover
(
&
masterPod
,
masterCandidate
(
replicas
))
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"could not perform manual failover: %v"
,
err
)
return
fmt
.
Errorf
(
"could not perform manual failover: %v"
,
err
)
}
}
}
//TODO: specify master, leave new master empty
//TODO: specify master, leave new master empty
c
.
logger
.
Infof
(
"recreating master pod %q"
,
util
.
NameFromMeta
(
masterPod
.
ObjectMeta
))
c
.
logger
.
Infof
(
"recreating master pod %q"
,
util
.
NameFromMeta
(
masterPod
.
ObjectMeta
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment