-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[usage] Find running and stopped instances in ledger reconciler #12645
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
Conversation
|
||
client := v1.NewUsageServiceClient(conn) | ||
|
||
_, err = client.ReconcileUsageWithLedger(context.Background(), &v1.ReconcileUsageWithLedgerRequest{ |
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.
Doesn't assert the right instances were found because we don't yet update the records in any way. Once we start updating, the test here will be extended to do that.
84d3aad
to
c825b27
Compare
type Usage struct { | ||
ID uuid.UUID `gorm:"primary_key;column:id;type:char;size:36;" json:"id"` | ||
AttributionID AttributionID `gorm:"column:attributionId;type:varchar;size:255;" json:"attributionId"` | ||
Description string `gorm:"column:description;type:varchar;size:255;" json:"description"` | ||
CreditCents int64 `gorm:"column:creditCents;type:bigint;" json:"creditCents"` | ||
EffectiveTime VarcharTime `gorm:"column:effectiveTime;type:varchar;size:255;" json:"effectiveTime"` | ||
Kind string `gorm:"column:kind;type:char;size:10;" json:"kind"` | ||
Kind UsageKind `gorm:"column:kind;type:char;size:10;" json:"kind"` |
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.
Thanks!
logger.WithError(err).Errorf("Failed to find all draft usage records.") | ||
return nil, status.Errorf(codes.Internal, "failed to find all draft usage records") | ||
} | ||
logger.Infof("Found %d draft usage records.", len(usageDrafts)) |
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.
We'll also need to fetch the instances for the drafts and then combine the three slices of instances. But that's part of the next iteration I guess?
Description
Ledger Reconciler finds running and stopped instances. Reconciler will be extended in subsequent PRs.
Related Issue(s)
Fixes #
How to test
Unit tests
Release Notes
Documentation
Werft options: