Skip to content

Commit ca95711

Browse files
chombiumctlong
authored andcommitted
CAPI call migration from v2 to v3
The CAPI v2 is deprecated and will be removed in the cf-deployment. Therefore an update is needed to use the newer CAPI v3.
1 parent d75b745 commit ca95711

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/command/meta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ func getSourceInfo(metaInfo map[string]*logcache_v1.MetaInfo, cli plugin.CliConn
442442
s = append(s, id)
443443
}
444444

445-
serviceInfo, err := getSourceInfoFromCAPI(s, "/v2/service_instances", cli)
445+
serviceInfo, err := getSourceInfoFromCAPI(s, "/v3/service_instances", cli)
446446
if err != nil {
447447
return nil, err
448448
}

internal/command/meta_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ var _ = Describe("Meta", func() {
579579

580580
Expect(cliConn.cliCommandArgs[1]).To(HaveLen(2))
581581
Expect(cliConn.cliCommandArgs[1][0]).To(Equal("curl"))
582-
Expect(cliConn.cliCommandArgs[1][1]).To(Equal("/v2/service_instances?guids=source-2"))
582+
Expect(cliConn.cliCommandArgs[1][1]).To(Equal("/v3/service_instances?guids=source-2"))
583583

584584
Expect(httpClient.requestCount()).To(Equal(1))
585585
Expect(strings.Split(tableWriter.String(), "\n")).To(Equal([]string{
@@ -1002,14 +1002,14 @@ var _ = Describe("Meta", func() {
10021002
Expect(cliConn.cliCommandArgs[2][0]).To(Equal("curl"))
10031003
uri, err = url.Parse(cliConn.cliCommandArgs[2][1])
10041004
Expect(err).ToNot(HaveOccurred())
1005-
Expect(uri.Path).To(Equal("/v2/service_instances"))
1005+
Expect(uri.Path).To(Equal("/v3/service_instances"))
10061006
Expect(strings.Split(uri.Query().Get("guids"), ",")).To(HaveLen(50))
10071007

10081008
Expect(cliConn.cliCommandArgs[3]).To(HaveLen(2))
10091009
Expect(cliConn.cliCommandArgs[3][0]).To(Equal("curl"))
10101010
uri, err = url.Parse(cliConn.cliCommandArgs[3][1])
10111011
Expect(err).ToNot(HaveOccurred())
1012-
Expect(uri.Path).To(Equal("/v2/service_instances"))
1012+
Expect(uri.Path).To(Equal("/v3/service_instances"))
10131013
Expect(strings.Split(uri.Query().Get("guids"), ",")).To(HaveLen(1))
10141014

10151015
// 51 entries, 2 blank lines, "Retrieving..." preamble and table

0 commit comments

Comments
 (0)