-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(sdk): add qos limits capability to cloudian sdk #122
Conversation
"hlStorageQuotaCount": fmt.Sprintf("%d", qos.StorageQuotaCount), | ||
"wlStorageQuotaCount": fmt.Sprintf("%d", qos.StorageQuotaCountWarning), | ||
"hlRequestRate": fmt.Sprintf("%d", qos.RequestRatePrMin), | ||
"wlRequestRate": fmt.Sprintf("%d", qos.RequestRatePrMinWarning), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More readable to just use strconv.Itoa
for these?
) | ||
|
||
// Construct by e.g. 3 * TB | ||
type ByteSize uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this custom type in the SDK. To provide better usability, we could use https://pkg.go.dev/k8s.io/apimachinery/pkg/util/intstr#IntOrString in the provider API (Crossplane).
Or https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity
DataRatePrMinOutbound ByteSize | ||
// Warning limit outbound datarate in ByteSize per minute | ||
DataRatePrMinOutboundWarning ByteSize | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Warning limit storage quota | ||
StorageQuotaWarning ByteSize | ||
// Max storage quota in number of objects | ||
StorageQuotaCount uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To disable the limits, we need to support -1
StorageQuotaCount uint64 | |
StorageQuotaCount int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also make them pointer and transform nil to -1 and positive values to strings. Zero value would then be "unlimited", which is kinda nice
// Max outbound datarate in ByteSize per minute | ||
DataRatePrMinOutbound ByteSize | ||
// Warning limit outbound datarate in ByteSize per minute | ||
DataRatePrMinOutboundWarning ByteSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's long already, I think we can allow the e
in Per
DataRatePrMinOutboundWarning ByteSize | |
DataRatePerMinOutboundWarning ByteSize |
And maybe start with Outbound
to make it more readable sentence rather than a postfix?
DataRatePrMinOutboundWarning ByteSize | |
OutboundDataRatePerMinWarning ByteSize |
The starting point of what was finished in #124 |
Create QoS limits for a
User
Feature-completeness (GET and DELETE) is TODO