Skip to content

Commit

Permalink
Merge pull request #741 from weaveworks/fix-type-info
Browse files Browse the repository at this point in the history
fix typeinfo suffix regression
  • Loading branch information
Chanwit Kaewkasi authored Jul 6, 2023
2 parents 881afcc + 73a2330 commit 5ad2fcd
Show file tree
Hide file tree
Showing 6 changed files with 585 additions and 66 deletions.
3 changes: 3 additions & 0 deletions api/typeinfo/type_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package typeinfo

const Suffix = "__type"
4 changes: 2 additions & 2 deletions controllers/tf_controller_outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"

eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"

"github.com/hashicorp/terraform-exec/tfexec"
"github.com/weaveworks/tf-controller/api/typeinfo"
infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2"
"github.com/weaveworks/tf-controller/runner"
"github.com/zclconf/go-cty/cty"
Expand Down Expand Up @@ -166,7 +166,7 @@ func (r *TerraformReconciler) writeOutput(ctx context.Context, terraform infrav1
data[outputOrAlias] = []byte(cv.AsString())
} else {
data[outputOrAlias] = outputMeta.Value
data[outputOrAlias+"__type"] = outputMeta.Type
data[outputOrAlias+typeinfo.Suffix] = outputMeta.Type
}
}

Expand Down
17 changes: 5 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
github.com/weaveworks/tf-controller/tfctl v0.0.0-00010101000000-000000000000
github.com/zclconf/go-cty v1.10.0
golang.org/x/net v0.10.0
google.golang.org/grpc v1.51.0
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.27.2
Expand Down Expand Up @@ -152,7 +152,7 @@ require (
github.com/shurcooL/githubv4 v0.0.0-20190718010115-4ba037080260 // indirect
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
Expand All @@ -173,7 +173,7 @@ require (
golang.org/x/tools v0.9.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand All @@ -198,13 +198,6 @@ replace (
// Fix CVE-2022-41723
golang.org/x/net => golang.org/x/net v0.7.0

// Fix CVE-2022-27664 v0.0.0-20220906165146-f3363e06e74c
// Fix CVE-2022-41721 v0.1.1-0.20221104162952-702349b0e862
// xx golang.org/x/net => golang.org/x/net v0.1.1-0.20221104162952-702349b0e862

// Fix CVE-2022-32149
// xx golang.org/x/text => golang.org/x/text v0.3.8

// Fix gnostic
// k8s.io/kubectl v0.23.2 => k8s.io/kubectl v0.26.1
// Fix CVE-2023-32731
google.golang.org/grpc => google.golang.org/grpc v1.53.0
)
Loading

0 comments on commit 5ad2fcd

Please sign in to comment.