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

Ezml 1226 versions semantic control #600

Conversation

Kosta91
Copy link
Collaborator

@Kosta91 Kosta91 commented Apr 28, 2022

Resolves #590

if prevCrApp.Spec.Version == crApp.Spec.Version {
prevVer := semver.New(prevCrApp.Spec.Version)
newVer := semver.New(crApp.Spec.Version)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, prevVer and/or newVer can be nil if the version string is not understood by semver. In those cases we should also reject the upgrade.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, my mistake. In those cases, New will panic, which is bad for us.

Try using NewVersion (instead of New) as in https://github.com/coreos/go-semver/blob/main/example.go

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

@joel-bluedata
Copy link
Member

Also note that Travis CI is reporting that you need to run "make format".

@Kosta91
Copy link
Collaborator Author

Kosta91 commented Apr 29, 2022

Also note that Travis CI is reporting that you need to run "make format".

Also note that Travis CI is reporting that you need to run "make format".

Fixed

@joel-bluedata
Copy link
Member

Nice.

@joel-bluedata joel-bluedata merged commit 069a556 into bluek8s:live-app-upgrade Apr 29, 2022
@Kosta91 Kosta91 deleted the EZML-1226-versions-semantic-control branch May 2, 2022 08:52
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

Successfully merging this pull request may close these issues.

2 participants