Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions internal/rpcapi/stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,13 @@ func stackConfigMetaforProto(cfgNode *stackconfig.ConfigNode, stackAddr stackadd
}

// Currently Components are the only thing that can be removed
for name, rc := range cfgNode.Stack.Removed {
for name, rc := range cfgNode.Stack.Removed.All() {
var blocks []*stacks.FindStackConfigurationComponents_Removed_Block
for _, rc := range rc {
relativeAddress := rc.From.ConfigComponent()
cProto := &stacks.FindStackConfigurationComponents_Removed_Block{
SourceAddr: rc.FinalSourceAddr.String(),
ComponentAddr: stackaddrs.Config(stackAddr, stackaddrs.Component{Name: rc.FromComponent.Name}).String(),
ComponentAddr: stackaddrs.Config(append(stackAddr, relativeAddress.Stack...), relativeAddress.Item).String(),
Destroy: rc.Destroy,
}
switch {
Expand All @@ -255,7 +256,8 @@ func stackConfigMetaforProto(cfgNode *stackconfig.ConfigNode, stackAddr stackadd
}
blocks = append(blocks, cProto)
}
ret.Removed[name] = &stacks.FindStackConfigurationComponents_Removed{
relativeAddress := rc[0].From.ConfigComponent()
ret.Removed[name.String()] = &stacks.FindStackConfigurationComponents_Removed{
// in order to ensure as much backwards and forwards compatibility
// as possible, we're going to set the deprecated single fields
// with the first run block
Expand All @@ -269,7 +271,7 @@ func stackConfigMetaforProto(cfgNode *stackconfig.ConfigNode, stackAddr stackadd
return stacks.FindStackConfigurationComponents_SINGLE
}
}(),
ComponentAddr: stackaddrs.Config(stackAddr, stackaddrs.Component{Name: rc[0].FromComponent.Name}).String(),
ComponentAddr: stackaddrs.Config(append(stackAddr, relativeAddress.Stack...), relativeAddress.Item).String(),
Destroy: rc[0].Destroy,

// We return all the values here:
Expand Down
Loading