From 2ea808cae20ec655867e485d5c7fa2039626aba1 Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Sun, 7 Oct 2018 15:02:08 -0400 Subject: [PATCH] fix: Correct .data path layering edge case This patch set corrects logic for an edge case in layering where the action `path` is set to `.data`. In this case this means that the root of the data section should be used, i.e. '.' or '$.'. The previous adjustment was incorrect: .data was being changed to empty string ''. This fixes that logic to change to '.'. Change-Id: Id6cf0d4d65020220c540eb162a33055035336cde --- deckhand/engine/layering.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deckhand/engine/layering.py b/deckhand/engine/layering.py index 52c5aefb..e571607a 100644 --- a/deckhand/engine/layering.py +++ b/deckhand/engine/layering.py @@ -547,8 +547,13 @@ class DocumentLayering(object): child_data = {} action_path = action['path'] + if action_path.startswith('.data'): action_path = action_path[5:] + elif action_path.startswith('$.data'): + action_path = action_path[6:] + if not (action_path.startswith('.') or action_path.startswith('$.')): + action_path = '.' + action_path if method == self._DELETE_ACTION: if action_path == '.':