Skip to content

Ansible operator markDone function causing DPANIC in reconcile.go #2025

@rammohanc

Description

@rammohanc

Bug Report

When deleting a CR , markDone function is causing DPANIC

2019-09-30T21:50:00.152Z DPANIC markDone odd number of arguments passed as key-value pairs for logging {"ignored key": "sabreprojects.ngp.sabre.com \"ram08291-free-tier\" not found"}
github.com/go-logr/zapr.handleFields
/root/go/pkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:106
github.com/go-logr/zapr.(*infoLogger).Info
/root/go/pkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:70
github.com/operator-framework/operator-sdk/pkg/ansible/controller.(*AnsibleOperatorReconciler).markDone
/home/rammohan/ansible-operator-v0.10.0+max_worker_fix/operator-sdk/pkg/ansible/controller/reconcile.go:313
github.com/operator-framework/operator-sdk/pkg/ansible/controller.(*AnsibleOperatorReconciler).Reconcile
/home/rammohan/ansible-operator-v0.10.0+max_worker_fix/operator-sdk/pkg/ansible/controller/reconcile.go:222
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.1.10/pkg/internal/controller/controller.go:215
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
/root/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.1.10/pkg/internal/controller/controller.go:158
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1
/root/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190221213512-86fb29eff628/pkg/util/wait/wait.go:133
k8s.io/apimachinery/pkg/util/wait.JitterUntil
/root/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190221213512-86fb29eff628/pkg/util/wait/wait.go:134
k8s.io/apimachinery/pkg/util/wait.Until
/root/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190221213512-86fb29eff628/pkg/util/wait/wait.go:88

What did you do?
Deleting CR is causing above issue

What did you expect to see?
markDone call should not cause DPANIC when it cannot find the Kubernetes object

What did you see instead? Under which circumstances?
During CR deletion, markDone function call is causing DPANIC

Environment

  • operator-sdk version: v0.10.x,

  • go version: go1.12.4

  • Kubernetes version information: v1.11.0+d4cacc0

  • Kubernetes cluster kind: Openshift v3.11.141

  • Are you writing your operator in ansible, helm, or go?
    Ansible

Possible Solution
Don not pass the 'err' object to the logger call below
logger.Info("Resource not found, assuming it was deleted", err)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.language/ansibleIssue is related to an Ansible operator project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions