我使用Spotify的多克尔客户端,但已经遇到了一个文档墙。我试图找出如何传递在环境中使用泊坞窗客户端内置的容器已创建的码头工人秘密。该文件只展示了如何创建秘密,但这不是非常有用,因为秘密已经存在。我能够获得使用listSecrets
的DockerClient
环境的秘密名单,但我也没有办法将它们转换从Secret
到SecretBind
。很感谢任何形式的帮助。
我想通了这一点翻翻所有代码spotify/docker-client
代码。文档不显示的方式转换成一个Secret
到SecretBind
是ContainerSpec
需要在泊坞窗秘密通过。
public SecretBind createBind(Secret secret) {
SecretFile file = SecretFile.builder()
.name(secret.secretSpect().name())
.uid("0")
.gid("0")
.build();
SecretBind bind = SecretBind.builder()
.secretName(secret.secretSpec().name())
.secretId(secret.id())
.file(file)
.build();
return bind;
}