Skip to content

Commit

Permalink
backport of commit fedb13a
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcervante committed Jun 30, 2022
1 parent b20c016 commit 81e1a6a
Show file tree
Hide file tree
Showing 114 changed files with 2,398 additions and 4,556 deletions.
123 changes: 97 additions & 26 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ func initCommands(
ProviderSource: providerSrc,
ProviderDevOverrides: providerDevOverrides,
UnmanagedProviders: unmanagedProviders,

AllowExperimentalFeatures: ExperimentsAllowed(),
}

// The command list is included in the terraform -help
Expand Down
Binary file modified docs/images/resource-instance-change-lifecycle.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
294 changes: 0 additions & 294 deletions docs/planning-behaviors.md

This file was deleted.

406 changes: 93 additions & 313 deletions docs/resource-instance-change-lifecycle.md

Large diffs are not rendered by default.

23 changes: 0 additions & 23 deletions experiments.go

This file was deleted.

14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require (
cloud.google.com/go/storage v1.10.0
github.com/Azure/azure-sdk-for-go v59.2.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.24
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/Netflix/go-expect v0.0.0-20211003183012-e1a7c020ce25
github.com/agext/levenshtein v1.2.3
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1501
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70
Expand Down Expand Up @@ -43,9 +43,9 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.0
github.com/hashicorp/go-tfe v1.0.0
github.com/hashicorp/go-uuid v1.0.2
github.com/hashicorp/go-version v1.3.0
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f
github.com/hashicorp/hcl/v2 v2.13.0
github.com/hashicorp/hcl/v2 v2.12.0
github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
github.com/jmespath/go-jmespath v0.4.0
Expand Down Expand Up @@ -83,13 +83,13 @@ require (
github.com/zclconf/go-cty-yaml v1.0.2
go.etcd.io/etcd v0.5.0-alpha.5.0.20210428180535-15715dcf1ace
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
golang.org/x/text v0.3.7
golang.org/x/tools v0.1.11
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a
google.golang.org/api v0.44.0-impersonate-preview
google.golang.org/grpc v1.36.1
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
Expand Down Expand Up @@ -128,7 +128,6 @@ require (
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/coreos/go-semver v0.2.0 // indirect
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d // indirect
github.com/creack/pty v1.1.18 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dylanmei/iso8601 v0.1.0 // indirect
github.com/fatih/color v1.9.0 // indirect
Expand Down Expand Up @@ -156,6 +155,7 @@ require (
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/klauspost/compress v1.11.2 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/kr/pty v1.1.5 // indirect
github.com/manicminer/hamilton-autorest v0.2.0 // indirect
github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect
github.com/mattn/go-colorable v0.1.6 // indirect
Expand Down Expand Up @@ -206,4 +206,4 @@ replace github.com/golang/mock v1.5.0 => github.com/golang/mock v1.4.4
// replacement that includes a fix for CVE-2020-26160.
replace github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt v3.2.1+incompatible

go 1.18
go 1.17
88 changes: 76 additions & 12 deletions go.sum

Large diffs are not rendered by default.

128 changes: 0 additions & 128 deletions internal/addrs/map.go

This file was deleted.

83 changes: 0 additions & 83 deletions internal/addrs/map_test.go

This file was deleted.

32 changes: 8 additions & 24 deletions internal/addrs/set.go
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
package addrs

// Set represents a set of addresses of types that implement UniqueKeyer.
//
// Modify the set only by the methods on this type. This type exposes its
// internals for convenience during reading, such as iterating over set elements
// by ranging over the map values, but making direct modifications could
// potentially make the set data invalid or inconsistent, leading to undefined
// behavior elsewhere.
type Set[T UniqueKeyer] map[UniqueKey]T
type Set map[UniqueKey]UniqueKeyer

// Has returns true if and only if the set includes the given address.
func (s Set[T]) Has(addr T) bool {
func (s Set) Has(addr UniqueKeyer) bool {
_, exists := s[addr.UniqueKey()]
return exists
}

// Add inserts the given address into the set, if not already present. If
// an equivalent address is already in the set, this replaces that address
// with the new value.
func (s Set[T]) Add(addr T) {
func (s Set) Add(addr UniqueKeyer) {
s[addr.UniqueKey()] = addr
}

// Remove deletes the given address from the set, if present. If not present,
// this is a no-op.
func (s Set[T]) Remove(addr T) {
func (s Set) Remove(addr UniqueKeyer) {
delete(s, addr.UniqueKey())
}

// Union returns a new set which contains the union of all of the elements
// of both the reciever and the given other set.
func (s Set[T]) Union(other Set[T]) Set[T] {
ret := make(Set[T])
func (s Set) Union(other Set) Set {
ret := make(Set)
for k, addr := range s {
ret[k] = addr
}
Expand All @@ -41,10 +27,8 @@ func (s Set[T]) Union(other Set[T]) Set[T] {
return ret
}

// Intersection returns a new set which contains the intersection of all of the
// elements of both the reciever and the given other set.
func (s Set[T]) Intersection(other Set[T]) Set[T] {
ret := make(Set[T])
func (s Set) Intersection(other Set) Set {
ret := make(Set)
for k, addr := range s {
if _, exists := other[k]; exists {
ret[k] = addr
Expand Down
4 changes: 0 additions & 4 deletions internal/addrs/unique_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ type UniqueKey interface {
type UniqueKeyer interface {
UniqueKey() UniqueKey
}

func Equivalent[T UniqueKeyer](a, b T) bool {
return a.UniqueKey() == b.UniqueKey()
}

0 comments on commit 81e1a6a

Please sign in to comment.