Skip to content

Commit

Permalink
refactor: remove deprecated InitializePluginVersion, replace with New…
Browse files Browse the repository at this point in the history
…PluginVersion
  • Loading branch information
IAMDAVID0920 authored and lbajolet-hashicorp committed Jun 3, 2024
1 parent 361a432 commit d625694
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions builder/file/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var FilePluginVersion *version.PluginVersion

func init() {
FilePluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
FilePluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions builder/null/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var NullPluginVersion *version.PluginVersion

func init() {
NullPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
NullPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
2 changes: 1 addition & 1 deletion packer/plugin_discover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func TestHelperPlugins(t *testing.T) {
for _, mock := range allMocks {
plugin, found := mock[pluginName]
if found {
plugin.SetVersion(version.InitializePluginVersion("1.0.0", ""))
plugin.SetVersion(version.NewPluginVersion("1.0.0", "", ""))
err := plugin.RunCommand(args...)
if err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
Expand Down
4 changes: 2 additions & 2 deletions post-processor/artifice/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var ArtificePluginVersion *version.PluginVersion

func init() {
ArtificePluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
ArtificePluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions post-processor/checksum/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var ChecksumPluginVersion *version.PluginVersion

func init() {
ChecksumPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
ChecksumPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions post-processor/compress/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var CompressPluginVersion *version.PluginVersion

func init() {
CompressPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
CompressPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions post-processor/manifest/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var ManifestPluginVersion *version.PluginVersion

func init() {
ManifestPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
ManifestPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions post-processor/shell-local/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var ShellLocalPluginVersion *version.PluginVersion

func init() {
ShellLocalPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
ShellLocalPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/breakpoint/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var BreakpointPluginVersion *version.PluginVersion

func init() {
BreakpointPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
BreakpointPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/file/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var FileProvisionerVersion *version.PluginVersion

func init() {
FileProvisionerVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
FileProvisionerVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/powershell/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var PowershellPluginVersion *version.PluginVersion

func init() {
PowershellPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
PowershellPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/shell-local/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var ShellLocalProvisionerVersion *version.PluginVersion

func init() {
ShellLocalProvisionerVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
ShellLocalProvisionerVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/shell/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var ShellPluginVersion *version.PluginVersion

func init() {
ShellPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
ShellPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/sleep/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var SleepProvisionerVersion *version.PluginVersion

func init() {
SleepProvisionerVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
SleepProvisionerVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/windows-restart/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var WindowsRestartPluginVersion *version.PluginVersion

func init() {
WindowsRestartPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
WindowsRestartPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}
4 changes: 2 additions & 2 deletions provisioner/windows-shell/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import (
var WindowsShellPluginVersion *version.PluginVersion

func init() {
WindowsShellPluginVersion = version.InitializePluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease)
WindowsShellPluginVersion = version.NewPluginVersion(
packerVersion.Version, packerVersion.VersionPrerelease, packerVersion.VersionMetadata)
}

0 comments on commit d625694

Please sign in to comment.