builder.proxmox: make ProxmoxURL *url.URL field unexported

the only exported field we/users care about is ProxmoxURLRaw
pull/8232/head
Adrien Delorme 7 years ago
parent 40692a4e38
commit 3fe1c96491

@ -41,7 +41,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
tlsConfig := &tls.Config{
InsecureSkipVerify: b.config.SkipCertValidation,
}
b.proxmoxClient, err = proxmox.NewClient(b.config.ProxmoxURL.String(), nil, tlsConfig)
b.proxmoxClient, err = proxmox.NewClient(b.config.proxmoxURL.String(), nil, tlsConfig)
if err != nil {
return nil, err
}

@ -27,7 +27,7 @@ type Config struct {
Comm communicator.Config `mapstructure:",squash"`
ProxmoxURLRaw string `mapstructure:"proxmox_url"`
ProxmoxURL *url.URL
proxmoxURL *url.URL
SkipCertValidation bool `mapstructure:"insecure_skip_tls_verify"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
@ -184,7 +184,7 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
if c.ProxmoxURLRaw == "" {
errs = packer.MultiErrorAppend(errs, errors.New("proxmox_url must be specified"))
}
if c.ProxmoxURL, err = url.Parse(c.ProxmoxURLRaw); err != nil {
if c.proxmoxURL, err = url.Parse(c.ProxmoxURLRaw); err != nil {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("Could not parse proxmox_url: %s", err)))
}
if c.ISOFile == "" {

Loading…
Cancel
Save