Skip to content

Size Reservations - #80

Open
majst01 wants to merge 3 commits into
mainfrom
size-reservations
Open

majst01 wants to merge 3 commits into
mainfrom
size-reservations

Conversation

@majst01

@majst01 majst01 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Description

Size Reservations where missing

Used AI-Tools ✨

  • Deepseek used for generation

@majst01
majst01 requested a review from a team as a code owner November 19, 2026 14:55
@majst01
majst01 requested a review from vknabel November 19, 2026 14:55
@majst01 majst01 self-assigned this Nov 19, 2026
Comment thread cmd/admin/v2/commands.go Outdated
adminCmd.AddCommand(newPartitionCmd(c))
adminCmd.AddCommand(newProjectCmd(c))
adminCmd.AddCommand(newSizeCmd(c))
adminCmd.AddCommand(newSizeReservationCmd(c))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we should make this command a child of size?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines +85 to +86
// the admin api does not offer a dedicated get call for size reservations,
// so we filter the list by the given id.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The question is why... in the repository the get function is implemented. 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wait... I think I found a get in the normal API and not the Admin API?

Comment thread cmd/admin/v2/size-reservation.go Outdated
Comment on lines +245 to +252
func amountFromCLI() *int32 {
amount := viper.GetInt32("amount")
if amount <= 0 {
return nil
}

return new(amount)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pointer.PointerOrNil should be cleaner than ignoring this flag silently.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread cmd/completion/size_reservation.go Outdated
"github.com/spf13/cobra"
)

// AdminSizeReservation lists all size reservations across projects, used for admin completions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No comment needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed

"project": func(a, b *apiv2.SizeReservation, descending bool) multisort.CompareResult {
return multisort.Compare(a.Project, b.Project, descending)
},
"size": func(a, b *apiv2.SizeReservation, descending bool) multisort.CompareResult {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Filter by amount might be interesting?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Gerrit91
Gerrit91 previously approved these changes Nov 20, 2026
@Gerrit91
Gerrit91 dismissed their stale review November 20, 2026 12:16

I wanted to add the Size Reservation Get to API, but there is one in the non-admin API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants