kubeadm: Add missing unit test for GetGenericImage

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
This commit is contained in:
Rostislav M. Georgiev 2018-08-03 11:57:44 +03:00
parent 14dbfdcc3b
commit 8c59c6d219

View File

@ -32,6 +32,19 @@ const (
gcrPrefix = "k8s.gcr.io" gcrPrefix = "k8s.gcr.io"
) )
func TestGetGenericImage(t *testing.T) {
const (
prefix = "foo"
image = "bar"
tag = "baz"
)
expected := fmt.Sprintf("%s/%s:%s", prefix, image, tag)
actual := GetGenericImage(prefix, image, tag)
if actual != expected {
t.Errorf("failed GetGenericImage:\n\texpected: %s\n\t actual: %s", expected, actual)
}
}
func TestGetGenericArchImage(t *testing.T) { func TestGetGenericArchImage(t *testing.T) {
const ( const (
prefix = "foo" prefix = "foo"