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

InstallPlan cannot resolve a change to immutable field in operator Deployment spec #1608

Closed
aharbis opened this issue Jun 25, 2020 · 8 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. triage/support Indicates an issue that is a support question. triage/unresolved Indicates an issue that can not or will not be resolved.

Comments

@aharbis
Copy link

aharbis commented Jun 25, 2020

Bug Report

What did you do?

Between two releases of our operator, we modified the labels on our operator's Deployment resource.

What did you expect to see?

OLM successfully resolve the new InstallPlan and Deployment spec, and perform the update.

What did you see instead? Under which circumstances?

OLM failed to perform the update, and the InstallPlan failed with an error such as:

install strategy failed: Deployment.apps "datapower-operator" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"datapower-operator", "app.kubernetes.io/managed-by":"datapower-operator", "app.kubernetes.io/name":"datapower-operator", "name":"datapower-operator"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

Environment

  • operator-lifecycle-manager version:

OCP 4.4.3, not sure on specific OLM version.

  • Kubernetes version information:
$ oc version
Client Version: openshift-clients-4.3.0-201910250623-88-g6a937dfe
Server Version: 4.4.3
Kubernetes Version: v1.17.1
  • Kubernetes cluster kind: OCP

Possible Solution

If some change is found during the InstallPlan such as this, which causes a diff on an immutable field, the Deployment could be deleted by OLM and recreated to resolve the issue (this is what we had to do manually as a workaround).

Additional context
Add any other context about the problem here.

@stale
Copy link

stale bot commented Aug 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 24, 2020
@aharbis
Copy link
Author

aharbis commented Aug 25, 2020

bump

@stale stale bot removed the wontfix label Aug 25, 2020
@exdx exdx added kind/bug Categorizes issue or PR as related to a bug. triage/support Indicates an issue that is a support question. labels Aug 27, 2020
@prafull01
Copy link

@exdx If no one is working on this, I can pick it up..

@cdjohnson
Copy link

@aharbis There was a workaround documented here:
#952 (comment)

Basically, if you are adding a label or otherwise immutable change, you can just rename the deployment, which will cause a new one to be created instead of the existing updated. Is this an acceptable workaround?

@aharbis
Copy link
Author

aharbis commented Oct 5, 2020

@cdjohnson Yes, that's the workaround that we documented in our upgrade docs. I still believe this is something that should be handled by OLM gracefully.

@stale
Copy link

stale bot commented Dec 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 4, 2020
@openshift-ci-robot openshift-ci-robot added triage/unresolved Indicates an issue that can not or will not be resolved. and removed wontfix labels Dec 5, 2020
@stale
Copy link

stale bot commented Mar 5, 2021

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contribution.
For more help on your issue, check out the olm-dev channel on the kubernetes slack [1] and the OLM Dev Working Group [2] [1] https://kubernetes.slack.com/archives/C0181L6JYQ2 [2] https://github.com/operator-framework/community#operator-lifecycle-manager-wg

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 5, 2021
@stale
Copy link

stale bot commented Mar 15, 2021

This issue has been automatically closed because it has not had any recent activity. Thank you for your contribution.

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. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. triage/support Indicates an issue that is a support question. triage/unresolved Indicates an issue that can not or will not be resolved.
Projects
None yet
Development

No branches or pull requests

5 participants