diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ddd1d8..9bcb475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.6] - 2022-11-16 +### Added +- Add support to mainnet-4 +### Fixed +- Bug where deployments did not close when no bids were made + ## [0.0.5] - 2022-10-27 ### Added - Transaction memo stating the Terraform provider was used and which version diff --git a/Makefile b/Makefile index 7bdec9b..ddd2379 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ TEST?=$$(go list ./... | grep -v 'vendor') NAMESPACE=cloud NAME=akash BINARY=terraform-provider-${NAME} -VERSION=0.0.5 +VERSION=0.0.6 OS_ARCH=darwin_arm64 OS := $(shell uname -s | tr A-Z a-z) HOSTNAME := $(shell hostname) diff --git a/README.md b/README.md index e3cb7ae..224ce1b 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,8 @@ export AKASH_ACCOUNT_ADDRESS="$(./bin/akash keys show $AKASH_KEY_NAME -a)" export AKASH_NET="https://raw.githubusercontent.com/ovrclk/net/master/mainnet" export AKASH_VERSION="$(curl -s "$AKASH_NET/version.txt")" export AKASH_CHAIN_ID="$(curl -s "$AKASH_NET/chain-id.txt")" -export AKASH_NODE="http://akash.c29r3.xyz:80/rpc" +export AKASH_NODE="https://akash-rpc.polkachu.com:443" export AKASH_HOME="$(realpath ~/.akash)" -export AKASH_PATH="$(realpath ./bin/akash)" export TF_LOG_PROVIDER=DEBUG ``` diff --git a/akash/client/cli/cli.go b/akash/client/cli/cli.go index 22dd39c..80a9b0c 100644 --- a/akash/client/cli/cli.go +++ b/akash/client/cli/cli.go @@ -19,7 +19,7 @@ type AkashCliClient interface { func AkashCli(client AkashCliClient) AkashCommand { path := client.GetPath() if path == "" { - path = "akash" + path = "provider-services" } return AkashCommand{ diff --git a/akash/client/provider.go b/akash/client/provider.go index 46e0770..c029ef1 100644 --- a/akash/client/provider.go +++ b/akash/client/provider.go @@ -9,7 +9,7 @@ import ( func (ak *AkashClient) SendManifest(dseq string, provider string, manifestLocation string) (string, error) { - cmd := cli.AkashCli(ak).Provider().SendManifest(manifestLocation). + cmd := cli.AkashCli(ak).SendManifest(manifestLocation). SetDseq(dseq).SetProvider(provider).SetHome(ak.Config.Home). SetKeyringBackend(ak.Config.KeyringBackend).SetFrom(ak.Config.KeyName). SetNode(ak.Config.Node).OutputJson() @@ -26,7 +26,7 @@ func (ak *AkashClient) SendManifest(dseq string, provider string, manifestLocati func (ak *AkashClient) GetLeaseStatus(seqs Seqs, provider string) (*types.LeaseStatus, error) { - cmd := cli.AkashCli(ak).Provider().LeaseStatus(). + cmd := cli.AkashCli(ak).LeaseStatus(). SetHome(ak.Config.Home).SetDseq(seqs.Dseq).SetGseq(seqs.Gseq).SetOseq(seqs.Oseq). SetNode(ak.Config.Node).SetProvider(provider).SetFrom(ak.Config.KeyName) diff --git a/akash/provider.go b/akash/provider.go index 1de5148..4ebf505 100644 --- a/akash/provider.go +++ b/akash/provider.go @@ -70,7 +70,7 @@ func Provider() *schema.Provider { Path: { Type: schema.TypeString, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("AKASH_PATH", "akash"), + DefaultFunc: schema.EnvDefaultFunc("AKASH_PATH", "provider-services"), }, }, ResourcesMap: map[string]*schema.Resource{ @@ -121,7 +121,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{} akash := client.New(ctx, configuration) - akash.SetGlobalTransactionNote("Akash Terraform Provider - [provider=\"cloud-j-luna/akash\" version=\"0.0.5\"]") + akash.SetGlobalTransactionNote("Akash Terraform Provider") return akash, diags } diff --git a/akash/resource_deployment.go b/akash/resource_deployment.go index 74074cd..a506e95 100644 --- a/akash/resource_deployment.go +++ b/akash/resource_deployment.go @@ -136,6 +136,10 @@ func resourceDeploymentCreate(ctx context.Context, d *schema.ResourceData, m int bids, diagnostics := queryBids(ctx, akash, seqs) if diagnostics != nil { + tflog.Warn(ctx, "No bids on deployment") + if err := akash.DeleteDeployment(seqs.Dseq, akash.Config.AccountAddress); err != nil { + return append(diagnostics, diag.FromErr(err)...) + } return diagnostics }