1 Star 0 Fork 0

peter/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
images.go 936 Bytes
一键复制 编辑 原始数据 按行查看 历史
Matthew Sykes 提交于 2018-06-12 16:38 . [FAB-10643] implement a new world
/*
Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package helpers
import (
"encoding/base32"
"fmt"
"strings"
"github.com/hyperledger/fabric/common/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
docker "github.com/fsouza/go-dockerclient"
)
func AssertImagesExist(imageNames ...string) {
dockerClient, err := docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())
for _, imageName := range imageNames {
images, err := dockerClient.ListImages(docker.ListImagesOptions{
Filter: imageName,
})
ExpectWithOffset(1, err).NotTo(HaveOccurred())
if len(images) != 1 {
Fail(fmt.Sprintf("missing required image: %s", imageName), 1)
}
}
}
// UniqueName generates base-32 enocded UUIDs for container names.
func UniqueName() string {
name := base32.StdEncoding.WithPadding(base32.NoPadding).EncodeToString(util.GenerateBytesUUID())
return strings.ToLower(name)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/peter_code_git/fabric.git
git@gitee.com:peter_code_git/fabric.git
peter_code_git
fabric
fabric
v1.2.0-rc1

搜索帮助