fix tests

This commit is contained in:
Yann Hamon 2023-01-22 18:36:09 +01:00
parent bebab866e6
commit 7c6bf57296
2 changed files with 8 additions and 8 deletions

View file

@ -9,16 +9,16 @@ import (
)
type mockRegistry struct {
SchemaDownloader func() ([]byte, error)
SchemaDownloader func() (string, []byte, error)
}
func newMockRegistry(f func() ([]byte, error)) *mockRegistry {
func newMockRegistry(f func() (string, []byte, error)) *mockRegistry {
return &mockRegistry{
SchemaDownloader: f,
}
}
func (m mockRegistry) DownloadSchema(resourceKind, resourceAPIVersion, k8sVersion string) ([]byte, error) {
func (m mockRegistry) DownloadSchema(resourceKind, resourceAPIVersion, k8sVersion string) (string, []byte, error) {
return m.SchemaDownloader()
}
@ -362,11 +362,11 @@ lastName: bar
schemaCache: nil,
schemaDownload: downloadSchema,
regs: []registry.Registry{
newMockRegistry(func() ([]byte, error) {
return testCase.schemaRegistry1, nil
newMockRegistry(func() (string, []byte, error) {
return "", testCase.schemaRegistry1, nil
}),
newMockRegistry(func() ([]byte, error) {
return testCase.schemaRegistry2, nil
newMockRegistry(func() (string, []byte, error) {
return "", testCase.schemaRegistry2, nil
}),
},
}