bookingcom / shipper

Kubernetes native multi-cluster canary or blue-green rollouts using Helm
Apache License 2.0
733 stars 39 forks source link

Fixed out-of-range index dereferencing error in release controller #283

Closed osdrv closed 4 years ago

osdrv commented 4 years ago

This commit fixes a problem where a corresponding release strategy was resolved twice: once for an actual execution and second time for reporting. These resolutions were happening in distinct places: the 1st one in strategy executor, the latter in release controller. As a result, the release controller one was causing a panic as it was not taking into account the updated logic of strategy resolution where an incumbent is supposed to look ahead and use it's successor's strategy, and the index validity was only happening in strategy executor, which was calculating the desired strategy correctly. This commit is also moving things around: strategy executor is being initialized with a specific strategy and a pointer to the target step and Execute() step takes the sequence of executable releases as arguments.

Signed-off-by: Oleg Sidorov oleg.sidorov@booking.com