Skip to content

Commit c4e5375

Browse files
bsoroushianhsinn0
authored andcommitted
Upgraded gopkg.in/yaml.v2 to gopkg.in/yaml.v3
- The indentation for yaml.v3 is different from the previous version
1 parent cded072 commit c4e5375

19 files changed

+154
-776
lines changed

commands/bulk_regenerate_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ var _ = Describe("Bulk-regenerate", func() {
4545

4646
Eventually(session).Should(Exit(0))
4747
Eventually(string(session.Out.Contents())).Should(Equal(`regenerated_credentials:
48-
- cert1
49-
- cert2
50-
- cert3
48+
- cert1
49+
- cert2
50+
- cert3
5151
5252
`))
5353
})

commands/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"os"
66

77
"code.cloudfoundry.org/credhub-cli/errors"
8-
"gopkg.in/yaml.v2"
8+
"gopkg.in/yaml.v3"
99
)
1010

1111
type DeleteCommand struct {

commands/delete_permission_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ var _ = Describe("Delete Permission", func() {
8181
Eventually(session).Should(Exit(0))
8282
Eventually(session.Out).Should(Say("actor: some-actor"))
8383
Eventually(session.Out).Should(Say(`operations:
84-
- read
85-
- write`))
84+
- read
85+
- write`))
8686
Eventually(session.Out).Should(Say("path: .*'/some-path'.*"))
8787
Eventually(session.Out).Should(Say("uuid: " + uuid))
8888
})

commands/export_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ var _ = Describe("Export", func() {
8181
}`
8282

8383
responseTable := `credentials:
84-
- name: /path/to/cred
85-
type: value
86-
value: foo
87-
metadata:
88-
some: thing
89-
- name: /path/to/cred
90-
type: value
91-
value: foo
92-
metadata:
93-
some: thing`
84+
- name: /path/to/cred
85+
type: value
86+
value: foo
87+
metadata:
88+
some: thing
89+
- name: /path/to/cred
90+
type: value
91+
value: foo
92+
metadata:
93+
some: thing`
9494

9595
server.AppendHandlers(
9696
CombineHandlers(
@@ -199,18 +199,18 @@ var _ = Describe("Export", func() {
199199
}]}`
200200

201201
responseTable := `credentials:
202-
- name: /path/to/cert
203-
type: certificate
204-
value:
205-
ca_name: /path/to/cert_ca
206-
certificate: some_cert
207-
private_key: private_key
208-
- name: /path/to/cert_ca
209-
type: certificate
210-
value:
211-
ca: some_ca
212-
certificate: some_cert
213-
private_key: private_key`
202+
- name: /path/to/cert
203+
type: certificate
204+
value:
205+
ca_name: /path/to/cert_ca
206+
certificate: some_cert
207+
private_key: private_key
208+
- name: /path/to/cert_ca
209+
type: certificate
210+
value:
211+
ca: some_ca
212+
certificate: some_cert
213+
private_key: private_key`
214214

215215
server.AppendHandlers(
216216
CombineHandlers(

commands/find_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ var _ = Describe("Find", func() {
5959
}`
6060
// language=YAML
6161
responseTable :=
62-
`credentials:\n- name: dan.password\n version_created_at: "2016-09-06T23:26:58Z"\n- name: deploy1/dan/id.key\n version_created_at: "2016-09-06T23:26:58Z"`
62+
`credentials:
63+
- name: dan.password
64+
version_created_at: "2016-09-06T23:26:58Z"
65+
- name: deploy1/dan/id.key
66+
version_created_at: "2016-09-06T23:26:58Z"`
6367

6468
server.RouteToHandler("GET", "/api/v1/data",
6569
CombineHandlers(
@@ -124,7 +128,13 @@ var _ = Describe("Find", func() {
124128
}`
125129
// language=YAML
126130
responseTable :=
127-
`credentials:\n- name: deploy123/dan.password\n version_created_at: "2016-09-06T23:26:58Z"\n- name: deploy123/dan.key\n version_created_at: "2016-09-06T23:26:58Z"\n- name: deploy123/dan/id.key\n version_created_at: "2016-09-06T23:26:58Z"`
131+
`credentials:
132+
- name: deploy123/dan.password
133+
version_created_at: "2016-09-06T23:26:58Z"
134+
- name: deploy123/dan.key
135+
version_created_at: "2016-09-06T23:26:58Z"
136+
- name: deploy123/dan/id.key
137+
version_created_at: "2016-09-06T23:26:58Z"`
128138

129139
server.RouteToHandler("GET", "/api/v1/data",
130140
CombineHandlers(

commands/generate_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,10 @@ var _ = Describe("Generate", func() {
467467
Eventually(session).Should(Exit(0))
468468
metadataOutput := `
469469
metadata:
470-
array:
471-
- metadata
472-
some:
473-
example: metadata`
470+
array:
471+
- metadata
472+
some:
473+
example: metadata`
474474
Eventually(string(session.Out.Contents())).Should(ContainSubstring(metadataOutput))
475475
})
476476

commands/get_permission_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ var _ = Describe("Get Permission", func() {
9191
Eventually(session).Should(Exit(0))
9292
Eventually(session.Out).Should(Say("actor: some-actor"))
9393
Eventually(session.Out).Should(Say(`operations:
94-
- read
95-
- write`))
94+
- read
95+
- write`))
9696
Eventually(session.Out).Should(Say("path: .*'/some-path'.*"))
9797
Eventually(session.Out).Should(Say("uuid: " + uuid))
9898
})

commands/get_test.go

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ var _ = Describe("Get", func() {
131131
Eventually(session.Out).Should(Say("type: value"))
132132
Eventually(session.Out).Should(Say("value: potatoes"))
133133
Eventually(session.Out).Should(Say(`metadata:
134-
some: metadata`))
134+
some: metadata`))
135135
})
136136

137137
Context("with --quiet flag", func() {
@@ -169,8 +169,8 @@ var _ = Describe("Get", func() {
169169
Eventually(session).Should(Exit(0))
170170
contents := string(bytes.TrimSpace(session.Out.Contents()))
171171
Eventually(contents).Should(Equal(`versions:
172-
- potatoes
173-
- tomatoes`))
172+
- potatoes
173+
- tomatoes`))
174174
})
175175
})
176176

@@ -231,7 +231,7 @@ tomatoes`))
231231
Eventually(session.Out).Should(Say("type: password"))
232232
Eventually(session.Out).Should(Say("value: potatoes"))
233233
Eventually(session.Out).Should(Say(`metadata:
234-
some: metadata`))
234+
some: metadata`))
235235
})
236236

237237
It("gets a secret by ID", func() {
@@ -296,16 +296,16 @@ tomatoes`))
296296

297297
Eventually(session).Should(Exit(0))
298298
Eventually(session.Out).Should(Say(`versions:
299-
- id: ` + uuid + `
300-
name: my-password
301-
type: password
302-
value: old-password
303-
version_created_at: "` + timestamp + `"
304-
- id: ` + uuid + `
305-
name: my-password
306-
type: password
307-
value: new-password
308-
version_created_at: "` + timestamp + `"
299+
- id: ` + uuid + `
300+
name: my-password
301+
type: password
302+
value: old-password
303+
version_created_at: "` + timestamp + `"
304+
- id: ` + uuid + `
305+
name: my-password
306+
type: password
307+
value: new-password
308+
version_created_at: "` + timestamp + `"
309309
`))
310310

311311
})
@@ -327,8 +327,8 @@ tomatoes`))
327327
Eventually(session).Should(Exit(0))
328328
contents := string(bytes.TrimSpace(session.Out.Contents()))
329329
Eventually(contents).Should(Equal(`versions:
330-
- new-password
331-
- old-password`))
330+
- new-password
331+
- old-password`))
332332
})
333333
})
334334

@@ -351,12 +351,11 @@ tomatoes`))
351351
Eventually(session.Out).Should(Say("name: json-secret"))
352352
Eventually(session.Out).Should(Say("type: json"))
353353
Eventually(session.Out).Should(Say(`value:
354-
an:
355-
- array
356-
foo: bar
357-
nested:
358-
a: 1`))
359-
354+
an:
355+
- array
356+
foo: bar
357+
nested:
358+
a: 1`))
360359
})
361360

362361
It("gets a json secret with metadata", func() {
@@ -375,13 +374,13 @@ tomatoes`))
375374
Eventually(session.Out).Should(Say("name: json-secret"))
376375
Eventually(session.Out).Should(Say("type: json"))
377376
Eventually(session.Out).Should(Say(`value:
378-
an:
379-
- array
380-
foo: bar
381-
nested:
382-
a: 1`))
377+
an:
378+
- array
379+
foo: bar
380+
nested:
381+
a: 1`))
383382
Eventually(session.Out).Should(Say(`metadata:
384-
some: metadata`))
383+
some: metadata`))
385384
})
386385

387386
Context("with --output-json flag", func() {
@@ -456,10 +455,10 @@ tomatoes`))
456455
Eventually(session).Should(Exit(0))
457456
contents := string(bytes.TrimSpace(session.Out.Contents()))
458457
Eventually(contents).Should(Equal(`an:
459-
- array
458+
- array
460459
foo: bar
461460
nested:
462-
a: 1`))
461+
a: 1`))
463462
})
464463
})
465464

@@ -478,8 +477,8 @@ nested:
478477
Eventually(session).Should(Exit(0))
479478
contents := string(bytes.TrimSpace(session.Out.Contents()))
480479
Eventually(contents).Should(Equal(`versions:
481-
- secret: newSecret
482-
- secret: oldSecret`))
480+
- secret: newSecret
481+
- secret: oldSecret`))
483482
})
484483
})
485484
})
@@ -524,7 +523,7 @@ nested:
524523
Eventually(session.Out).Should(Say("certificate: my-cert"))
525524
Eventually(session.Out).Should(Say("private_key: my-priv"))
526525
Eventually(session.Out).Should(Say(`metadata:
527-
some: metadata`))
526+
some: metadata`))
528527
})
529528

530529
Context("with --key flag", func() {
@@ -606,12 +605,12 @@ private_key: '----begin----my-priv-----end------'`))
606605

607606
Eventually(session).Should(Exit(0))
608607
Eventually(string(bytes.TrimSpace(session.Out.Contents()))).Should(Equal(`versions:
609-
- ca: '----begin----my-new-ca-----end------'
610-
certificate: '----begin----my-new-cert-----end------'
611-
private_key: '----begin----my-new-priv-----end------'
612-
- ca: '----begin----my-old-ca-----end------'
613-
certificate: '----begin----my-old-cert-----end------'
614-
private_key: '----begin----my-old-priv-----end------'`))
608+
- ca: '----begin----my-new-ca-----end------'
609+
certificate: '----begin----my-new-cert-----end------'
610+
private_key: '----begin----my-new-priv-----end------'
611+
- ca: '----begin----my-old-ca-----end------'
612+
certificate: '----begin----my-old-cert-----end------'
613+
private_key: '----begin----my-old-priv-----end------'`))
615614
})
616615
})
617616

@@ -680,7 +679,7 @@ private_key: |-
680679
Eventually(session.Out).Should(Say("private_key: some-private-key"))
681680
Eventually(session.Out).Should(Say("public_key: some-public-key"))
682681
Eventually(session.Out).Should(Say(`metadata:
683-
some: metadata`))
682+
some: metadata`))
684683
})
685684

686685
Context("with --quiet flag", func() {
@@ -728,10 +727,10 @@ private_key: |-
728727
Eventually(session).Should(Exit(0))
729728
contents := string(bytes.TrimSpace(session.Out.Contents()))
730729
Eventually(contents).Should(Equal(`versions:
731-
- private_key: new-private-key
732-
public_key: new-public-key
733-
- private_key: old-private-key
734-
public_key: old-public-key`))
730+
- private_key: new-private-key
731+
public_key: new-public-key
732+
- private_key: old-private-key
733+
public_key: old-public-key`))
735734
})
736735
})
737736

@@ -796,7 +795,7 @@ private_key: |-
796795
Eventually(session.Out).Should(Say(`password_hash: passw0rd-H4\$h`))
797796
Eventually(session.Out).Should(Say("username: my-username"))
798797
Eventually(session.Out).Should(Say(`metadata:
799-
some: metadata`))
798+
some: metadata`))
800799
})
801800

802801
Context("with --quiet flag", func() {

commands/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"code.cloudfoundry.org/credhub-cli/credhub"
1212
"code.cloudfoundry.org/credhub-cli/credhub/auth"
1313
"code.cloudfoundry.org/credhub-cli/errors"
14-
"gopkg.in/yaml.v2"
14+
"gopkg.in/yaml.v3"
1515
)
1616

1717
func initializeCredhubClient(cfg config.Config) (*credhub.CredHub, error) {

commands/regenerate_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ var _ = Describe("Regenerate", func() {
9494
Eventually(session).Should(Exit(0))
9595
metadataOutput := `
9696
metadata:
97-
array:
98-
- metadata
99-
some:
100-
example: metadata`
97+
array:
98+
- metadata
99+
some:
100+
example: metadata`
101101
Eventually(string(session.Out.Contents())).Should(ContainSubstring(metadataOutput))
102102
})
103103
})
@@ -115,10 +115,10 @@ metadata:
115115
Eventually(session).Should(Exit(0))
116116
metadataOutput := `
117117
metadata:
118-
array:
119-
- metadata
120-
some:
121-
example: metadata`
118+
array:
119+
- metadata
120+
some:
121+
example: metadata`
122122
Eventually(string(session.Out.Contents())).Should(ContainSubstring(metadataOutput))
123123
})
124124

0 commit comments

Comments
 (0)