Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anveshreddy18 committed Feb 9, 2024
1 parent 91f2ae1 commit 7c4f934
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/types_etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ type BackupSpec struct {
// All full snapshots beyond this limit will be garbage collected.
// +optional
MaxBackupsLimitBasedGC *int32 `json:"maxBackupsLimitBasedGC,omitempty"`
// FullsnapLeaseUpdateRetryInterval defines the interval for retrying to update the full snapshot lease
// FullSnapshotLeaseUpdateInterval defines the interval for retrying to update the full snapshot lease.
// +optional
FullsnapLeaseUpdateRetryInterval *metav1.Duration `json:"fullsnapLeaseUpdateRetryInterval,omitempty"`
FullSnapshotLeaseUpdateInterval *metav1.Duration `json:"fullSnapshotLeaseUpdateInterval,omitempty"`
// GarbageCollectionPeriod defines the period for garbage collecting old backups
// +optional
GarbageCollectionPeriod *metav1.Duration `json:"garbageCollectionPeriod,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ spec:
description: EtcdSnapshotTimeout defines the timeout duration
for etcd FullSnapshot operation
type: string
fullSnapshotLeaseUpdateInterval:
description: FullSnapshotLeaseUpdateInterval defines the interval
for retrying to update the full snapshot lease.
type: string
fullSnapshotSchedule:
description: FullSnapshotSchedule defines the cron standard schedule
for full snapshots.
type: string
fullsnapLeaseUpdateRetryInterval:
description: FullsnapLeaseUpdateRetryInterval defines the interval
for retrying to update the full snapshot lease
type: string
garbageCollectionPeriod:
description: GarbageCollectionPeriod defines the period for garbage
collecting old backups
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/10-crd-druid.gardener.cloud_etcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ spec:
description: EtcdSnapshotTimeout defines the timeout duration
for etcd FullSnapshot operation
type: string
fullSnapshotLeaseUpdateInterval:
description: FullSnapshotLeaseUpdateInterval defines the interval
for retrying to update the full snapshot lease.
type: string
fullSnapshotSchedule:
description: FullSnapshotSchedule defines the cron standard schedule
for full snapshots.
type: string
fullsnapLeaseUpdateRetryInterval:
description: FullsnapLeaseUpdateRetryInterval defines the interval
for retrying to update the full snapshot lease
type: string
garbageCollectionPeriod:
description: GarbageCollectionPeriod defines the period for garbage
collecting old backups
Expand Down
4 changes: 2 additions & 2 deletions pkg/component/etcd/statefulset/statefulset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,8 @@ func expectedBackupArgs(values *Values) Elements {
if values.DeltaSnapshotRetentionPeriod != nil {
elements[fmt.Sprintf("--delta-snapshot-retention-period=%s", values.DeltaSnapshotRetentionPeriod.Duration.String())] = Equal(fmt.Sprintf("--delta-snapshot-retention-period=%s", values.DeltaSnapshotRetentionPeriod.Duration.String()))
}
if values.FullsnapLeaseUpdateRetryInterval != nil {
elements[fmt.Sprintf("--fullsnap-lease-update-retry-interval=%s", values.FullsnapLeaseUpdateRetryInterval.Duration.String())] = Equal(fmt.Sprintf("--fullsnap-lease-update-retry-interval=%s", values.FullsnapLeaseUpdateRetryInterval.Duration.String()))
if values.FullSnapshotLeaseUpdateInterval != nil {
elements[fmt.Sprintf("--full-snapshot-lease-update-interval=%s", values.FullSnapshotLeaseUpdateInterval.Duration.String())] = Equal(fmt.Sprintf("--full-snapshot-lease-update-interval=%s", values.FullSnapshotLeaseUpdateInterval.Duration.String()))
}
return elements
}
6 changes: 3 additions & 3 deletions pkg/component/etcd/statefulset/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ type Values struct {
FailBelowRevision string
VolumeClaimTemplateName string

FullSnapLeaseName string
DeltaSnapLeaseName string
FullsnapLeaseUpdateRetryInterval *metav1.Duration
FullSnapLeaseName string
DeltaSnapLeaseName string
FullSnapshotLeaseUpdateInterval *metav1.Duration

StorageCapacity *resource.Quantity
StorageClass *string
Expand Down
10 changes: 5 additions & 5 deletions pkg/component/etcd/statefulset/values_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func GenerateValues(

VolumeClaimTemplateName: volumeClaimTemplateName,

FullSnapLeaseName: etcd.GetFullSnapshotLeaseName(),
DeltaSnapLeaseName: etcd.GetDeltaSnapshotLeaseName(),
FullsnapLeaseUpdateRetryInterval: etcd.Spec.Backup.FullsnapLeaseUpdateRetryInterval,
FullSnapLeaseName: etcd.GetFullSnapshotLeaseName(),
DeltaSnapLeaseName: etcd.GetDeltaSnapshotLeaseName(),
FullSnapshotLeaseUpdateInterval: etcd.Spec.Backup.FullSnapshotLeaseUpdateInterval,

StorageCapacity: etcd.Spec.StorageCapacity,
StorageClass: etcd.Spec.StorageClass,
Expand Down Expand Up @@ -219,8 +219,8 @@ func getBackupRestoreCommandArgs(val Values) ([]string, error) {
command = append(command, "--enable-snapshot-lease-renewal=true")
command = append(command, "--delta-snapshot-lease-name="+val.DeltaSnapLeaseName)
command = append(command, "--full-snapshot-lease-name="+val.FullSnapLeaseName)
if val.FullsnapLeaseUpdateRetryInterval != nil {
command = append(command, "--fullsnap-lease-update-retry-interval="+val.FullsnapLeaseUpdateRetryInterval.String())
if val.FullSnapshotLeaseUpdateInterval != nil {
command = append(command, "--full-snapshot-lease-update-interval="+val.FullSnapshotLeaseUpdateInterval.Duration.String())
}
}

Expand Down

0 comments on commit 7c4f934

Please sign in to comment.