-
Notifications
You must be signed in to change notification settings - Fork 24
port_mapping.name, port_definition.[name|lables], health_check.port a… #65
base: master
Are you sure you want to change the base?
Conversation
…nd volume.external are added
I try to resolve this test case, but the test is posting a json definition with |
The test that @cihangirbesiktas mentioned is now fixed but we have another problem:
The instance of marathon that we are using doesn't have |
Thanks @calvernaz |
The failing test has wrong expectations but I'm not sure where to fix it. The expected value is wrong. |
marathon/resource_marathon_app.go
Outdated
@@ -1163,6 +1237,11 @@ func mutateResourceToApplication(d *schema.ResourceData) *marathon.Application { | |||
} | |||
} | |||
|
|||
if prop, ok := mapStruct["port"]; ok { | |||
prop := prop.(int) | |||
healthCheck.Port = &prop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always set port to 0, which is wrong in case you're using portIndex.
I'd suggest to add an conditional to check if it's greater than 0.
if prop, ok := mapStruct["port"]; ok {
prop := prop.(int)
if prop > 0 {
healthCheck.Port = &prop
}
}
--- FAIL: TestAccMarathonApp_basic (5.76s)
I did not change upgradeStrategy but getting this error, it seems the test env is not set up properly, I could not find out the problem but it would be better if it is fixed. |
@cihangirbesiktas I believe this happens because you've external volume attached in example.tf. In such case, upgrade strategy has to be set to 0, because Marathon cannot start an additional task (since volume can be mounted to only one task). |
@kamsz but when I set the maximum over capacity to 0.0, I got the following error: --- FAIL: TestAccMarathonApp_basic (5.05s)
|
maybe @nicgrayson could give us a hand here? |
I found out that schema.ResourceData.GetOk function returns false when the value of a key is zero, but we need the zero value in /upgradeStrategy/maximumOverCapacity. There is another function schema.ResourceData.GetOkExists which returns true regardless of zero value, but it is in the latest repo of github.com/hashicorp/terraform/helper/schema. Could @nicgrayson update the repos? |
…nd volume.external are added