• Timofey Kirillov's avatar
    Fix `no RESOURCE with the name NAME found` · 5ffe4ce5
    Timofey Kirillov authored
    This is the fix for only one particular, but important case.
    
    The case when a new resource has been added to the chart and
    there is an error in the chart, which leads to release failure.
    In this case after first failed release upgrade new resource will be
    created in the cluster. On the next release upgrade there will be the error:
    `no RESOURCE with the name NAME found` for this newly created resource
    from the previous release upgrade.
    
    The root of this problem is in the side effect of the first release process,
    Release invariant says: if resouce exists in the kubernetes cluster, then
    it should exist in the release storage. But this invariant has been broken
    by helm itself -- because helm created new resources as side effect and not
    adopted them into release storage.
    
    To maintain release invariant for such case during release upgrade operation
    all newly *successfully* created resources will be deleted in the case
    of an error in the subsequent resources update.
    
    This behaviour will be enabled only when `--cleanup-on-fail` option used
    for `helm upgrade` or `helm rollback`.
    Signed-off-by: 's avatarTimofey Kirillov <timofey.kirillov@flant.com>
    5ffe4ce5
release_server_test.go 27.7 KB