Skip to content

Commit 9f7b7b7

Browse files
CLOUDGA-24211 Remove ID from integration cmd output (#278)
1 parent 15d5559 commit 9f7b7b7

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

cmd/integration_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ var _ = Describe("Integration", func() {
6868
Expect(err).NotTo(HaveOccurred())
6969
session.Wait(2)
7070
Expect(session.Out).Should(gbytes.Say(`The Integration test has been created
71-
ID Name Type Site ApiKey
72-
9e3fabbc-849c-4a77-bdb2-9422e712e7dc ff DATADOG test c4XXXXXXXXXXXXXXXXXXXXXXXXXXXX3d`))
71+
Name Type Site ApiKey
72+
ff DATADOG test c4XXXXXXXXXXXXXXXXXXXXXXXXXXXX3d`))
7373
session.Kill()
7474
})
7575
It("should return required field name and type when not set", func() {
@@ -107,8 +107,8 @@ ID Name Type Site ApiKey
107107
Expect(err).NotTo(HaveOccurred())
108108
session.Wait(2)
109109
Expect(session.Out).Should(gbytes.Say(`The Integration test has been created
110-
ID Name Type Endpoint
111-
9e3fabbc-849c-4a77-bdb2-9422e712e7dc test PROMETHEUS http://prometheus.yourcompany.com/api/v1/otlp`))
110+
Name Type Endpoint
111+
test PROMETHEUS http://prometheus.yourcompany.com/api/v1/otlp`))
112112
session.Kill()
113113
})
114114
It("should return error when arg prometheus-spec not set", func() {
@@ -146,8 +146,8 @@ ID Name Type Endpoint
146146
Expect(err).NotTo(HaveOccurred())
147147
session.Wait(2)
148148
Expect(session.Out).Should(gbytes.Say(`The Integration test has been created
149-
ID Name Type Endpoint
150-
9e3fabbc-849c-4a77-bdb2-9422e712e7dc test VICTORIAMETRICS http://victoriametrics.yourcompany.com`))
149+
Name Type Endpoint
150+
test VICTORIAMETRICS http://victoriametrics.yourcompany.com`))
151151
session.Kill()
152152
})
153153
It("should return error when arg victoriametrics-spec not set", func() {
@@ -185,8 +185,8 @@ ID Name Type Endpoint
185185
Expect(err).NotTo(HaveOccurred())
186186
session.Wait(2)
187187
Expect(session.Out).Should(gbytes.Say(`The Integration test has been created
188-
ID Name Type Zone Access Token Policy InstanceId OrgSlug
189-
92ceaa26-bac7-4842-9b3c-831a18a4f813 grafana GRAFANA test-zone glXXXXXXXXXX...XXXXXXXXXXXXXXX== 1234456 ybmclitest`))
188+
Name Type Zone Access Token Policy InstanceId OrgSlug
189+
grafana GRAFANA test-zone glXXXXXXXXXX...XXXXXXXXXXXXXXX== 1234456 ybmclitest`))
190190
session.Kill()
191191
})
192192
It("should return required field", func() {
@@ -214,8 +214,8 @@ ID Name Type Zone Access To
214214
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
215215
Expect(err).NotTo(HaveOccurred())
216216
session.Wait(2)
217-
Expect(session.Out).Should(gbytes.Say(`ID Name Type Access Key Access ID InstallationToken
218-
4021aa44-b22d-4bb6-a7d3-0a1099a4f206 gwenn-sumo SUMOLOGIC FqXXXXXXXXXX...XXXXXXXXXXXXXXX9p suXXXXXXXXXXJ9 U1XXXXXXXXXX...XXXXXXXXXXXXXXX==`))
217+
Expect(session.Out).Should(gbytes.Say(`Name Type Access Key Access ID InstallationToken
218+
gwenn-sumo SUMOLOGIC FqXXXXXXXXXX...XXXXXXXXXXXXXXX9p suXXXXXXXXXXJ9 U1XXXXXXXXXX...XXXXXXXXXXXXXXX==`))
219219
session.Kill()
220220
})
221221
It("should return required field", func() {
@@ -244,8 +244,8 @@ ID Name Type Zone Access To
244244
Expect(err).NotTo(HaveOccurred())
245245
session.Wait(2)
246246
Expect(session.Out).Should(gbytes.Say(`The Integration testgcp has been created
247-
ID Name Type
248-
7913c052-fcd0-4b37-8a90-b0e47320190b ddd GOOGLECLOUD`))
247+
Name Type
248+
ddd GOOGLECLOUD`))
249249
session.Kill()
250250
})
251251
It("should return filepath error", func() {
@@ -300,10 +300,10 @@ ID Name Type
300300
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
301301
Expect(err).NotTo(HaveOccurred())
302302
session.Wait(2)
303-
Expect(session.Out).Should(gbytes.Say(`ID Name Type
304-
129f7c97-81ae-47c7-8f9e-40ab4390093f ff DATADOG
305-
92ceaa26-bac7-4842-9b3c-831a18a4f813 grafana GRAFANA
306-
4021aa44-b22d-4bb6-a7d3-0a1099a4f206 gwenn-sumo SUMOLOGIC`))
303+
Expect(session.Out).Should(gbytes.Say(`Name Type
304+
ff DATADOG
305+
grafana GRAFANA
306+
gwenn-sumo SUMOLOGIC`))
307307
session.Kill()
308308
})
309309

