Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Conversation

tylerslaton
Copy link
Contributor

@tylerslaton tylerslaton commented Oct 26, 2023

If the Volume already has defaults, skip it. We don't want to overwrite defaults for volumes values as it can lead to unexpected behavior when volume classes are updated. One example is a volume class going down in size, which in turn will cause the volume to be sized down and likely go into an error state on the next app update.

This also includes a migration step away from Status.Defaults.VolumeSize. It removes the logic that originally set the VolumeSize field and instead hands that logic off to the Status.Defaults.Volumes map field. If VolumeSize was previously set, then we will set that in the Volumes map field as the default. This prevents any issues from occuring with existing volumes when the default VolumeClass is updated.

Checklist

  • The title of this PR would make a good line in Acorn's Release Note's Changelog
  • The title of this PR ends with a link to the main issue being address in parentheses, like: This is a title (#1216). Here's an example
  • All relevant issues are referenced in the PR description. NOTE: don't use GitHub keywords that auto-close issues
  • Commits follow contributing guidance
  • Automated tests added to cover the changes. If tests couldn't be added, an explanation is provided in the Verification and Testing section
  • Changes to user-facing functionality, API, CLI, and upgrade impacts are clearly called out in PR description
  • PR has at least two approvals before merging (or a reasonable exception, like it's just a docs change)

@tylerslaton tylerslaton requested a review from thedadams October 26, 2023 15:27
@tylerslaton tylerslaton changed the title Only set Status.Defaults.Volumes once Only set Status.Defaults.Volumes if it hasn't been set Oct 26, 2023
volumes:
foo:
class: test-volume-class
size: 4Gi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this particular test instance, we expect this to remain 4Gi after going through a reconciliation.

@tylerslaton tylerslaton marked this pull request as draft October 26, 2023 19:53
@tylerslaton tylerslaton force-pushed the volume-class-defaults branch 2 times, most recently from 4101482 to 3d4a715 Compare October 27, 2023 17:23
@tylerslaton tylerslaton marked this pull request as ready for review October 27, 2023 17:44
This also includes a migration step away from Status.Defaults.VolumeSize. It
removes the logic that originally set the VolumeSize field and instead hands
that logic off to the `Status.Defaults.Volumes` map field. If VolumeSize was
previously set, then we will set that in the Volumes map field as the default.
This prevents any issues from occuring with existing volumes when the default
VolumeClass is updated.

Signed-off-by: tylerslaton <mtslaton1@gmail.com>
Signed-off-by: tylerslaton <mtslaton1@gmail.com>
@tylerslaton tylerslaton force-pushed the volume-class-defaults branch from b85986f to 3bb3a13 Compare November 2, 2023 13:51
@tylerslaton
Copy link
Contributor Author

tylerslaton commented Nov 2, 2023

@thedadams @g-linville I was giving this a test before merging and noticed some behavior that was not quite right, mainly around the migration. I've gone ahead and updated this PR to fix that issue. Please let me know if I can answer any questions. Re-requesting review for the time being. The changes are in a new commit for simplicity.

@tylerslaton tylerslaton force-pushed the volume-class-defaults branch 2 times, most recently from 4e940b8 to a08975e Compare November 2, 2023 16:48
…en set

Signed-off-by: tylerslaton <mtslaton1@gmail.com>
@tylerslaton tylerslaton force-pushed the volume-class-defaults branch from a08975e to cb3ec26 Compare November 2, 2023 20:28
Signed-off-by: tylerslaton <mtslaton1@gmail.com>
@tylerslaton tylerslaton merged commit ba42df7 into acorn-io:main Nov 3, 2023
@tylerslaton tylerslaton deleted the volume-class-defaults branch November 3, 2023 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants