mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
unit test for #2815, as requested by @brendandburns
This commit is contained in:
parent
17475cdbe7
commit
85b4b4677e
@ -264,3 +264,23 @@ func TestDockerKeyringLookup(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type imageTrackingDockerClient struct {
|
||||||
|
*FakeDockerClient
|
||||||
|
imageName string
|
||||||
|
}
|
||||||
|
func (f *imageTrackingDockerClient) InspectImage(name string) (image *docker.Image, err error) {
|
||||||
|
image, err = f.FakeDockerClient.InspectImage(name)
|
||||||
|
f.imageName = name
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func TestIsImagePresent(t *testing.T) {
|
||||||
|
cl := &imageTrackingDockerClient{&FakeDockerClient{},""}
|
||||||
|
puller := &dockerPuller{
|
||||||
|
client: cl,
|
||||||
|
}
|
||||||
|
_, _ = puller.IsImagePresent("abc:123")
|
||||||
|
if cl.imageName != "abc:123" {
|
||||||
|
t.Errorf("expected inspection of image abc:123, instead inspected image %v", cl.imageName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user