internal/formatter/telemetry_provider.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ import (
2323
ybmclient "github.com/yugabyte/yugabytedb-managed-go-client-internal"
2424
)
2525

26-
const defaultIntegrationListing = "table {{.ID}}\t{{.Name}}\t{{.Type}}"
27-
const defaultIntegrationDataDog = "table {{.ID}}\t{{.Name}}\t{{.Type}}\t{{.Site}}\t{{.ApiKey}}"
28-
const defaultIntegrationPrometheus = "table {{.ID}}\t{{.Name}}\t{{.Type}}\t{{.PrometheusEndpoint}}"
29-
const defaultIntegrationVictoriaMetrics = "table {{.ID}}\t{{.Name}}\t{{.Type}}\t{{.VictoriaMetricsEndpoint}}"
30-
const defaultIntegrationGrafana = "table {{.ID}}\t{{.Name}}\t{{.Type}}\t{{.Zone}}\t{{.AccessTokenPolicy}}\t{{.InstanceId}}\t{{.OrgSlug}}"
31-
const defaultIntegrationSumologic = "table {{.ID}}\t{{.Name}}\t{{.Type}}\t{{.AccessKey}}\t{{.AccessID}}\t{{.InstallationToken}}"
26+
const defaultIntegrationListing = "table {{.Name}}\t{{.Type}}"
27+
const defaultIntegrationDataDog = "table {{.Name}}\t{{.Type}}\t{{.Site}}\t{{.ApiKey}}"
28+
const defaultIntegrationPrometheus = "table {{.Name}}\t{{.Type}}\t{{.PrometheusEndpoint}}"
29+
const defaultIntegrationVictoriaMetrics = "table {{.Name}}\t{{.Type}}\t{{.VictoriaMetricsEndpoint}}"
30+
const defaultIntegrationGrafana = "table {{.Name}}\t{{.Type}}\t{{.Zone}}\t{{.AccessTokenPolicy}}\t{{.InstanceId}}\t{{.OrgSlug}}"
31+
const defaultIntegrationSumologic = "table {{.Name}}\t{{.Type}}\t{{.AccessKey}}\t{{.AccessID}}\t{{.InstallationToken}}"
3232

3333
type IntegrationContext struct {
3434
HeaderContext
@@ -96,10 +96,6 @@ func IntegrationWrite(ctx Context, Integrations []ybmclient.TelemetryProviderDat
9696
return ctx.Write(NewIntegrationContext(), render)
9797
}
9898

99-
func (tp *IntegrationContext) ID() string {
100-
return tp.tp.Info.Id
101-
}
102-
10399
func (tp *IntegrationContext) Name() string {
104100
return tp.tp.Spec.Name
105101
}

0 commit comments

Comments
 (0)