1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Simplify code

This commit is contained in:
Ewout Prangsma 2018-03-23 12:25:09 +01:00
parent a838b69b96
commit ba407b6eb9
No known key found for this signature in database
GPG key ID: 4DBAD380D93D0698

View file

@ -40,14 +40,14 @@ func (d *Deployment) inspectPods() error {
log := d.deps.Log
var events []*v1.Event
pods, err := d.deps.KubeCli.CoreV1().Pods(d.apiObject.GetNamespace()).List(k8sutil.DeploymentListOpt(d.apiObject.GetName()))
pods, err := d.GetOwnedPods()
if err != nil {
log.Debug().Err(err).Msg("Failed to list pods")
log.Debug().Err(err).Msg("Failed to get owned pods")
return maskAny(err)
}
// Update member status from all pods found
for _, p := range pods.Items {
for _, p := range pods {
// Check ownership
if !d.isOwnerOf(&p) {
log.Debug().Str("pod", p.GetName()).Msg("pod not owned by this deployment")
@ -101,7 +101,7 @@ func (d *Deployment) inspectPods() error {
}
podExists := func(podName string) bool {
for _, p := range pods.Items {
for _, p := range pods {
if p.GetName() == podName && d.isOwnerOf(&p) {
return true
}