giantswarm / endpoint-operator

Apache License 2.0
2 stars 1 forks source link

Add check for empty addresses #16

Closed MarcelMue closed 6 years ago

MarcelMue commented 6 years ago

This check is necessary as Update on a k8s endpoint is not allowed if the list of addresses and notReadyAddresses is empty. This is always the case here if addresses is empty as we don't use notReadyAddresses. Therefore the whole endpoint has to be deleted.

The unit test for this case only checks if the execution of ProcessDelete is without any errors. The k8s fake client does not seem to execute the validation checks of the k8s api.

The specific check that caused this addition can be found here: https://github.com/kubernetes/kubernetes/blob/20a1a647f363589eed2c31b90a98f4f269b3b94b/pkg/api/validation/validation.go#L4318

MarcelMue commented 6 years ago

I am tracking this in #12 and want to prio it in today's planning. I fully agree that this should be done, this PR here is just trying to fix errors from occurring during deletion.

xh3b4sd commented 6 years ago

AFAIK in the i vs i+1 war i won and we count/reference to test cases starting at 0. This can be boyscouted (this is a word now :D) over time.

+1 on the e2e tests. We have to do this for other projects as well. I think this will be done over time as well.

MarcelMue commented 6 years ago

I added issues #17 and #18 so I don't forget to do this. Merging here now.