Skip to content

Commit 629b6dc

Browse files
authored
Merge pull request #31733 from hashicorp/megan_pr_touch_up
removes EnableForcePush and other unrelated code
2 parents bce43fa + 72ba8a8 commit 629b6dc

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

internal/cloud/state.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,13 @@ func (s *State) WriteStateForMigration(f *statefile.File, force bool) error {
9292
}
9393
}
9494

95-
// The remote backend needs to pass the `force` flag through to its client.
96-
// For backends that support such operations, inform the client
97-
// that a force push has been requested
98-
if force {
99-
s.EnableForcePush()
100-
}
101-
10295
// We create a deep copy of the state here, because the caller also has
10396
// a reference to the given object and can potentially go on to mutate
10497
// it after we return, but we want the snapshot at this point in time.
10598
s.state = f.State.DeepCopy()
10699
s.lineage = f.Lineage
107100
s.serial = f.Serial
101+
s.forcePush = force
108102

109103
return nil
110104
}
@@ -136,6 +130,7 @@ func (s *State) WriteState(state *states.State) error {
136130
// a reference to the given object and can potentially go on to mutate
137131
// it after we return, but we want the snapshot at this point in time.
138132
s.state = state.DeepCopy()
133+
s.forcePush = false
139134

140135
return nil
141136
}
@@ -414,12 +409,6 @@ func (s *State) Delete() error {
414409
return nil
415410
}
416411

417-
// EnableForcePush to allow the remote client to overwrite state
418-
// by implementing remote.ClientForcePusher
419-
func (s *State) EnableForcePush() {
420-
s.forcePush = true
421-
}
422-
423412
// GetRootOutputValues fetches output values from Terraform Cloud
424413
func (s *State) GetRootOutputValues() (map[string]*states.OutputValue, error) {
425414
ctx := context.Background()

internal/command/command_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ func metaOverridesForProvider(p providers.Interface) *testingOverrides {
138138
Providers: map[addrs.Provider]providers.Factory{
139139
addrs.NewDefaultProvider("test"): providers.FactoryFixed(p),
140140
addrs.NewProvider(addrs.DefaultProviderRegistryHost, "hashicorp2", "test"): providers.FactoryFixed(p),
141-
addrs.NewLegacyProvider("null"): providers.FactoryFixed(p),
142-
addrs.NewLegacyProvider("azurerm"): providers.FactoryFixed(p),
143-
addrs.NewProvider(addrs.DefaultProviderRegistryHost, "acmecorp", "aws"): providers.FactoryFixed(p),
144141
},
145142
}
146143
}

0 commit comments

Comments
 (0)