Corrected expected output of test
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
This commit is contained in:
parent
81654a9195
commit
c13d5b57d3
@ -26,9 +26,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
testdataResource1 = "./testdata/convert_resource1.yaml"
|
||||
testdataResource2 = "./testdata/convert_resource2.yaml"
|
||||
testdataResource3 = "./testdata/convert_resource3.yaml"
|
||||
testdataResource1 = "./testdata/convert_resource1.yaml"
|
||||
testdataResource2 = "./testdata/convert_resource2.yaml"
|
||||
testdataResource3 = "./testdata/convert_resource3.yaml"
|
||||
testdataResourceWithOrganizationV1alpha2 = "./testdata/convert_resource_with_organization_v1alpha2.yaml"
|
||||
|
||||
targetv1alpha2 = "cert-manager.io/v1alpha2"
|
||||
@ -84,7 +84,7 @@ func TestCtlConvert(t *testing.T) {
|
||||
expErr: true,
|
||||
},
|
||||
"an object in v1alpha2 that uses a field that has been renamed in v1alpha3 should be converted properly": {
|
||||
input: testdataResourceWithOrganizationV1alpha2,
|
||||
input: testdataResourceWithOrganizationV1alpha2,
|
||||
targetVersion: targetv1alpha3,
|
||||
expOutput: `
|
||||
apiVersion: cert-manager.io/v1alpha3
|
||||
@ -96,14 +96,14 @@ metadata:
|
||||
spec:
|
||||
commonName: my-csi-app
|
||||
isCA: true
|
||||
subject:
|
||||
organizations:
|
||||
- hello world
|
||||
issuerRef:
|
||||
group: cert-manager.io
|
||||
kind: Issuer
|
||||
name: selfsigned-issuer
|
||||
secretName: ca-key-pair
|
||||
subject:
|
||||
organizations:
|
||||
- hello world
|
||||
status: {}`,
|
||||
},
|
||||
}
|
||||
@ -128,7 +128,7 @@ status: {}`,
|
||||
}
|
||||
|
||||
if strings.TrimSpace(test.expOutput) != strings.TrimSpace(outBuf.String()) {
|
||||
t.Errorf("got unexpected output, exp=%s got=%s",
|
||||
t.Errorf("got unexpected output, exp=%s\n got=%s",
|
||||
strings.TrimSpace(test.expOutput), strings.TrimSpace(outBuf.String()))
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user