remove legacyImportMode flag

pull/33932/head
James Bardin 3 years ago
parent 5128b21b55
commit 0c005ce484

@ -30,9 +30,8 @@ type ImportTarget struct {
// if the import did not originate in config.
Config *configs.Import
// Addr is the address for the resource instance that the new object should
// be imported into.
// TODO: remove
// LegacyAddr is the import address set from the command line arguments
// when using the import command.
LegacyAddr addrs.AbsResourceInstance
// ID is the ID of the resource to import. This is resource-specific.

@ -331,13 +331,6 @@ func (b *PlanGraphBuilder) initImport() {
// as the new state, and users are not expecting the import process
// to update any other instances in state.
skipRefresh: true,
// If we get here, we know that we are in legacy import mode, and
// that the user has run the import command rather than plan.
// This flag must be propagated down to the
// NodePlannableResourceInstance so we can ignore the new import
// behaviour.
legacyImportMode: true,
}
}
}

@ -205,7 +205,6 @@ func (n *nodeExpandPlannableResource) validateExpandedImportTargets() tfdiags.Di
for _, addr := range n.expandedImports {
if !n.expandedInstances.Has(addr) {
// FIXME
diags = diags.Append(fmt.Errorf("MISSING CONFIG FOR %s", addr))
}
}
@ -417,14 +416,12 @@ func (n *nodeExpandPlannableResource) resourceInstanceSubgraph(ctx EvalContext,
// If we're in legacy import mode (the import CLI command), we only need
// to return the import node, not a plannable resource node.
if n.legacyImportMode {
for _, importTarget := range n.importTargets {
if importTarget.LegacyAddr.Equal(a.Addr) {
return &graphNodeImportState{
Addr: importTarget.LegacyAddr,
ID: importTarget.idString,
ResolvedProvider: n.ResolvedProvider,
}
for _, importTarget := range n.importTargets {
if importTarget.LegacyAddr.Equal(a.Addr) {
return &graphNodeImportState{
Addr: importTarget.LegacyAddr,
ID: importTarget.idString,
ResolvedProvider: n.ResolvedProvider,
}
}
}

Loading…
Cancel
Save