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
451fe44e
Commit
451fe44e
authored
5 years ago
by
Felix Kunde
Browse files
Options
Downloads
Patches
Plain Diff
fix source of problem and some typos
parent
c7fc4bf9
Branches
fix-quick-delete
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
pkg/cluster/cluster.go
+3
-1
3 additions, 1 deletion
pkg/cluster/cluster.go
pkg/cluster/util.go
+1
-1
1 addition, 1 deletion
pkg/cluster/util.go
pkg/controller/postgresql.go
+0
-8
0 additions, 8 deletions
pkg/controller/postgresql.go
pkg/util/k8sutil/k8sutil.go
+1
-1
1 addition, 1 deletion
pkg/util/k8sutil/k8sutil.go
with
5 additions
and
11 deletions
pkg/cluster/cluster.go
+
3
−
1
View file @
451fe44e
...
@@ -164,11 +164,13 @@ func (c *Cluster) setStatus(status string) {
...
@@ -164,11 +164,13 @@ func (c *Cluster) setStatus(status string) {
}
}
// we cannot do a full scale update here without fetching the previous manifest (as the resourceVersion may differ),
// we cannot do a full scale update here without fetching the previous manifest (as the resourceVersion may differ),
// however, we could do patch without it. In the future, once /status subresource is there (starting Kubernets 1.11)
// however, we could do patch without it. In the future, once /status subresource is there (starting Kubernet
e
s 1.11)
// we should take advantage of it.
// we should take advantage of it.
newspec
,
err
:=
c
.
KubeClient
.
AcidV1ClientSet
.
AcidV1
()
.
Postgresqls
(
c
.
clusterNamespace
())
.
Patch
(
c
.
Name
,
types
.
MergePatchType
,
patch
,
"status"
)
newspec
,
err
:=
c
.
KubeClient
.
AcidV1ClientSet
.
AcidV1
()
.
Postgresqls
(
c
.
clusterNamespace
())
.
Patch
(
c
.
Name
,
types
.
MergePatchType
,
patch
,
"status"
)
if
err
!=
nil
{
if
err
!=
nil
{
c
.
logger
.
Errorf
(
"could not update status: %v"
,
err
)
c
.
logger
.
Errorf
(
"could not update status: %v"
,
err
)
// return as newspec is empty, see PR654
return
}
}
// update the spec, maintaining the new resourceVersion.
// update the spec, maintaining the new resourceVersion.
c
.
setSpec
(
newspec
)
c
.
setSpec
(
newspec
)
...
...
This diff is collapsed.
Click to expand it.
pkg/cluster/util.go
+
1
−
1
View file @
451fe44e
...
@@ -365,7 +365,7 @@ func (c *Cluster) waitStatefulsetPodsReady() error {
...
@@ -365,7 +365,7 @@ func (c *Cluster) waitStatefulsetPodsReady() error {
c
.
setProcessName
(
"waiting for the pods of the statefulset"
)
c
.
setProcessName
(
"waiting for the pods of the statefulset"
)
// TODO: wait for the first Pod only
// TODO: wait for the first Pod only
if
err
:=
c
.
waitStatefulsetReady
();
err
!=
nil
{
if
err
:=
c
.
waitStatefulsetReady
();
err
!=
nil
{
return
fmt
.
Errorf
(
"stat
u
ful set error: %v"
,
err
)
return
fmt
.
Errorf
(
"stat
e
ful set error: %v"
,
err
)
}
}
// TODO: wait only for master
// TODO: wait only for master
...
...
This diff is collapsed.
Click to expand it.
pkg/controller/postgresql.go
+
0
−
8
View file @
451fe44e
...
@@ -258,14 +258,6 @@ func (c *Controller) processEvent(event ClusterEvent) {
...
@@ -258,14 +258,6 @@ func (c *Controller) processEvent(event ClusterEvent) {
}
}
lg
.
Infoln
(
"deletion of the cluster started"
)
lg
.
Infoln
(
"deletion of the cluster started"
)
// HACK if a delete happens too soon, cl fields are empty
// thus, pods, logical backup jobs and headless service will not get deleted
// see issues 551, 218
if
cl
.
Name
==
""
{
cl
.
Name
=
clusterName
.
Name
cl
.
Namespace
=
clusterName
.
Namespace
}
teamName
:=
strings
.
ToLower
(
cl
.
Spec
.
TeamID
)
teamName
:=
strings
.
ToLower
(
cl
.
Spec
.
TeamID
)
c
.
curWorkerCluster
.
Store
(
event
.
WorkerID
,
cl
)
c
.
curWorkerCluster
.
Store
(
event
.
WorkerID
,
cl
)
...
...
This diff is collapsed.
Click to expand it.
pkg/util/k8sutil/k8sutil.go
+
1
−
1
View file @
451fe44e
...
@@ -82,7 +82,7 @@ func ResourceNotFound(err error) bool {
...
@@ -82,7 +82,7 @@ func ResourceNotFound(err error) bool {
return
apierrors
.
IsNotFound
(
err
)
return
apierrors
.
IsNotFound
(
err
)
}
}
// NewFromConfig create Kubernets Interface using REST config
// NewFromConfig create Kubernet
e
s Interface using REST config
func
NewFromConfig
(
cfg
*
rest
.
Config
)
(
KubernetesClient
,
error
)
{
func
NewFromConfig
(
cfg
*
rest
.
Config
)
(
KubernetesClient
,
error
)
{
kubeClient
:=
KubernetesClient
{}
kubeClient
:=
KubernetesClient
{}
...
...
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
register
or
sign in
to comment