aerogearcatalog / sync-app-apb

Apache License 2.0
0 stars 3 forks source link

Service Instance gets labelled and sync_app_name gets saved to config map #8

Closed secondsun closed 5 years ago

secondsun commented 5 years ago

This does two things. First, it creates a mdcName label for the service instance with the sync_app_name. This is so we can have informative names in the mdc. Secondary, this stores the sync_app_name to a config map. This allows us to reference this value if provisioning fails.

For some reason, when provisioning fails, the _asb_provision_yadda_yadda field does not get populated correctly and this is a workaround.

psturc commented 5 years ago
TASK [provision-sync-app-apb : Config Map Template] ****************************
--
  | changed: [localhost]
  |  
  | TASK [provision-sync-app-apb : create configmap] *******************************
  | fatal: [localhost]: FAILED! => {"changed": true, "cmd": "oc create configmap -n \"apb-test-sync-app-apb-u72ha\" \"dummy_service_instance_id\" --from-file=/tmp/foo.yaml", "delta": "0:00:00.590270", "end": "2019-01-14 09:02:00.928765", "msg": "non-zero return code", "rc": 1, "start": "2019-01-14 09:02:00.338495", "stderr": "The ConfigMap \"dummy_service_instance_id\" is invalid: metadata.name: Invalid value: \"dummy_service_instance_id\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')", "stderr_lines": ["The ConfigMap \"dummy_service_instance_id\" is invalid: metadata.name: Invalid value: \"dummy_service_instance_id\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"], "stdout": "", "stdout_lines": []}
secondsun commented 5 years ago

@psturc Looks like the test value for _apb_service_instanceid should have had "-" instead of "" in it. (I think instance IDs are UUID's which don't have underscores)

psturc commented 5 years ago

@secondsun the test now fails because no service instance is actually present during the test. That's why there has to be so much workarounds for testing the apb 🙈

I would suggest to add some variable or use existing one that is specific to the test in vars/test.yml file and check if it exists here

secondsun commented 5 years ago

@psturc Ok, that is kind of what I was thinking. I wanted to check that there wasn't something more obvious to do :)

psturc commented 5 years ago

Hey @secondsun, I've checked that test now and it seems to have a problem with health check.

Unhealthy | Readiness probe failed: Get http://10.128.1.81:3000/: dial tcp 10.128.1.81:3000: getsockopt: connection refused7 times in the last minute

This worked before with port 3000, so I checked the example docker image we are using in the test and it looks like it's updated since yesterday.

@wojta , is this your new image you were working on? If so, what port should we use now?

psturc commented 5 years ago

@secondsun if you change the port number to 4000, it should work. See https://github.com/wojta/sync-server-app-basic-example/blob/master/Dockerfile#L6