terraform-provider-marathon icon indicating copy to clipboard operation
terraform-provider-marathon copied to clipboard

port_mapping.name, port_definition.[name|lables], health_check.port a…

Open cihangirbesiktas opened this issue 7 years ago • 9 comments

…nd volume.external are added

cihangirbesiktas avatar Aug 02 '17 12:08 cihangirbesiktas

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.

cihangirbesiktas avatar Aug 02 '17 14:08 cihangirbesiktas

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?

luisdavim avatar Aug 09 '17 16:08 luisdavim

Thanks @calvernaz

luisdavim avatar Aug 09 '17 20:08 luisdavim

The failing test has wrong expectations but I'm not sure where to fix it. The expected value is wrong.

calvernaz avatar Aug 09 '17 20:08 calvernaz

--- 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 avatar Aug 22 '17 09:08 cihangirbesiktas

@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 avatar Aug 22 '17 09:08 kamsz

@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)

cihangirbesiktas avatar Aug 22 '17 10:08 cihangirbesiktas

maybe @nicgrayson could give us a hand here?

luisdavim avatar Aug 22 '17 13:08 luisdavim

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?

cihangirbesiktas avatar Aug 23 '17 09:08 cihangirbesiktas