Open cihangirbesiktas opened 7 years ago
I try to resolve this test case, but the test is posting a json definition with container.volumes.volume.external = {}
when there is no external
in the definition that causes marathon api to produce error. The code is running in our environment without an error.
The test that @cihangirbesiktas mentioned is now fixed but we have another problem:
* marathon_app.app-create-example: Marathon API error: Object is not valid (path: '/upgradeStrategy/maximumOverCapacity' errors: got 0.3, expected 0.0; path: '/container/volumes(1)' errors: Feature external_volumes is not enabled. Enable with --enable_features external_volumes); path: '/container/portMappings(1)/name' errors: must fully match regular expression '^[a-z0-9-]+$')
The instance of marathon that we are using doesn't have --enable_features external_volumes
@nicgrayson any ideas on how to fix this?
Thanks @calvernaz
The failing test has wrong expectations but I'm not sure where to fix it. The expected value is wrong.
--- FAIL: TestAccMarathonApp_basic (5.76s) testing.go:268: Step 0 error: Error applying: 1 error(s) occurred:
* marathon_app.app-create-example: 1 error(s) occurred:
* marathon_app.app-create-example: Marathon API error: Object is not valid (path: '/upgradeStrategy/maximumOverCapacity' errors: got 0.3, expected 0.0)
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) testing.go:268: Step 0 error: Error applying: 1 error(s) occurred:
* marathon_app.app-create-example: 1 error(s) occurred:
* marathon_app.app-create-example: Marathon API error: Object is not valid (path: '/upgradeStrategy/maximumOverCapacity' errors: got 1.0, expected 0.0)
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