Skip to content

Commit

Permalink
Merge pull request #202 from sapcc/renovate/github.comsapcc
Browse files Browse the repository at this point in the history
Renovate: Update github.com/sapcc
  • Loading branch information
majewsky authored May 17, 2024
2 parents e59efe5 + 98c40f1 commit 6e80c3c
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 331 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/sapcc/limesctl/compare/v3.3.2...HEAD)

### Removed

- Removed everything related to Bursting

## 3.3.2 - 2024-01-03

### Changed
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ require (
github.com/gophercloud/gophercloud v1.11.0
github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56
github.com/olekukonko/tablewriter v0.0.5
github.com/sapcc/go-api-declarations v1.11.0
github.com/sapcc/go-bits v0.0.0-20240429130232-fdc0102c61a4
github.com/sapcc/gophercloud-sapcc v0.0.0-20240429130228-bc9d8c12dd20
github.com/sapcc/go-api-declarations v1.11.2
github.com/sapcc/go-bits v0.0.0-20240516084938-1c041b7a84ce
github.com/sapcc/gophercloud-sapcc v0.0.0-20240510132707-01d47d03e5d9
github.com/spf13/cobra v1.8.0
)

Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sapcc/go-api-declarations v1.11.0 h1:k/U/Hdv2UbBdAyxfnWUyhs8hl74fCrNn8aIWj+k42u4=
github.com/sapcc/go-api-declarations v1.11.0/go.mod h1:83R3hTANhuRXt/pXDby37IJetw8l7DG41s33Tp9NXxI=
github.com/sapcc/go-bits v0.0.0-20240429130232-fdc0102c61a4 h1:h7xYkyFcGmqPcgNPL3LLrOTANeuZwKYq5WriV0e2Dvg=
github.com/sapcc/go-bits v0.0.0-20240429130232-fdc0102c61a4/go.mod h1:4gsmI0EEDRETgw6+TWm/l627KZMA9/MAxNxMsY1S7bs=
github.com/sapcc/gophercloud-sapcc v0.0.0-20240429130228-bc9d8c12dd20 h1:wmqC1VU1BK2lxM4dyBJ/70m4ntVhNWs6c+oNalSSNaQ=
github.com/sapcc/gophercloud-sapcc v0.0.0-20240429130228-bc9d8c12dd20/go.mod h1:KWKJEgcBm/70+VAra07oLZm1ixEUJ1MTsSf2DGAns5g=
github.com/sapcc/go-api-declarations v1.11.2 h1:CFVxgWqrs4WBJhbA0nJNQ/0mBpAxmNFuUZtuEITltFU=
github.com/sapcc/go-api-declarations v1.11.2/go.mod h1:83R3hTANhuRXt/pXDby37IJetw8l7DG41s33Tp9NXxI=
github.com/sapcc/go-bits v0.0.0-20240516084938-1c041b7a84ce h1:cMrOXCHbUuxCJX3vkaXvMcmUKkQQ65BPwtCj7MMebCA=
github.com/sapcc/go-bits v0.0.0-20240516084938-1c041b7a84ce/go.mod h1:dGC65DP50Yuu0P+DsrtXIZU+P0HluN7HXnAA3xNCVBk=
github.com/sapcc/gophercloud-sapcc v0.0.0-20240510132707-01d47d03e5d9 h1:MeUExAMelWyNKK2ODNqsKLlZeJVKAbTgBiQIdS3e9+8=
github.com/sapcc/gophercloud-sapcc v0.0.0-20240510132707-01d47d03e5d9/go.mod h1:UIHKHyFEKUoGAJIA08PBpGyzOykFHYKTl/+j6jUYhko=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
Expand Down
6 changes: 3 additions & 3 deletions internal/core/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type ClusterReport struct {

var csvHeaderClusterLong = []string{
"cluster id", "area", "service", "category", "resource", "capacity",
"domains quota", "usage", "physical usage", "burst usage", "unit", "scraped at (UTC)",
"domains quota", "usage", "physical usage", "unit", "scraped at (UTC)",
}

var csvHeaderClusterDefault = []string{
Expand Down Expand Up @@ -75,13 +75,13 @@ func (c ClusterReport) render(opts *OutputOpts) CSVRecords {

valToStr, unit := getValToStrFunc(opts.Humanize, cSrvRes.Unit, []uint64{
zeroIfNil(capacity), zeroIfNil(physU), zeroIfNil(domsQ),
cSrvRes.Usage, cSrvRes.BurstUsage,
cSrvRes.Usage,
})

if opts.CSVRecFmt == CSVRecordFormatLong {
r = append(r, c.ID, cSrv.Area, string(cSrv.Type), cSrvRes.Category, string(cSrvRes.Name), emptyStrIfNil(capacity, valToStr),
emptyStrIfNil(domsQ, valToStr), valToStr(cSrvRes.Usage), emptyStrIfNil(physU, valToStr),
valToStr(cSrvRes.BurstUsage), string(unit), timestampToString(cSrv.MinScrapedAt),
string(unit), timestampToString(cSrv.MinScrapedAt),
)
} else {
r = append(r, c.ID, string(cSrv.Type), string(cSrvRes.Name), emptyStrIfNil(capacity, valToStr),
Expand Down
6 changes: 3 additions & 3 deletions internal/core/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var csvHeaderDomainDefault = []string{"domain id", "service", "resource", "quota

var csvHeaderDomainLong = []string{
"domain id", "domain name", "area", "service", "category", "resource",
"quota", "projects quota", "usage", "physical usage", "burst usage", "unit", "scraped at (UTC)",
"quota", "projects quota", "usage", "physical usage", "unit", "scraped at (UTC)",
}

const domainName = "domain name"
Expand Down Expand Up @@ -90,13 +90,13 @@ func (d DomainReport) render(opts *OutputOpts) CSVRecords {

valToStr, unit := getValToStrFunc(opts.Humanize, dSrvRes.Unit, []uint64{
zeroIfNil(physU), zeroIfNil(domQ), zeroIfNil(projectsQ),
dSrvRes.Usage, dSrvRes.BurstUsage,
dSrvRes.Usage,
})

if opts.CSVRecFmt == CSVRecordFormatLong {
r = append(r, d.UUID, d.Name, dSrv.Area, string(dSrv.Type), dSrvRes.Category, string(dSrvRes.Name),
emptyStrIfNil(domQ, valToStr), emptyStrIfNil(projectsQ, valToStr), valToStr(dSrvRes.Usage),
emptyStrIfNil(physU, valToStr), valToStr(dSrvRes.BurstUsage), string(unit), timestampToString(dSrv.MinScrapedAt),
emptyStrIfNil(physU, valToStr), string(unit), timestampToString(dSrv.MinScrapedAt),
)
} else {
nameOrID := d.UUID
Expand Down
6 changes: 3 additions & 3 deletions internal/core/fixtures/domain-list-filtered.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
domain id;domain name;area;service;category;resource;quota;projects quota;usage;physical usage;burst usage;unit;scraped at (UTC)
uuid-for-france;france;shared;shared;;things;0;10;2;;0;;1970-01-01T00:01:06Z
uuid-for-germany;germany;shared;shared;;things;30;20;4;;0;;1970-01-01T00:00:22Z
domain id;domain name;area;service;category;resource;quota;projects quota;usage;physical usage;unit;scraped at (UTC)
uuid-for-france;france;shared;shared;;things;0;10;2;;;1970-01-01T00:01:06Z
uuid-for-germany;germany;shared;shared;;things;30;20;4;;;1970-01-01T00:00:22Z
6 changes: 3 additions & 3 deletions internal/core/fixtures/project-list-filtered.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
domain id;domain name;project id;project name;area;service;category;resource;quota;burst quota;usage;physical usage;burst usage;unit;scraped at (UTC)
uuid-for-germany;germany;uuid-for-berlin;berlin;shared;shared;;things;10;;2;;0;;1970-01-01T00:00:22Z
uuid-for-germany;germany;uuid-for-dresden;dresden;shared;shared;;things;10;;2;;0;;1970-01-01T00:00:44Z
domain id;domain name;project id;project name;area;service;category;resource;quota;usage;physical usage;unit;scraped at (UTC)
uuid-for-germany;germany;uuid-for-berlin;berlin;shared;shared;;things;10;2;;;1970-01-01T00:00:22Z
uuid-for-germany;germany;uuid-for-dresden;dresden;shared;shared;;things;10;2;;;1970-01-01T00:00:44Z
22 changes: 4 additions & 18 deletions internal/core/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var csvHeaderProjectDefault = []string{"domain id", "project id", "service", "re

var csvHeaderProjectLong = []string{
"domain id", "domain name", "project id", "project name", "area", "service",
"category", "resource", "quota", "burst quota", "usage", "physical usage", "burst usage", "unit", "scraped at (UTC)",
"category", "resource", "quota", "usage", "physical usage", "unit", "scraped at (UTC)",
}

// GetHeaderRow implements the LimesReportRenderer interface.
Expand Down Expand Up @@ -99,28 +99,14 @@ func (p ProjectResourcesReport) render(opts *OutputOpts) CSVRecords {
quota := pSrvRes.Quota
usage := pSrvRes.Usage

// We use a *uint64 for burstQuota instead of an uint64 for
// consistency with Limes' API, i.e. if quota has a null value
// then burstQuota should also be null instead of zero.
var burstQuota *uint64
var burstUsage uint64
if quota != nil && p.Bursting != nil && p.Bursting.Enabled {
q := *quota
bq := p.Bursting.Multiplier.ApplyTo(q, pSrvRes.QuotaDistributionModel)
burstQuota = &bq
if usage > q {
burstUsage = usage - q
}
}

valToStr, unit := getValToStrFunc(opts.Humanize, pSrvRes.Unit, []uint64{
zeroIfNil(burstQuota), burstUsage, zeroIfNil(physU), zeroIfNil(quota), usage,
zeroIfNil(physU), zeroIfNil(quota), usage,
})

if opts.CSVRecFmt == CSVRecordFormatLong {
r = append(r, p.DomainID, p.DomainName, p.UUID, p.Name, pSrv.Area, string(pSrv.Type), pSrvRes.Category,
string(pSrvRes.Name), emptyStrIfNil(quota, valToStr), emptyStrIfNil(burstQuota, valToStr), valToStr(usage),
emptyStrIfNil(physU, valToStr), valToStr(burstUsage), string(unit), timestampToString(pSrv.ScrapedAt),
string(pSrvRes.Name), emptyStrIfNil(quota, valToStr), valToStr(usage),
emptyStrIfNil(physU, valToStr), string(unit), timestampToString(pSrv.ScrapedAt),
)
} else {
projectNameOrID := p.UUID
Expand Down
118 changes: 0 additions & 118 deletions vendor/github.com/sapcc/go-api-declarations/limes/resources/input.go

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6e80c3c

Please sign in to comment.