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

OLM doesn't revert modified deployment of operator #1853

Closed
zkyle95 opened this issue Nov 4, 2020 · 3 comments
Closed

OLM doesn't revert modified deployment of operator #1853

zkyle95 opened this issue Nov 4, 2020 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@zkyle95
Copy link
Contributor

zkyle95 commented Nov 4, 2020

Bug Report

What did you do?

  1. Subscribe an operator on operatorhub console

  2. Scale down operator deployment

What did you expect to see?

Deployment be scaled up or rolled back soon.

What did you see instead? Under which circumstances?

The replicas of deployment keep 0 and CSV phase remains succeed

Environment

  • operator-lifecycle-manager version:

    0e65642

  • Kubernetes version information:

    v1.19.1

  • Kubernetes cluster kind:

    Kubernetes created with kind

Possible Solution

Additional context

Remove the deployment and it will be rebuild soon.

@zkyle95
Copy link
Contributor Author

zkyle95 commented Nov 4, 2020

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 4, 2020
@zkyle95
Copy link
Contributor Author

zkyle95 commented Nov 4, 2020

I found that OLM compares the hash set in label of existing deployment with calculated from CSV.spec.install.spec.deployments, but both of these hash values won't be updated when deployment is modified directly, which made them equled always.

_, calculatedDeploymentHash, err := i.deploymentForSpec(spec.Name, spec.Spec)

I'd like to solve this bug if my analysis is right 😃 @awgreene

@awgreene
Copy link
Member

awgreene commented Nov 9, 2020

Thank you for submitting this bug @zkyle95 - after reading your most recent comment, I believe that OLM is working as intended.

OLM uses the deploymentHash to ensure that the resources created by OLM match those defined in the CSV. This approach allows a user to edit the resources once they are installed and prevents OLM from entering an endless loop when a webhook is changing the resource before it is saved to the object store.

I am planning to close this issue as things are working as intended.

@awgreene awgreene closed this as completed Nov 9, 2020
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.
Projects
None yet
Development

No branches or pull requests

3 participants