Skip to content

Commit 8da0aeb

Browse files
committed
use capi v3
1 parent 9d6cdd2 commit 8da0aeb

11 files changed

Lines changed: 70 additions & 72 deletions

File tree

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
.PHONY: build
1+
.PHONY: all build clean
22

33
build:
44
GOOS=linux GOARCH=386 go build -o bin/appcloud-cf-cli-plugin_linux32
55
GOOS=linux GOARCH=amd64 go build -o bin/appcloud-cf-cli-plugin_linux64
66
GOOS=darwin GOARCH=amd64 go build -o bin/appcloud-cf-cli-plugin_osx
7+
GOOS=darwin GOARCH=arm64 go build -o bin/appcloud-cf-cli-plugin_osx_arm64
78
GOOS=windows GOARCH=386 go build -o bin/appcloud-cf-cli-plugin_win32.exe
89
GOOS=windows GOARCH=amd64 go build -o bin/appcloud-cf-cli-plugin_win64.exe
10+
11+
clean:
12+
@rm bin/appcloud-cf-cli-plugin_* -f
13+
14+
all: clean build

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/swisscom/appcloud-cf-cli-plugin
22

3-
go 1.17
3+
go 1.25.6
44

55
require (
66
code.cloudfoundry.org/cli v7.1.0+incompatible
@@ -51,7 +51,7 @@ require (
5151
golang.org/x/text v0.3.7 // indirect
5252
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect
5353
google.golang.org/grpc v1.42.0 // indirect
54-
google.golang.org/protobuf v1.27.1 // indirect
54+
google.golang.org/protobuf v1.36.11 // indirect
5555
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
5656
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
5757
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ code.cloudfoundry.org/cli v7.1.0+incompatible h1:1Zn3I+epQBaBvnZAaTudCQQ0WdqcWtj
66
code.cloudfoundry.org/cli v7.1.0+incompatible/go.mod h1:e4d+EpbwevNhyTZKybrLlyTvpH+W22vMsmdmcTxs/Fo=
77
code.cloudfoundry.org/cli-plugin-repo v0.0.0-20211108170549-31c720a1b03c h1:46gGFfM5HFp6O0PhXqeHPwEmMeLdREqmi1y7wuhGxBg=
88
code.cloudfoundry.org/cli-plugin-repo v0.0.0-20211108170549-31c720a1b03c/go.mod h1:R1EiyOAr7lW0l/YkZNqItUNZ01Q/dYUfbTn4X4Z+82M=
9-
code.cloudfoundry.org/clock v1.0.0/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8=
109
code.cloudfoundry.org/go-log-cache v1.0.0 h1:e4FUVpwCDMBCFx0mSB+lGjYlVtSHT1JlK6/mxvUvTrU=
1110
code.cloudfoundry.org/go-log-cache v1.0.0/go.mod h1:YtelJ6iHvZGxPWCIUdO98UlczOawv5jD79hxO8Ln8Pg=
1211
code.cloudfoundry.org/go-loggregator v7.4.0+incompatible h1:KqZYloMQWM5Zg/BQKunOIA4OODh7djZbk48qqbowNFI=
@@ -17,7 +16,6 @@ code.cloudfoundry.org/jsonry v1.1.3 h1:pt7JvBaoZEObO9lppoAMjpscsE2uv7OKX9JiB3oNY
1716
code.cloudfoundry.org/jsonry v1.1.3/go.mod h1:IYd9/qJOvdVQk/SEkw3zPKpJp4GNAN+LYjU9eD3pspo=
1817
code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 h1:mrZQaZmuDIPhSp6b96b+CRKC2uH44ifa5cjDV2epKis=
1918
code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78/go.mod h1:tkZo8GtzBjySJ7USvxm4E36lNQw1D3xM6oKHGqdaAJ4=
20-
code.cloudfoundry.org/tlsconfig v0.0.0-20210615191307-5d92ef3894a7/go.mod h1:CKI5CV+3MlfcohVSuU3FxXubFyC52lYJGMLnZ2ltvks=
2119
code.cloudfoundry.org/tlsconfig v0.0.0-20211123175040-23cc9f05b6b3 h1:fv6SwdaX2uVcQKR8mXZy+6oYdthbKzkgmBzvoxSq/jY=
2220
code.cloudfoundry.org/tlsconfig v0.0.0-20211123175040-23cc9f05b6b3/go.mod h1:CKI5CV+3MlfcohVSuU3FxXubFyC52lYJGMLnZ2ltvks=
2321
code.cloudfoundry.org/ykk v0.0.0-20170424192843-e4df4ce2fd4d h1:M+zXqtXJqcsmpL76aU0tdl1ho23eYa4axYoM4gD62UA=
@@ -45,8 +43,6 @@ github.com/cloudfoundry/bosh-cli v6.4.1+incompatible h1:n5/+NIF9QxvGINOrjh6DmO+G
4543
github.com/cloudfoundry/bosh-cli v6.4.1+incompatible/go.mod h1:rzIB+e1sn7wQL/TJ54bl/FemPKRhXby5BIMS3tLuWFM=
4644
github.com/cloudfoundry/bosh-utils v0.0.291 h1:HbFKgS3U5NDaTumA04w6Wpois+MP7JbeOSLZdEIuKQE=
4745
github.com/cloudfoundry/bosh-utils v0.0.291/go.mod h1:m6veFiFsZIO4nJbnBjXi6QbBTRO1f4H2YicNHIA9HAM=
48-
github.com/cloudfoundry/go-socks5 v0.0.0-20180221174514-54f73bdb8a8e/go.mod h1:PXmcacyJB/pJjSxEl15IU6rEIKXrhZQRzsr0UTkgNNs=
49-
github.com/cloudfoundry/socks5-proxy v0.2.32/go.mod h1:jp3QYHP8zhRZlMsQAW2EJVBGaZMBSfVcmjgqLZoh4Pg=
5046
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
5147
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
5248
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
@@ -58,7 +54,6 @@ github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2
5854
github.com/cppforlife/go-patch v0.2.0 h1:Y14MnCQjDlbw7WXT4k+u6DPAA9XnygN4BfrSpI/19RU=
5955
github.com/cppforlife/go-patch v0.2.0/go.mod h1:67a7aIi94FHDZdoeGSJRRFDp66l9MhaAG1yGxpUoFD8=
6056
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
61-
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
6257
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
6358
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
6459
github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI=
@@ -114,19 +109,15 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
114109
github.com/jessevdk/go-flags v0.0.0-20170926144705-f88afde2fa19/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
115110
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
116111
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
117-
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
118112
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
119113
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
120-
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
121114
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
122115
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
123116
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
124117
github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=
125118
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
126119
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
127120
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
128-
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
129-
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
130121
github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=
131122
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
132123
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
@@ -146,22 +137,17 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI
146137
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
147138
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
148139
github.com/onsi/ginkgo v0.0.0-20171031171758-652e15c9a27e/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
149-
github.com/onsi/ginkgo v1.4.1-0.20170725030731-8382b23d18db/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
150140
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
151141
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
152142
github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg=
153-
github.com/onsi/ginkgo v1.16.1/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E=
154143
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
155144
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
156145
github.com/onsi/gomega v0.0.0-20171105031654-1eecca0ba8e6/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
157-
github.com/onsi/gomega v1.2.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
158146
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
159147
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
160148
github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48=
161-
github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg=
162149
github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c=
163150
github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
164-
github.com/pivotal-cf/paraphernalia v0.0.0-20180203224945-a64ae2051c20/go.mod h1:Y3IqE20LKprEpLkXb7gXinJf4vvDdQe/BS8E4kL/dgE=
165151
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
166152
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
167153
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -173,7 +159,6 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
173159
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
174160
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
175161
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
176-
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
177162
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
178163
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
179164
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
@@ -190,7 +175,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
190175
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
191176
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
192177
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
193-
github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0=
194178
github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE=
195179
github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc=
196180
github.com/unrolled/secure v0.0.0-20180416205222-a1cf62cc2159/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA=
@@ -229,7 +213,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
229213
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
230214
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
231215
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
232-
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
233216
golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4 h1:DZshvxDdVoeKIbudAdFEKi+f70l51luSy/7b76ibTY0=
234217
golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
235218
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -260,7 +243,6 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w
260243
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
261244
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
262245
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
263-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
264246
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
265247
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
266248
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1 h1:kwrAHlwJ0DUBZwQ238v+Uod/3eZ8B2K5rYsUHBQvzmI=
@@ -314,20 +296,18 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
314296
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
315297
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
316298
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
317-
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
318299
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
300+
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
301+
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
319302
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
320303
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
321304
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
322-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
323-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
324305
gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk=
325306
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
326307
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
327308
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
328309
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
329310
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
330-
gopkg.in/yaml.v2 v2.0.0-20170721122051-25c4ec802a7d/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
331311
gopkg.in/yaml.v2 v2.0.0-20171116090243-287cf08546ab/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
332312
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
333313
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

internal/appcloud/appcloud.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func (p *Plugin) GetMetadata() plugin.PluginMetadata {
2424
Build: 2,
2525
},
2626
Commands: []plugin.Command{
27-
2827
// Backups
2928
{
3029
Name: "backups",

internal/appcloud/domain.go

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,40 @@ import (
99
"github.com/pkg/errors"
1010
)
1111

12-
// Domain is a Cloud Foundry domain.
13-
type Domain struct {
14-
Metadata CFMetadata `json:"metadata"`
15-
Entity struct {
16-
Name string `json:"name"`
17-
} `json:"entity"`
12+
// V3Domain is a Cloud Foundry domain.
13+
type V3Domain struct {
14+
Name string `json:"name"`
1815
}
1916

20-
// DomainsResponse is a response from the server to a domains request.
21-
type DomainsResponse struct {
22-
Resources []Domain `json:"resources"`
23-
ServerResponsePagination
24-
ServerResponseError
17+
// V3DomainsResponse is a response from the server to a domains request.
18+
type V3DomainsResponse struct {
19+
Resources []V3Domain `json:"resources"`
20+
// ServerResponsePagination
21+
V3ServerResponseErrors
2522
}
2623

27-
// getSharedDomains retrieves all shared domains.
28-
func getSharedDomains(c plugin.CliConnection) ([]Domain, error) {
29-
url := "/v2/shared_domains"
24+
// getOrgDomains retrieves all org domains.
25+
func getOrgDomains(c plugin.CliConnection) ([]V3Domain, error) {
26+
org, err := c.GetCurrentOrg()
27+
if err != nil {
28+
return []V3Domain{}, err
29+
}
30+
31+
url := fmt.Sprintf("/v3/organizations/%s/domains", org.Guid)
3032
resLines, err := c.CliCommandWithoutTerminalOutput("curl", url)
3133
if err != nil {
32-
return []Domain{}, err
34+
return []V3Domain{}, err
3335
}
3436

3537
resString := strings.Join(resLines, "")
36-
var res DomainsResponse
38+
var res V3DomainsResponse
3739
err = json.Unmarshal([]byte(resString), &res)
3840
if err != nil {
39-
return []Domain{}, errors.Wrap(err, "Couldn't read JSON response from server")
41+
return []V3Domain{}, errors.Wrap(err, "Couldn't read JSON response from server")
4042
}
4143

42-
if res.ErrorCode != "" {
43-
return []Domain{}, fmt.Errorf("Error response from server: %s", res.Description)
44+
if len(res.Errors) > 0 {
45+
return []V3Domain{}, fmt.Errorf("Error response from server: %s", res.Errors[0].Detail)
4446
}
4547

4648
return res.Resources, nil

internal/appcloud/event.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ package appcloud
22

33
// EventsResponse is a response from the server to an events call.
44
type EventsResponse struct {
5-
Resources []Event `json:"resources"`
6-
ServerResponsePagination
7-
ServerResponseError
5+
Resources []V3AuditEvent `json:"resources"`
6+
// ServerResponsePagination
7+
V3ServerResponseErrors
88
}
99

10-
// Event is a service instance event.
11-
type Event struct {
12-
Metadata CFMetadata `json:"metadata"`
13-
Entity struct {
14-
Type string `json:"type"`
15-
ActorName string `json:"actor_name"`
16-
} `json:"entity"`
10+
// V3AuditEvent is a service instance event.
11+
type V3AuditEvent struct {
12+
CreatedAt string `json:"created_at"`
13+
Type string `json:"type"`
14+
Actor struct {
15+
Name string `json:"name"`
16+
} `json:"actor"`
1717
}

internal/appcloud/server_response.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ type ServerResponsePagination struct {
1414
PrevURL string `json:"prev_url"`
1515
NextURL string `json:"next_url"`
1616
}
17+
18+
type V3ServerResponseError struct {
19+
Code int `json:"code"`
20+
Title string `json:"title"`
21+
Detail string `json:"detail"`
22+
}
23+
24+
type V3ServerResponseErrors struct {
25+
Errors []V3ServerResponseError `json:"errors"`
26+
}

internal/appcloud/service_events.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"encoding/json"
55
"fmt"
66
"strings"
7-
"time"
87

98
"code.cloudfoundry.org/cli/cf/terminal"
109
"code.cloudfoundry.org/cli/plugin"
@@ -25,7 +24,7 @@ func (p *Plugin) ServiceEvents(c plugin.CliConnection, serviceInstanceName strin
2524
return errors.Wrap(err, "Service instance not found")
2625
}
2726

28-
url := fmt.Sprintf("/v2/events?q=actee:%s", s.Guid)
27+
url := fmt.Sprintf("/v3/audit_events?target_guids=%s", s.Guid)
2928
resLines, err := c.CliCommandWithoutTerminalOutput("curl", url)
3029
if err != nil {
3130
return errors.Wrap(err, "Couldn't retrieve events for service instance")
@@ -38,8 +37,8 @@ func (p *Plugin) ServiceEvents(c plugin.CliConnection, serviceInstanceName strin
3837
return errors.Wrap(err, "Couldn't read JSON response from server")
3938
}
4039

41-
if res.ErrorCode != "" {
42-
return fmt.Errorf("Error response from server: %s", res.Description)
40+
if len(res.Errors) > 0 {
41+
return fmt.Errorf("error response from server: %s", res.Errors[0].Detail)
4342
}
4443

4544
p.ui.Say(terminal.SuccessColor("OK\n"))
@@ -48,7 +47,7 @@ func (p *Plugin) ServiceEvents(c plugin.CliConnection, serviceInstanceName strin
4847
if len(events) > 0 {
4948
table := p.ui.Table([]string{"time", "event", "actor"})
5049
for _, e := range events {
51-
table.Add(e.Metadata.CreatedAt.Format(time.RFC3339), e.Entity.Type, e.Entity.ActorName)
50+
table.Add(e.CreatedAt, e.Type, e.Actor.Name)
5251
}
5352
err := table.Print()
5453
if err != nil {

internal/appcloud/ssl_enabled.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ func (p *Plugin) SSLEnabled(c plugin.CliConnection, domain string, hostname stri
1717
return errors.Wrap(err, "Couldn't get your username")
1818
}
1919

20-
fullDomain := domain
20+
fqdn := domain
2121
if hostname != "" {
22-
fullDomain = strings.Join([]string{hostname, domain}, ".")
22+
fqdn = strings.Join([]string{hostname, domain}, ".")
2323
}
2424

25-
p.ui.Say("Checking SSL status for %s as %s...", terminal.EntityNameColor(fullDomain), terminal.EntityNameColor(un))
25+
p.ui.Say("Checking SSL status for %s as %s...", terminal.EntityNameColor(fqdn), terminal.EntityNameColor(un))
2626

2727
s, err := c.GetCurrentSpace()
2828
if err != nil {
@@ -43,37 +43,37 @@ func (p *Plugin) SSLEnabled(c plugin.CliConnection, domain string, hostname stri
4343
}
4444

4545
if res.ErrorCode != "" {
46-
return fmt.Errorf("Error response from server: %s", res.Description)
46+
return fmt.Errorf("error response from server: %s", res.Description)
4747
}
4848

4949
p.ui.Say(terminal.SuccessColor("OK\n"))
5050

5151
var enabled bool
5252
for _, cert := range res.Resources {
53-
if cert.Entity.FullDomainName == fullDomain {
53+
if cert.Entity.FullDomainName == fqdn {
5454
enabled = true
5555
break
5656
}
5757
}
5858

5959
if !enabled {
60-
sharedDomains, err := getSharedDomains(c)
60+
sharedDomains, err := getOrgDomains(c)
6161
if err != nil {
62-
return errors.Wrap(err, "Couldn't get shared domains")
62+
return errors.Wrap(err, "Couldn't get org domains")
6363
}
6464

6565
for _, d := range sharedDomains {
66-
if d.Entity.Name == domain {
66+
if d.Name == domain {
6767
enabled = true
6868
break
6969
}
7070
}
7171
}
7272

7373
if enabled {
74-
p.ui.Say("SSL is enabled for '%s'", fullDomain)
74+
p.ui.Say("SSL is enabled for '%s'", fqdn)
7575
} else {
76-
p.ui.Say("SSL is not enabled for '%s'", fullDomain)
76+
p.ui.Say("SSL is not enabled for '%s'", fqdn)
7777
}
7878

7979
return nil

mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tools]
2+
go = "1.25.6"

0 commit comments

Comments
 (0)