From 3e73c036fb0c07462c47668dfe604bf9c932842f Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Thu, 4 Nov 2021 19:32:11 +0000 Subject: [PATCH] Fix test for missing creates --- pkg/resource/deploy/deployment_executor.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/resource/deploy/deployment_executor.go b/pkg/resource/deploy/deployment_executor.go index 6c6cb1b99..5d992dcf9 100644 --- a/pkg/resource/deploy/deployment_executor.go +++ b/pkg/resource/deploy/deployment_executor.go @@ -267,6 +267,16 @@ func (ex *deploymentExecutor) Execute(callerCtx context.Context, opts Options, p res = ex.checkTargets(opts.UpdateTargets, OpUpdate) } + // Check that we did operations for everything expected in the plan. We mutate ResourcePlan.Ops as we run + // so by the time we get here everything in the map should have an empty ops list + if ex.deployment.plan != nil { + for urn, resourcePlan := range ex.deployment.plan { + if len(resourcePlan.Ops) != 0 { + return nil, result.Errorf("Expected resource operations for %v but none were seen.", urn) + } + } + } + if res != nil && res.IsBail() { return nil, res }