代码拉取完成,页面将自动刷新
package host
import (
"github.com/docker/machine/libmachine/auth"
"github.com/docker/machine/libmachine/engine"
"github.com/docker/machine/libmachine/swarm"
)
// In the 0.1.0 => 0.2.0 transition, the JSON representation of
// machines changed from a "flat" to a more "nested" structure
// for various options and configuration settings. To preserve
// compatibility with existing machines, these migration functions
// have been introduced. They preserve backwards compat at the expense
// of some duplicated information.
// MigrateHostV0ToHostV1 validates host config and modifies if needed
// this is used for configuration updates
func MigrateHostV0ToHostV1(hostV0 *V0) *V1 {
hostV1 := &V1{
Driver: hostV0.Driver,
DriverName: hostV0.DriverName,
}
hostV1.HostOptions = &OptionsV1{}
hostV1.HostOptions.EngineOptions = &engine.Options{
TLSVerify: true,
InstallURL: "https://get.docker.com",
}
hostV1.HostOptions.SwarmOptions = &swarm.Options{
Address: "",
Discovery: hostV0.SwarmDiscovery,
Host: hostV0.SwarmHost,
Master: hostV0.SwarmMaster,
}
hostV1.HostOptions.AuthOptions = &AuthOptionsV1{
StorePath: hostV0.StorePath,
CaCertPath: hostV0.CaCertPath,
CaCertRemotePath: "",
ServerCertPath: hostV0.ServerCertPath,
ServerKeyPath: hostV0.ServerKeyPath,
ClientKeyPath: hostV0.ClientKeyPath,
ServerCertRemotePath: "",
ServerKeyRemotePath: "",
PrivateKeyPath: hostV0.PrivateKeyPath,
ClientCertPath: hostV0.ClientCertPath,
}
return hostV1
}
// MigrateHostMetadataV0ToHostMetadataV1 fills nested host metadata and modifies if needed
// this is used for configuration updates
func MigrateHostMetadataV0ToHostMetadataV1(m *MetadataV0) *Metadata {
hostMetadata := &Metadata{}
hostMetadata.DriverName = m.DriverName
hostMetadata.HostOptions.EngineOptions = &engine.Options{}
hostMetadata.HostOptions.AuthOptions = &auth.Options{
StorePath: m.StorePath,
CaCertPath: m.CaCertPath,
CaCertRemotePath: "",
ServerCertPath: m.ServerCertPath,
ServerKeyPath: m.ServerKeyPath,
ClientKeyPath: "",
ServerCertRemotePath: "",
ServerKeyRemotePath: "",
CaPrivateKeyPath: m.PrivateKeyPath,
ClientCertPath: m.ClientCertPath,
}
hostMetadata.ConfigVersion = m.ConfigVersion
return hostMetadata
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。