Skip to content

Commit

Permalink
pkg/terraform/exec/plugins: vendor in random and local tf provider
Browse files Browse the repository at this point in the history
The random provider is needed for azure to generate a storage
account name that is unique across azure.
storage account names also have extra naming restrictions.
is used to keep this in the package and avoid passing an extra
parameter as a variable.

The local provider is necessary to upload the ignition file to
azure storage because the azure provider does not support
binary upload. we need to create a file and pass it to the blob
upload resource instead.

tf blob storage resource : https://www.terraform.io/docs/providers/azurerm/r/storage_blob.html
storage naming limits : https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions#storage
  • Loading branch information
serbrech committed Apr 24, 2019
1 parent 66f7b5a commit 5594f2d
Show file tree
Hide file tree
Showing 21 changed files with 1,994 additions and 2 deletions.
30 changes: 30 additions & 0 deletions pkg/terraform/exec/plugins/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/terraform/exec/plugins/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ ignored = [
[[override]]
name = "github.com/hashicorp/go-azure-helpers"
version = "0.3.2"

[[constraint]]
name = "github.com/terraform-providers/terraform-provider-random"
version = "2.1.1"
18 changes: 16 additions & 2 deletions pkg/terraform/exec/plugins/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,27 @@ package plugins
import (
"github.com/hashicorp/terraform/plugin"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm"
"github.com/terraform-providers/terraform-provider-local/local"
"github.com/terraform-providers/terraform-provider-random/random"
)

func init() {
exec := func() {
azurermProvider := func() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: azurerm.Provider,
})
}
KnownPlugins["terraform-provider-azurerm"] = exec
localProvider := func() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: local.Provider,
})
}
randomProvider := func() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: random.Provider,
})
}
KnownPlugins["terraform-provider-azurerm"] = azurermProvider
KnownPlugins["terraform-provider-local"] = localProvider
KnownPlugins["terraform-provider-random"] = randomProvider
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5594f2d

Please sign in to comment.