Skip to content

Ansible operator does not detect unauthorized changes to resources that are managed by the operator on multi namespace mode #4647

@slopezz

Description

@slopezz

Bug Report

What did you do?

I am upgrading an ansible operator from old v0.18.1 to latest v1.4.2 (adding also multi namespace support at the CSV).

I deploy the ansible operator with OLM with MultiNamespace support (setting 2 namespaces on targetNamespaces field at OperatorGroup resource), I create a CR on 2 diferent namespaces, and operator reconciles them by creating all needed dependant objects on every namespace

However, if I delete manually any object belonging to that created CRs on any on the namespaces, ansible operator doesn't detect they are missing, and never run a reconcile to recreate them.

If I run the operator locally watching both namespaces (make run WATCH_NAMESPACE=ns1,ns2 target), that way the ansible operator works fine, so any manual object deletion triggers immediately a reconcile loop that recreates the missing objects.

It has the same behaviour with operator-sdk v1.5.0

What did you expect to see?

After a manual deletion of a dependant object from a CR, I expect the operator to recreate it immediately.

What did you see instead? Under which circumstances?

Nothing, deleted objects that belongs to a CR are never recreated, unless I update the CRs, so that way ansible runs the reconcile.

Environment

Operator type:

/language ansible

Kubernetes cluster type: Openshift v4.7.0

$ operator-sdk version

operator-sdk version: "v1.4.2", commit: "4b083393be65589358b3e0416573df04f4ae8d9b", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "linux", GOARCH: "amd64" 

And:

operator-sdk version: "v1.5.0", commit: "98f30d59ade2d911a7a8c76f0169a7de0dec37a0", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "linux", GOARCH: "amd64" 

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.13-dispatcher", GitCommit:"fd22db44e150011eccc8729db223945384460143", GitTreeState:"clean", BuildDate:"2020-07-24T07:27:52Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0+bd9e442", GitCommit:"bd9e4421804c212e6ac7ee074050096f08dda543", GitTreeState:"clean", BuildDate:"2021-02-11T23:05:38Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"} 

Possible Solution

Additional context

Metadata

Metadata

Labels

language/ansibleIssue is related to an Ansible operator projectolm-integrationIssue relates to the OLM integration

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions