Skip to content

Commit

Permalink
do it actually right this time
Browse files Browse the repository at this point in the history
  • Loading branch information
drevell committed Feb 14, 2024
1 parent 055de7c commit 4550ac6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
8 changes: 4 additions & 4 deletions templates/commands/goldentest/new_test_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ steps:
message: 'Hello, {{.name}}!'
`

testYaml := `api_version: cli.abcxyz.dev/v1beta4
testYaml := `api_version: cli.abcxyz.dev/v1beta5
kind: GoldenTest
inputs:
- name: name
Expand Down Expand Up @@ -168,7 +168,7 @@ builtin_vars:
"testdata/golden/new-test/test.yaml": testYaml,
},
expectedContents: map[string]string{
"test.yaml": `api_version: cli.abcxyz.dev/v1beta4
"test.yaml": `api_version: cli.abcxyz.dev/v1beta5
kind: GoldenTest
inputs:
- name: name
Expand Down Expand Up @@ -208,7 +208,7 @@ steps:
`,
},
expectedContents: map[string]string{
"test.yaml": `api_version: cli.abcxyz.dev/v1beta4
"test.yaml": `api_version: cli.abcxyz.dev/v1beta5
kind: GoldenTest
`,
},
Expand Down Expand Up @@ -371,7 +371,7 @@ Enter value: `,
},
},
expectedContents: map[string]string{
"test.yaml": `api_version: cli.abcxyz.dev/v1beta4
"test.yaml": `api_version: cli.abcxyz.dev/v1beta5
kind: GoldenTest
inputs:
- name: name
Expand Down
8 changes: 4 additions & 4 deletions templates/common/render/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestWriteManifest(t *testing.T) {
want: map[string]string{
"a.txt": "some other stuff",
".abc/manifest_nolocation_2023-12-08T23:59:02.000000013Z.lock.yaml": `# Generated by the "abc templates" command. Do not modify.
api_version: cli.abcxyz.dev/v1beta4
api_version: cli.abcxyz.dev/v1beta5
kind: Manifest
creation_time: 2023-12-08T23:59:02.000000013Z
modification_time: 2023-12-08T23:59:02.000000013Z
Expand Down Expand Up @@ -111,7 +111,7 @@ output_hashes:
want: map[string]string{
"a.txt": "some other stuff",
".abc/manifest_github.com%2Ffoo%2Fbar_2023-12-08T23:59:02.000000013Z.lock.yaml": `# Generated by the "abc templates" command. Do not modify.
api_version: cli.abcxyz.dev/v1beta4
api_version: cli.abcxyz.dev/v1beta5
kind: Manifest
creation_time: 2023-12-08T23:59:02.000000013Z
modification_time: 2023-12-08T23:59:02.000000013Z
Expand Down Expand Up @@ -174,7 +174,7 @@ output_hashes:
want: map[string]string{
"a.txt": "some other stuff",
".abc/manifest_nolocation_2023-12-08T23:59:02.000000013Z.lock.yaml": `# Generated by the "abc templates" command. Do not modify.
api_version: cli.abcxyz.dev/v1beta4
api_version: cli.abcxyz.dev/v1beta5
kind: Manifest
creation_time: 2023-12-08T23:59:02.000000013Z
modification_time: 2023-12-08T23:59:02.000000013Z
Expand Down Expand Up @@ -206,7 +206,7 @@ output_hashes:
outputHashes: map[string][]byte{},
want: map[string]string{
".abc/manifest_nolocation_2023-12-08T23:59:02.000000013Z.lock.yaml": `# Generated by the "abc templates" command. Do not modify.
api_version: cli.abcxyz.dev/v1beta4
api_version: cli.abcxyz.dev/v1beta5
kind: Manifest
creation_time: 2023-12-08T23:59:02.000000013Z
modification_time: 2023-12-08T23:59:02.000000013Z
Expand Down
2 changes: 1 addition & 1 deletion templates/common/render/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ steps:
"dir1/file_in_dir.txt": "file_in_dir contents",
"dir2/file2.txt": "file2 contents",
".abc/manifest_nolocation_2023-12-08T23:59:02.000000013Z.lock.yaml": `# Generated by the "abc templates" command. Do not modify.
api_version: cli.abcxyz.dev/v1beta4
api_version: cli.abcxyz.dev/v1beta5
kind: Manifest
creation_time: 2023-12-08T23:59:02.000000013Z
modification_time: 2023-12-08T23:59:02.000000013Z
Expand Down
3 changes: 3 additions & 0 deletions templates/model/decode/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ var apiVersions = []apiVersionDef{
KindManifest: &manifestv1alpha1.Manifest{},
},
},
// Why is v1beta5 the same as v1beta4? It's a simple hack that works around
// a bug in abc versions <=0.5.0, for reasons that are very difficult to
// understand. See github.com/abcxyz/abc/pull/431 for rationale.
{
apiVersion: "cli.abcxyz.dev/v1beta5",
unreleased: true,
Expand Down
2 changes: 1 addition & 1 deletion templates/model/decode/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ func TestLatestSupportedAPIVersion(t *testing.T) {
{
name: "not_release_build",
isReleaseBuild: false,
want: "cli.abcxyz.dev/v1beta4", // update for creation of a new api_version
want: "cli.abcxyz.dev/v1beta5", // update for creation of a new api_version
},
}

Expand Down

0 comments on commit 4550ac6

Please sign in to comment.