Fix the bug of tag a existed tag name of a repository.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Add docker tag tests.

Signed-off-by: Lei Jitang <leijitang@huawei.com>