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

✨ Check CAPI provider latest version daily #679

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

Danil-Grigorev
Copy link
Contributor

@Danil-Grigorev Danil-Grigorev commented Aug 20, 2024

  • Perform check that CAPIProvider is up-to-date with current latest daily. Longer delay is set to prevent hitting github rate limits.

What this PR does / why we need it:

This change performs daily check for provider upgrades, and performs the actual upgrade automatically, if the CAPIProvider version is not set. If it is set, the version is user managed so we don’t upgrade this automatically.

Once upstream (capi-operator) has a condition to notify about new version availability, this daily check can be changed to rely on the status condition.

This change ensures we don’t leave existing users on older versions of providers.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #673

Special notes for your reviewer:

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@Danil-Grigorev Danil-Grigorev requested a review from a team as a code owner August 20, 2024 09:18
@Danil-Grigorev Danil-Grigorev force-pushed the provider-version-bump branch 2 times, most recently from 7ad48a7 to 07888f5 Compare August 20, 2024 11:01
- Perform check that CAPIProvider is up-to-date with current latest
  daily. Longer delay is set to prevent hitting github rate limits.

Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
@Danil-Grigorev Danil-Grigorev force-pushed the provider-version-bump branch 2 times, most recently from 4c9d4fe to e65924e Compare August 20, 2024 14:30
@Danil-Grigorev Danil-Grigorev enabled auto-merge (squash) August 20, 2024 16:02
@Danil-Grigorev Danil-Grigorev requested review from a team and removed request for a team August 21, 2024 06:39
Copy link
Contributor

@salasberryfin salasberryfin left a comment

Choose a reason for hiding this comment

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

LGMT but I'm wondering what would happen if a latest version breaks something and user needs to roll back to previous one. Would they need to manually specify a version so this check is not performed?

Copy link
Member

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

In my opinion the default behavior should stay as it is today and automatic updates can be enabled with a separate API field.

@Danil-Grigorev
Copy link
Contributor Author

@alexander-demicev This can be addressed in the followup pr.

@furkatgofurov7
Copy link
Contributor

Does this try to avoid the need for bumping versions of core CAPI and providers manually (i.e in go.mod)? When CAPI is
released, let's say 1.8.0, not all providers, release the compatible version to that of CAPI. Would that mean we will test CAPI 1.8.0 and CAPI Provider complaint with CAPI 1.7?

@alexander-demicev
Copy link
Member

@Danil-Grigorev sure, in that case let's merge this PR after the release, and as @furkatgofurov7 mentioned we would also need to pin e2e suite dependencies if want to test the same CAPI version as now

@alexander-demicev
Copy link
Member

@Danil-Grigorev Let's take a bit more time to think about this feature, just to avoid any issues before the release

@Danil-Grigorev
Copy link
Contributor Author

@alexander-demicev This change is required if #672 is planned to shipped this release. Otherwise users will have to update manually to 1.7.x, and there is a room for error. (Side note: this needs to be documented, that version bump needs to be manual).

@alexander-demicev
Copy link
Member

Manual updates after the Turtles upgrade are ok, automatic updates of CAPI providers should be an optional feature

@Danil-Grigorev
Copy link
Contributor Author

Danil-Grigorev commented Aug 21, 2024

I’m not opposed to optionality of this feature. I think that it should be a part of the followup PR, where it can be decided which providers will have it set by default, which will not, since it is contracting the change of this PR, but I’m of a different opinion about latest behavior, since latests is a moving target, an it needs to be taken this way.

@salasberryfin Users can always specify a different version if they see an issue, or for any other imaginable reason. This PR or any other change should not affect (interfere) with this functionality. We also test this combination of current latest for each provider, so if it happens we need to address it in our CI. Also this supports the need to have every version of the CAPI/provider release to be mirrored, since an issue may force a larger version gap downgrade. + Direct downgrades of major.minor are not supported by the CAPI Operator, only patch versions. This requires the removal of the proxied provider in advance (a detail to add to troubleshooting section of the docs)

@furkatgofurov7 I think it is unrelated to this PR, this has nothing to do with go.mod version bumps. We have an upper cap of provider version, and this is defined by the current version of the clusterctl.yaml config map (CAPI at 1.7.3 there now, this is latest for the next release). I’ll open an issue to address CAPIProvider documentation, functionality and versioning strategy.

@alexander-demicev
Copy link
Member

alexander-demicev commented Aug 23, 2024

@Danil-Grigorev would you like to make the feature optional in this PR or in a follow-up? We can merge it like it is now if you want to do it in a follow-up

@Danil-Grigorev
Copy link
Contributor Author

Yes please, I'd like to make a follow up PR @alexander-demicev as already mentioned

@Danil-Grigorev Danil-Grigorev merged commit 4e377f9 into rancher:main Aug 26, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement automatic upgrade of provider versions
4 participants