Skip to content

Commit

Permalink
linter changes and some test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed Aug 17, 2022
1 parent b00eb25 commit 625876f
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 384 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (r ContainerAppEnvironmentDaprComponentResource) Create() sdk.ResourceFunc

var daprComponent ContainerAppEnvironmentDaprComponentModel

if err := metadata.Decode(&daprComponent); err != err {
if err := metadata.Decode(&daprComponent); err != nil {
return err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package containerapps
import (
"context"
"fmt"
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2022-03-01/managedenvironments"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/utils"
"time"

"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/utils"
)

type ContainerAppEnvironmentDataSource struct{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package containerapps
import (
"context"
"fmt"
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2022-03-01/managedenvironmentsstorages"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/utils"
"time"

"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

type ContainerAppEnvironmentStorageResource struct{}
Expand Down
12 changes: 6 additions & 6 deletions internal/services/containerapps/container_app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package containerapps
import (
"context"
"fmt"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress"
"net/http"
"strings"
"time"
Expand All @@ -16,6 +15,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/containerapps/helpers"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/utils"
)
Expand All @@ -35,7 +35,7 @@ type ContainerAppModel struct {
Dapr []helpers.Dapr `tfschema:"dapr"`
Template []helpers.ContainerTemplate `tfschema:"template"`

//Identity identity.LegacySystemAndUserAssignedMap `tfschema:"identity"` // TODO - when the basics are working...
// Identity identity.LegacySystemAndUserAssignedMap `tfschema:"identity"` // TODO - when the basics are working...

Tags map[string]interface{} `tfschema:"tags"`

Expand Down Expand Up @@ -101,7 +101,7 @@ func (r ContainerAppResource) Arguments() map[string]*pluginsdk.Schema {

"dapr": helpers.ContainerDaprSchema(),

//"identity": commonschema.SystemAssignedUserAssignedIdentityOptional(),
// "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(),

"tags": commonschema.Tags(),
}
Expand Down Expand Up @@ -189,7 +189,7 @@ func (r ContainerAppResource) Create() sdk.ResourceFunc {
ManagedEnvironmentId: utils.String(app.ManagedEnvironmentId),
Template: helpers.ExpandContainerAppTemplate(app.Template, metadata),
},
//Identity: &app.Identity,
// Identity: &app.Identity,
Tags: tags.Expand(app.Tags),
}

Expand Down Expand Up @@ -234,7 +234,7 @@ func (r ContainerAppResource) Read() sdk.ResourceFunc {
if model := existing.Model; model != nil {
state.Location = model.Location
state.Tags = tags.Flatten(model.Tags)
//state.Identity = []identity.LegacySystemAndUserAssignedMap{*model.Identity}
// state.Identity = []identity.LegacySystemAndUserAssignedMap{*model.Identity}

if props := model.Properties; props != nil {
envId, err := managedenvironments.ParseManagedEnvironmentIDInsensitively(utils.NormalizeNilableString(props.ManagedEnvironmentId))
Expand All @@ -256,7 +256,7 @@ func (r ContainerAppResource) Read() sdk.ResourceFunc {
state.CustomDomainVerificationId = utils.NormalizeNilableString(props.CustomDomainVerificationId)
state.OutboundIpAddresses = *props.OutboundIPAddresses
}
//state.Identity = *model.Identity
// state.Identity = *model.Identity
}

secretsResp, err := client.ListSecrets(ctx, *id)
Expand Down
12 changes: 6 additions & 6 deletions internal/services/containerapps/container_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ func TestAccContainerAppResource_completeUpdate(t *testing.T) {
},
data.ImportStep(),
// TODO - Uncomment the following stages when https://github.com/Azure/azure-rest-api-specs/issues/19285 is resolved
//{
// {
// Config: r.complete(data, "rev3"),
// Check: acceptance.ComposeTestCheckFunc(
// check.That(data.ResourceName).ExistsInAzure(r),
// ),
//},
//data.ImportStep(),
//{
// },
// data.ImportStep(),
// {
// Config: r.completeUpdate2(data, "rev4"),
// Check: acceptance.ComposeTestCheckFunc(
// check.That(data.ResourceName).ExistsInAzure(r),
// ),
//},
//data.ImportStep(),
// },
// data.ImportStep(),
})
}

Expand Down
Loading

0 comments on commit 625876f

Please sign in to comment.