removes EnableForcePush and other unrelated code

This commit is contained in:
Megan Bang 2022-09-02 14:49:25 -05:00
parent bce43faf2e
commit 72ba8a869e
2 changed files with 2 additions and 16 deletions

View File

@ -92,19 +92,13 @@ func (s *State) WriteStateForMigration(f *statefile.File, force bool) error {
}
}
// The remote backend needs to pass the `force` flag through to its client.
// For backends that support such operations, inform the client
// that a force push has been requested
if force {
s.EnableForcePush()
}
// We create a deep copy of the state here, because the caller also has
// a reference to the given object and can potentially go on to mutate
// it after we return, but we want the snapshot at this point in time.
s.state = f.State.DeepCopy()
s.lineage = f.Lineage
s.serial = f.Serial
s.forcePush = force
return nil
}
@ -136,6 +130,7 @@ func (s *State) WriteState(state *states.State) error {
// a reference to the given object and can potentially go on to mutate
// it after we return, but we want the snapshot at this point in time.
s.state = state.DeepCopy()
s.forcePush = false
return nil
}
@ -414,12 +409,6 @@ func (s *State) Delete() error {
return nil
}
// EnableForcePush to allow the remote client to overwrite state
// by implementing remote.ClientForcePusher
func (s *State) EnableForcePush() {
s.forcePush = true
}
// GetRootOutputValues fetches output values from Terraform Cloud
func (s *State) GetRootOutputValues() (map[string]*states.OutputValue, error) {
ctx := context.Background()

View File

@ -138,9 +138,6 @@ func metaOverridesForProvider(p providers.Interface) *testingOverrides {
Providers: map[addrs.Provider]providers.Factory{
addrs.NewDefaultProvider("test"): providers.FactoryFixed(p),
addrs.NewProvider(addrs.DefaultProviderRegistryHost, "hashicorp2", "test"): providers.FactoryFixed(p),
addrs.NewLegacyProvider("null"): providers.FactoryFixed(p),
addrs.NewLegacyProvider("azurerm"): providers.FactoryFixed(p),
addrs.NewProvider(addrs.DefaultProviderRegistryHost, "acmecorp", "aws"): providers.FactoryFixed(p),
},
}
}