diff --git a/.github/workflows/terratest.yml b/.github/workflows/terratest.yml index e985eb4c..821bf071 100644 --- a/.github/workflows/terratest.yml +++ b/.github/workflows/terratest.yml @@ -52,14 +52,14 @@ jobs: mv terraform-provider-grid ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/ - name: Test virtual machines env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestVM - name: Test kubernetes env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: | @@ -68,70 +68,70 @@ jobs: - name: Test Gateways env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestGatewayDeployments - name: Test private gateways env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestGatewayPrivate - name: Test wireguard env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestWireguard - name: Test ZDBs env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestZdbs - name: Test QSFS env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestQSFS - name: Test peertube env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestPeertube - name: Test presearch env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestPresearch - name: Test taiga env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestTaiga - name: Test mattermost env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestMattermost - name: Test nomad env: - MNEMONICS: ${{ secrets.MNEMONICS }} + MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests run: go test -v ./... --tags=integration -run TestNomad diff --git a/README.md b/README.md index fa44b214..a0ebeb92 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ make docs ```bash cd examples/resources/singlenode -export MNEMONICS="mnemonics words" +export MNEMONIC="mnemonic words" export NETWORK="network" # dev, qa, test, main terraform init && terraform apply # creates resources defined in main.tf terraform destroy # destroy the created resource @@ -67,7 +67,7 @@ make ## Run tests ```bash -export MNEMONICS="mnemonics words" +export MNEMONIC="mnemonic words" export NETWORK="network" # dev, qa, test, main ``` diff --git a/docs/index.md b/docs/index.md index 3be843b0..7aff1560 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,7 @@ description: |- ### Optional - `key_type` (String) key type registered on substrate (ed25519 or sr25519) -- `mnemonics` (String, Sensitive) +- `mnemonic` (String, Sensitive) - `network` (String) grid network, one of: dev test qa main - `relay_url` (String) rmb proxy url, example: wss://relay.dev.grid.tf - `rmb_timeout` (Number) timeout duration in seconds for rmb calls diff --git a/go.mod b/go.mod index 4ed7acdf..2145a402 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,8 @@ require ( github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.11 github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.11 github.com/threefoldtech/zos v0.5.6-0.20240611092312-66184cdeb953 - golang.org/x/crypto v0.25.0 - golang.org/x/sync v0.7.0 + golang.org/x/crypto v0.26.0 + golang.org/x/sync v0.8.0 golang.zx2c4.com/wireguard/wgctrl v0.0.0-20210803171230-4253848d036c ) @@ -139,8 +139,8 @@ require ( golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gonum.org/v1/gonum v0.15.0 // indirect diff --git a/go.sum b/go.sum index f9809ddd..97ee0e80 100644 --- a/go.sum +++ b/go.sum @@ -755,8 +755,8 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -897,8 +897,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -987,15 +987,15 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1007,8 +1007,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/integrationtests/remoterun.go b/integrationtests/remoterun.go index f627a0d8..7ca794f8 100644 --- a/integrationtests/remoterun.go +++ b/integrationtests/remoterun.go @@ -18,14 +18,14 @@ import ( ) func setup() (deployer.TFPluginClient, error) { - mnemonics := os.Getenv("MNEMONICS") + mnemonic := os.Getenv("MNEMONIC") network := os.Getenv("NETWORK") if network == "" { network = "dev" } - return deployer.NewTFPluginClient(mnemonics, deployer.WithNetwork(network), deployer.WithLogs()) + return deployer.NewTFPluginClient(mnemonic, deployer.WithNetwork(network), deployer.WithLogs()) } // RemoteRun used for running cmd remotely using ssh diff --git a/internal/provider/provider.go b/internal/provider/provider.go index c2e2dcf3..fb9af052 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -26,11 +26,11 @@ func New(version string, st state.Getter) (func() *schema.Provider, subi.Substra return func() *schema.Provider { p := &schema.Provider{ Schema: map[string]*schema.Schema{ - "mnemonics": { + "mnemonic": { Type: schema.TypeString, Required: true, Sensitive: true, - DefaultFunc: schema.EnvDefaultFunc("MNEMONICS", nil), + DefaultFunc: schema.EnvDefaultFunc("MNEMONIC", nil), }, "key_type": { Type: schema.TypeString, @@ -103,7 +103,7 @@ func New(version string, st state.Getter) (func() *schema.Provider, subi.Substra func providerConfigure(st state.Getter) (func(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics), subi.SubstrateExt) { var substrateConn subi.SubstrateExt return func(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { - mnemonics := d.Get("mnemonics").(string) + mnemonic := d.Get("mnemonic").(string) keyType := d.Get("key_type").(string) network := d.Get("network").(string) substrateURL := d.Get("substrate_url").(string) @@ -141,7 +141,7 @@ func providerConfigure(st state.Getter) (func(ctx context.Context, d *schema.Res opts = append(opts, deployer.WithLogs()) } - tfPluginClient, err := deployer.NewTFPluginClient(mnemonics, opts...) + tfPluginClient, err := deployer.NewTFPluginClient(mnemonic, opts...) if err != nil { return nil, diag.FromErr(errors.Wrap(err, "error creating threefold plugin client")) }