From 6b054c99b6662cbfe637f0412178885fdb4512e7 Mon Sep 17 00:00:00 2001 From: harshitha-yb <87016063+harshitha-yb@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:26:33 +0530 Subject: [PATCH] Remove backup interval seconds from PITR command outputs (#245) --- cmd/pitr_config_test.go | 14 +++++++------- internal/formatter/pitr_configs.go | 8 +------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/cmd/pitr_config_test.go b/cmd/pitr_config_test.go index 3b4b55a..148dec1 100644 --- a/cmd/pitr_config_test.go +++ b/cmd/pitr_config_test.go @@ -64,9 +64,9 @@ var _ = Describe("PITR Configs Test", func() { session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter) Expect(err).NotTo(HaveOccurred()) session.Wait(2) - Expect(session.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days Backup Interval in Seconds State Earliest Recovery Time in Millis Latest Recovery Time in Millis -test_ycql_db YCQL 6 86400 ACTIVE 123456 123456789 -test_ysql_db YSQL 5 86400 QUEUED 654321 987654321`)) + Expect(session.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days State Earliest Recovery Time in Millis Latest Recovery Time in Millis +test_ycql_db YCQL 6 ACTIVE 123456 123456789 +test_ysql_db YSQL 5 QUEUED 654321 987654321`)) session.Kill() }) @@ -209,8 +209,8 @@ test_ysql_db YSQL 5 86400 ysqlSession, ysqlErr := gexec.Start(ysqlCmd, GinkgoWriter, GinkgoWriter) Expect(ysqlErr).NotTo(HaveOccurred()) ysqlSession.Wait(2) - Expect(ysqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days Backup Interval in Seconds State Earliest Recovery Time in Millis Latest Recovery Time in Millis -test_ysql_db YSQL 5 86400 QUEUED 654321 987654321`)) + Expect(ysqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days State Earliest Recovery Time in Millis Latest Recovery Time in Millis +test_ysql_db YSQL 5 QUEUED 654321 987654321`)) ysqlSession.Kill() }) @@ -236,8 +236,8 @@ test_ysql_db YSQL 5 86400 ycqlSession, ycqlErr := gexec.Start(ycqlCmd, GinkgoWriter, GinkgoWriter) Expect(ycqlErr).NotTo(HaveOccurred()) ycqlSession.Wait(2) - Expect(ycqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days Backup Interval in Seconds State Earliest Recovery Time in Millis Latest Recovery Time in Millis -test_ycql_db YCQL 6 86400 ACTIVE 123456 123456789`)) + Expect(ycqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days State Earliest Recovery Time in Millis Latest Recovery Time in Millis +test_ycql_db YCQL 6 ACTIVE 123456 123456789`)) ycqlSession.Kill() }) diff --git a/internal/formatter/pitr_configs.go b/internal/formatter/pitr_configs.go index 1687718..39833fc 100644 --- a/internal/formatter/pitr_configs.go +++ b/internal/formatter/pitr_configs.go @@ -25,9 +25,8 @@ import ( ) const ( - defaultPitrConfigListing = "table {{.Namespace}}\t{{.TableType}}\t{{.RetentionPeriodInDays}}\t{{.BackupIntervalInSeconds}}\t{{.State}}\t{{.EarliestRecoveryTimeMillis}}\t{{.LatestRecoveryTimeMillis}}" + defaultPitrConfigListing = "table {{.Namespace}}\t{{.TableType}}\t{{.RetentionPeriodInDays}}\t{{.State}}\t{{.EarliestRecoveryTimeMillis}}\t{{.LatestRecoveryTimeMillis}}" retentionPeriodInDaysHeader = "Retention Period in Days" - backupIntervalInSecondsHeader = "Backup Interval in Seconds" earliestRecoveryTimeMillisHeader = "Earliest Recovery Time in Millis" latestRecoveryTimeMillisHeader = "Latest Recovery Time in Millis" ) @@ -85,7 +84,6 @@ func NewPitrConfigContext() *PitrConfigContext { "Namespace": namespaceHeader, "TableType": tableTypeHeader, "RetentionPeriodInDays": retentionPeriodInDaysHeader, - "BackupIntervalInSeconds": backupIntervalInSecondsHeader, "State": stateHeader, "EarliestRecoveryTimeMillis": earliestRecoveryTimeMillisHeader, "LatestRecoveryTimeMillis": latestRecoveryTimeMillisHeader, @@ -105,10 +103,6 @@ func (d *PitrConfigContext) RetentionPeriodInDays() int32 { return d.d.Spec.RetentionPeriod } -func (d *PitrConfigContext) BackupIntervalInSeconds() int32 { - return d.d.Info.GetBackupInterval() -} - func (d *PitrConfigContext) State() string { return string(d.d.Info.GetState()) }