Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV owned deployment does not controller true reference #2584

Open
esara opened this issue Jan 22, 2022 · 3 comments
Open

CSV owned deployment does not controller true reference #2584

esara opened this issue Jan 22, 2022 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triaged Issue has been considered by a member of the OLM community

Comments

@esara
Copy link

esara commented Jan 22, 2022

Bug Report

What did you do?
I am deploying operators from an operator catalog using OLM (in openshift or upsteam)

What did you expect to see?
I see the operator deployment created and it is owned/controlled by the CSV, specifically the "controller: true" attribute under ownerReferences

What did you see instead? Under which circumstances?
but the controller is false (it does not matter which csv/operator I am using - this is just an example)

$ oc get csv -n openshift-operators
NAME DISPLAY VERSION REPLACES PHASE
redhat-openshift-pipelines.v1.5.2 Red Hat OpenShift Pipelines 1.5.2 redhat-openshift-pipelines.v1.4.1 Succeeded

$ oc get deployment -n openshift-operators openshift-pipelines-operator -o=jsonpath='{.metadata.ownerReferences[]}'
{"apiVersion":"operators.coreos.com/v1alpha1","blockOwnerDeletion":false,"controller":false,"kind":"ClusterServiceVersion","name":"redhat-openshift-pipelines.v1.5.2","uid":"c7071a78-4dd6-45d7-8cc1-9cb80dfae4dd"}

Environment

  • operator-lifecycle-manager version:
    https://github.com/operator-framework/operator-lifecycle-manager/releases/tag/v0.20.0
    same behaviour in OCP 4.8

  • Kubernetes version information:
    $ kubectl version
    Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.6+bb8d50a", GitCommit:"cefce093e4e5bc9a1916eb5a489ed37c7d467f6f", GitTreeState:"clean", BuildDate:"2021-12-21T06:22:19Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

  • Kubernetes cluster kind:
    $ oc version
    Server Version: 4.8.26
    Kubernetes Version: v1.21.6+bb8d50a

Possible Solution
can we use true when setting in the ownerreference for CSV created resources?

Controller: &NotController,

@esara esara added the kind/bug Categorizes issue or PR as related to a bug. label Jan 22, 2022
@dinhxuanvu dinhxuanvu added the triaged Issue has been considered by a member of the OLM community label Feb 3, 2022
@dinhxuanvu
Copy link
Member

dinhxuanvu commented Feb 3, 2022

I would like to ask why you would like to set this Controller attribute to True. Does the change impact the behavior of the deployment in some way that you expect it to be? I simply want to see your particular use case for the usage of that attribute.

@esara
Copy link
Author

esara commented Feb 3, 2022

hi @dinhxuanvu semantically, there should be a significance to this attribute, you can have multiple ownerreferences, but if any of the owner reference is a controller, that is an indication that this deployment should not be modified, because the owner that is the controller is going to reconsile it.
Which is exactly the case here, the OLM will reconsile any changes to this deployment from the CSV, which is not only the owner, but based on this should be the controller for this deployment.
This should inform any automation not to make changes the deployment, but make changes to the controller/owner (the csv) in this case, through any CICD pipeline, so that the changes are correctly applied.

For example, in our code, we rely on this attribute to make (or prevent) changes
https://github.com/turbonomic/kubeturbo/blob/master/pkg/action/executor/k8s_controller.go#L104

And we cater to mapping to the owner in https://github.com/turbonomic/orm/

Please let me know if you need more details...

@kevinwangcn
Copy link

I also noticed this on a OCP4.7 cluster. It seems to me the OLM framework intentionally set this controller attribute to false, don't know if there is any special reason for this. but as the ClusterServiceVersion is only owner for a deployment and also it is contorlling the resources request/limit of that deployment, the field is supposed to set true which also fits the fact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triaged Issue has been considered by a member of the OLM community
Projects
None yet
Development

No branches or pull requests

3 participants