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

Fix an issue with default VolmeStorage not being accounted for in QuotaRequests #2240

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

tylerslaton
Copy link
Contributor

@tylerslaton tylerslaton commented Oct 12, 2023

Before this PR, we were not accounting for the scenario that the Volume will receive a default size. This caused a number of issues regarding approval of resources.

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 marked this pull request as ready for review October 12, 2023 21:02
// if it does fail, we'll just return the default size.
parsedQuantity, err := resource.ParseQuantity(string(defaultVolume.Size))
if err == nil {
result = parsedQuantity
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This felt like the right behavior to me if a size failed to parse, but let me know if something else makes more sense.

// 2. The volume's size is not set. This means we should assume the default size.
// 3. The volume's size is set to a specific value. This means we should use that value.
var sizeQuantity resource.Quantity
switch size {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the size of bound volumes are counted here. Is there any risk that we are double-counting bound volumes? Or are we saying you can have as many volumes as you want as long as none of them are bound?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Talked offline about this, there's some wonky-ness with the boundVolumeSize function that we'll need to address. We came to the conclusion that this should merge as is and a follow-up should be created to fix it.

@tylerslaton tylerslaton requested a review from thedadams October 13, 2023 15:52
@tylerslaton tylerslaton merged commit 11b735b into acorn-io:main Oct 13, 2023
4 checks passed
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