Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 66bace3

Browse files
committed
state: add strings for cache refresh result
1 parent 6ec1b2b commit 66bace3

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

state/cache.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package state
22

33
import (
4+
"fmt"
45
"reflect"
56

67
"github.com/hashicorp/terraform/terraform"
@@ -189,3 +190,24 @@ const (
189190
// (Push/Pull)
190191
CacheRefreshConflict
191192
)
193+
194+
func (sc CacheRefreshResult) String() string {
195+
switch sc {
196+
case CacheRefreshNoop:
197+
return "Local and remote state in sync"
198+
case CacheRefreshInit:
199+
return "Local state initialized"
200+
case CacheRefreshUpdateLocal:
201+
return "Local state updated"
202+
case CacheRefreshUpdateRemote:
203+
return "Remote state updated"
204+
case CacheRefreshLocalNewer:
205+
return "Local state is newer than remote state, push required"
206+
case CacheRefreshRemoteNewer:
207+
return "Remote state is newer than local state, pull required"
208+
case CacheRefreshConflict:
209+
return "Local and remote state conflict, manual resolution required"
210+
default:
211+
return fmt.Sprintf("Unknown state change type: %d", sc)
212+
}
213+
}

0 commit comments

Comments
 (0)