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

Phase upgrade seems to not work #85

Closed
abergmeier opened this issue Dec 9, 2019 · 8 comments
Closed

Phase upgrade seems to not work #85

abergmeier opened this issue Dec 9, 2019 · 8 comments

Comments

@abergmeier
Copy link

abergmeier commented Dec 9, 2019

I switched Operator to 3.0.0 and get the following errors:

reflector.go:125] pkg/mod/k8s.io/client-go@v0.0.0-20190918200256-06eb1244587a/tools/cache/reflector.go:98: Failed to list *v1alpha1.Grafana: v1alpha1.GrafanaList.ListMeta: v1.ListMeta.TypeMeta: Kind: Items: []v1alpha1.Grafana: v1alpha1.Grafana.Status: v1alpha1.GrafanaStatus.Phase: ReadString: expects " or n, but found 3, error found in #10 byte of ...|,"phase":3}}],"kind"|..., bigger context ...|nfig":"e8febc1cafc5509cb3f45ddd35a7eed0","phase":3}}],"kind":"GrafanaList","metadata":{"continue":""|...

In the status maps, you find phase values like:

phase: 3

Since phase is a string, I think it would be necessary to at least upgrade the status to be

phase: "3"

If phase was an int in the past, a complete conversion would be great ;)

@abergmeier
Copy link
Author

Tried to analyze but am not really sure, which Decoder the reflector uses.

@metalmatze
Copy link

Yes. I've seen that too. Resolved by deleting the status of all Custom Resources. 🤷‍♂️

@pb82
Copy link
Collaborator

pb82 commented Dec 10, 2019

Unfortunately there's no direct upgrade path from 2.0.0 to 3.0.0. It basically requires an uninstall, CRD update & reinstall. I'll put together more detailled instructions.

@abergmeier
Copy link
Author

there's no direct upgrade path from 2.0.0 to 3.0.0

Why is that?

@pb82
Copy link
Collaborator

pb82 commented Dec 10, 2019

@abergmeier It's because the format of the resource status has changed. As your error indicates, phase is now a string. Also the whole status property is now handled as a subresource and finalizers are no longer used. Ideally we would have updated the CRD version but had some constraints that prevented us from doing so.

I've added upgrade steps: https://github.com/integr8ly/grafana-operator/blob/master/documentation/upgrade.md

Hope that help and sorry for the break in compatibility with older versions.

@abergmeier
Copy link
Author

Maybe in future have a look at other Operators like Tekton, which handle breaking Resource changes gracefully.

@abergmeier
Copy link
Author

Ideally we would have updated the CRD version but had some constraints that prevented us from doing so.

Can you elaborate? AFAIK CRD versions are not meant to change over time.

@HVBE
Copy link
Collaborator

HVBE commented Nov 23, 2020

There was a move to make the whole operator stateless, this meant removing some stateful fields from CRDs, hence the breaking change and major version bump for the operator from 2.0.0 -> 3.0.0, this now means that every version past 3.0.0 won't break on upgrade (hopefully), the added benefit was the fact that the operator wouldn't leave any "dirty" resources lying around since finalizers were no longer required. Overall this provides user with a more robust operator, the drawback is that the upgrade is quite bothersome in some cases.
Haven't heard of anyone else coming upon this , stale issue, Closing off.

@HVBE HVBE closed this as completed Nov 23, 2020
NissesSenap added a commit to NissesSenap/grafana-operator that referenced this issue Mar 14, 2023
NissesSenap added a commit that referenced this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants