Skip to content

Commit 94df738

Browse files
committed
Iter
1 parent 8ab8ae1 commit 94df738

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

pkg/apis/deployment/v1/license_spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (s LicenseSpec) GetTelemetry() bool {
9393

9494
// GetInventory returns the license Inventory
9595
func (s LicenseSpec) GetInventory() bool {
96-
return util.OptionalType(s.Telemetry, true)
96+
return util.OptionalType(s.Inventory, true)
9797
}
9898

9999
// Validate validates the LicenseSpec

pkg/apis/deployment/v2alpha1/license_spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (s LicenseSpec) GetTelemetry() bool {
9393

9494
// GetInventory returns the license Inventory
9595
func (s LicenseSpec) GetInventory() bool {
96-
return util.OptionalType(s.Telemetry, true)
96+
return util.OptionalType(s.Inventory, true)
9797
}
9898

9999
// Validate validates the LicenseSpec

pkg/crd/crds/database-deployment.schema.generated.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27514,6 +27514,9 @@ v2alpha1:
2751427514
expirationGracePeriod:
2751527515
description: ExpirationGracePeriod defines the expiration grace period for the license
2751627516
type: string
27517+
inventory:
27518+
description: Inventory defines if inventory is collected
27519+
type: boolean
2751727520
mode:
2751827521
description: Mode Defines the mode of license
2751927522
enum:

pkg/deployment/reconcile/action_license_generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (a *actionLicenseGenerate) Start(ctx context.Context) (bool, error) {
164164

165165
if expires.After(license.Expires()) {
166166
// License will expire before grace period, reduce to 90%
167-
expires = time.Now().Add(time.Duration(math.Round(float64(time.Since(license.Expires())) * api.LicenseExpirationGraceRatio)))
167+
expires = time.Now().Add(time.Duration(math.Round(float64(time.Until(license.Expires())) * api.LicenseExpirationGraceRatio)))
168168
}
169169

170170
if err := a.actionCtx.WithStatusUpdate(ctx, func(s *api.DeploymentStatus) bool {

0 commit comments

Comments
 (0)