fix conflicts
This commit is contained in:
parent
0eff73293a
commit
19bdc8b49e
|
@ -198,14 +198,14 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) {
|
||||||
// Check if the PrivateNetworking is enabled by user before use VPC UUID
|
// Check if the PrivateNetworking is enabled by user before use VPC UUID
|
||||||
if c.VPCUUID != "" {
|
if c.VPCUUID != "" {
|
||||||
if c.PrivateNetworking != true {
|
if c.PrivateNetworking != true {
|
||||||
errs = packer.MultiErrorAppend(errs, errors.New("private networking should be enabled to use vpc_uuid"))
|
errs = packersdk.MultiErrorAppend(errs, errors.New("private networking should be enabled to use vpc_uuid"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the PrivateNetworking is enabled by user before use ConnectWithPrivateIP
|
// Check if the PrivateNetworking is enabled by user before use ConnectWithPrivateIP
|
||||||
if c.ConnectWithPrivateIP == true {
|
if c.ConnectWithPrivateIP == true {
|
||||||
if c.PrivateNetworking != true {
|
if c.PrivateNetworking != true {
|
||||||
errs = packer.MultiErrorAppend(errs, errors.New("private networking should be enabled to use connect_with_private_ip"))
|
errs = packersdk.MultiErrorAppend(errs, errors.New("private networking should be enabled to use connect_with_private_ip"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ func (c *Config) Prepare(raws ...interface{}) error {
|
||||||
if c.CreateVnicDetails.SubnetId == nil {
|
if c.CreateVnicDetails.SubnetId == nil {
|
||||||
c.CreateVnicDetails.SubnetId = &c.SubnetID
|
c.CreateVnicDetails.SubnetId = &c.SubnetID
|
||||||
} else if (*c.CreateVnicDetails.SubnetId != c.SubnetID) && (c.SubnetID != "") {
|
} else if (*c.CreateVnicDetails.SubnetId != c.SubnetID) && (c.SubnetID != "") {
|
||||||
errs = packer.MultiErrorAppend(
|
errs = packersdk.MultiErrorAppend(
|
||||||
errs, errors.New("'create_vnic_details[subnet]' must match 'subnet_ocid' if both are specified"))
|
errs, errors.New("'create_vnic_details[subnet]' must match 'subnet_ocid' if both are specified"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,11 +295,7 @@ func UploadToBucket(opts option.ClientOption, ui packersdk.Ui, artifact packersd
|
||||||
return storageObject.SelfLink, nil
|
return storageObject.SelfLink, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
func CreateGceImage(opts option.ClientOption, ui packersdk.Ui, project string, rawImageURL string, imageName string, imageDescription string, imageFamily string, imageLabels map[string]string, imageGuestOsFeatures []string, shieldedVMStateConfig *compute.InitialStateConfig) (packersdk.Artifact, error) {
|
||||||
func CreateGceImage(opts option.ClientOption, ui packersdk.Ui, project string, rawImageURL string, imageName string, imageDescription string, imageFamily string, imageLabels map[string]string, imageGuestOsFeatures []string, shieldedVMStateConfig *compute.InitialStateConfig) (packer.Artifact, error) {
|
|
||||||
=======
|
|
||||||
func CreateGceImage(opts option.ClientOption, ui packersdk.Ui, project string, rawImageURL string, imageName string, imageDescription string, imageFamily string, imageLabels map[string]string, imageGuestOsFeatures []string) (packersdk.Artifact, error) {
|
|
||||||
>>>>>>> move Artifact and artifact mock to the sdk
|
|
||||||
service, err := compute.NewService(context.TODO(), opts)
|
service, err := compute.NewService(context.TODO(), opts)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -400,7 +400,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe
|
||||||
|
|
||||||
if p.config.GuestOSType == guestexec.WindowsOSType {
|
if p.config.GuestOSType == guestexec.WindowsOSType {
|
||||||
ui.Message("Downloading Git for Windows")
|
ui.Message("Downloading Git for Windows")
|
||||||
cmd1 := &packer.RemoteCmd{Command: fmt.Sprintf("powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe -OutFile $env:TEMP/Git.exe")}
|
cmd1 := &packersdk.RemoteCmd{Command: fmt.Sprintf("powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe -OutFile $env:TEMP/Git.exe")}
|
||||||
if err = cmd1.RunWithUi(ctx, comm, ui); (err != nil || cmd1.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
if err = cmd1.RunWithUi(ctx, comm, ui); (err != nil || cmd1.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = fmt.Errorf("Bad exit status: %d", cmd1.ExitStatus())
|
err = fmt.Errorf("Bad exit status: %d", cmd1.ExitStatus())
|
||||||
|
@ -410,7 +410,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.Message("Installing Git for Windows")
|
ui.Message("Installing Git for Windows")
|
||||||
cmd2 := &packer.RemoteCmd{Command: fmt.Sprintf("powershell Start-Process -FilePath $env:TEMP/Git.exe /SILENT -Wait")}
|
cmd2 := &packersdk.RemoteCmd{Command: fmt.Sprintf("powershell Start-Process -FilePath $env:TEMP/Git.exe /SILENT -Wait")}
|
||||||
if err = cmd2.RunWithUi(ctx, comm, ui); (err != nil || cmd2.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
if err = cmd2.RunWithUi(ctx, comm, ui); (err != nil || cmd2.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = fmt.Errorf("Bad exit status: %d", cmd2.ExitStatus())
|
err = fmt.Errorf("Bad exit status: %d", cmd2.ExitStatus())
|
||||||
|
@ -420,7 +420,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.Message("Cleaning Up After Git for Windows")
|
ui.Message("Cleaning Up After Git for Windows")
|
||||||
cmd3 := &packer.RemoteCmd{Command: fmt.Sprintf("powershell Remove-Item $env:TEMP/Git.exe")}
|
cmd3 := &packersdk.RemoteCmd{Command: fmt.Sprintf("powershell Remove-Item $env:TEMP/Git.exe")}
|
||||||
if err = cmd3.RunWithUi(ctx, comm, ui); (err != nil || cmd3.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
if err = cmd3.RunWithUi(ctx, comm, ui); (err != nil || cmd3.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = fmt.Errorf("Bad exit status: %d", cmd3.ExitStatus())
|
err = fmt.Errorf("Bad exit status: %d", cmd3.ExitStatus())
|
||||||
|
@ -430,7 +430,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.Message("Running salt-call --local winrepo.update_git_repos")
|
ui.Message("Running salt-call --local winrepo.update_git_repos")
|
||||||
cmd4 := &packer.RemoteCmd{Command: fmt.Sprintf("%s --local winrepo.update_git_repos", filepath.Join(p.config.SaltBinDir, "salt-call"))}
|
cmd4 := &packersdk.RemoteCmd{Command: fmt.Sprintf("%s --local winrepo.update_git_repos", filepath.Join(p.config.SaltBinDir, "salt-call"))}
|
||||||
if err = cmd4.RunWithUi(ctx, comm, ui); (err != nil || cmd4.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
if err = cmd4.RunWithUi(ctx, comm, ui); (err != nil || cmd4.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = fmt.Errorf("Bad exit status: %d", cmd4.ExitStatus())
|
err = fmt.Errorf("Bad exit status: %d", cmd4.ExitStatus())
|
||||||
|
@ -440,7 +440,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.Message("Running salt-call --local pkg.refresh_db")
|
ui.Message("Running salt-call --local pkg.refresh_db")
|
||||||
cmd5 := &packer.RemoteCmd{Command: fmt.Sprintf("%s --local pkg.refresh_db", filepath.Join(p.config.SaltBinDir, "salt-call"))}
|
cmd5 := &packersdk.RemoteCmd{Command: fmt.Sprintf("%s --local pkg.refresh_db", filepath.Join(p.config.SaltBinDir, "salt-call"))}
|
||||||
if err = cmd5.RunWithUi(ctx, comm, ui); (err != nil || cmd5.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
if err = cmd5.RunWithUi(ctx, comm, ui); (err != nil || cmd5.ExitStatus() != 0) && !p.config.NoExitOnFailure {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = fmt.Errorf("Bad exit status: %d", cmd5.ExitStatus())
|
err = fmt.Errorf("Bad exit status: %d", cmd5.ExitStatus())
|
||||||
|
|
Loading…
Reference in New Issue