Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_container_group - adding restart_policy #827

Merged
merged 7 commits into from
Feb 15, 2018

Conversation

metacpp
Copy link
Contributor

@metacpp metacpp commented Feb 13, 2018

This change enables restart_policy for container instances running in the container group.

Test result at 2018-02-15:
=== RUN TestAccAzureRMContainerGroup_windowsComplete
--- PASS: TestAccAzureRMContainerGroup_windowsComplete (71.23s)
PASS
=== RUN TestAccAzureRMContainerGroup_windowsBasic
--- PASS: TestAccAzureRMContainerGroup_windowsBasic (71.39s)
PASS
=== RUN TestAccAzureRMContainerGroup_linuxBasic
--- PASS: TestAccAzureRMContainerGroup_linuxBasic (73.26s)
PASS
=== RUN TestAccAzureRMContainerGroup_linuxBasicUpdate
--- PASS: TestAccAzureRMContainerGroup_linuxBasicUpdate (87.33s)
PASS
=== RUN TestAccAzureRMContainerGroup_linuxComplete
--- PASS: TestAccAzureRMContainerGroup_linuxComplete (119.41s)
PASS
ok ../azurerm/test-azurerm 119.423s

@tombuildsstuff
Copy link
Contributor

Depends on #830

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @metacpp

Thanks for this PR - I've taken a look through and this mostly LGTM, if we can fix up the minor issues this should be good to merge.

Thanks!

@@ -41,6 +41,7 @@ resource "azurerm_container_group" "aci-helloworld" {
resource_group_name = "${azurerm_resource_group.aci-rg.name}"
ip_address_type = "public"
os_type = "linux"
restart_policy = "Always"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor since this is defaulted, I don't think we need to specify it in the example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@@ -43,8 +43,8 @@
"versionExact": "v12.5.0-beta"
},
{
"checksumSHA1": "e8WF/zKkHC6sKeiPaP+ulB/NSq4=",
"path": "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2017-08-01-preview/containerinstance",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the old API version from the vendor directory too, since it should be unused now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@@ -139,6 +140,7 @@ func TestAccAzureRMContainerGroup_windowsComplete(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "container.0.environment_variables.foo", "bar"),
resource.TestCheckResourceAttr(resourceName, "container.0.environment_variables.foo1", "bar1"),
resource.TestCheckResourceAttr(resourceName, "os_type", "Windows"),
resource.TestCheckResourceAttr(resourceName, "restart_policy", "OnFailure"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this Never to be able to test that setting is valid? (since Always and OnFailure are tested above, implicitly and explicitly respectively)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@metacpp
Copy link
Contributor Author

metacpp commented Feb 15, 2018

@tombuildsstuff updated.

@tombuildsstuff tombuildsstuff modified the milestones: 1.1.3, 1.1.2 Feb 15, 2018
@tombuildsstuff
Copy link
Contributor

Tests pass:

screen shot 2018-02-15 at 14 14 25

@tombuildsstuff tombuildsstuff changed the title Add restart policy for container group azurerm_container_group - adding restart_policy Feb 15, 2018
@tombuildsstuff tombuildsstuff merged commit ba38596 into master Feb 15, 2018
@tombuildsstuff tombuildsstuff deleted the hack_container_group branch February 15, 2018 22:17
tombuildsstuff added a commit that referenced this pull request Feb 15, 2018
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants