Skip to content

Commit

Permalink
Crane provider for terraform.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemnmez committed Nov 25, 2024
1 parent bf09f51 commit 0636f7e
Show file tree
Hide file tree
Showing 11 changed files with 589 additions and 29 deletions.
3 changes: 1 addition & 2 deletions .vscode/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("//bzl:rules.bzl", "bazel_lint")

sh_test(
name = "test_tools_run",
size = "small",
srcs = ["test_tools_run.sh"],
data = [
"//:go.mod",
Expand All @@ -13,8 +14,6 @@ sh_test(
],
env = {
"GO_BINARY": "$(rlocationpath //sh/bin:go)",
"GOPACKAGESDRIVER_BINARY": "$(rlocationpath //sh/bin:gopackagesdriver)",
"GOIMPORTS_BINARY": "$(rlocationpath //sh/bin:goimports)",
"STATICCHECK_BINARY": "$(rlocationpath //sh/bin:staticcheck)",
"DLV_BINARY": "$(rlocationpath //sh/bin:dlv)",
},
Expand Down
8 changes: 5 additions & 3 deletions .vscode/testing/test_tools_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
# this is a hack because the go_bin_runner chdirs into BUILD_WORKING_DIRECTORY
# which may make sense in some contexts but does not make sense in a smoke test.
# https://github.com/bazelbuild/rules_go/blob/0a6311cdc4a643f9f99b8109c44773f4a295c60e/go/tools/go_bin_runner/main.go#L34
BUILD_WORKING_DIRECTORY="." $(rlocation $GO_BINARY) version
echo testing go...
GOMODCACHE=$TEST_TMPDIR/modcache HOME=$TEST_TMPDIR/home BUILD_WORKING_DIRECTORY="." $(rlocation $GO_BINARY) version

echo {} | $(rlocation $GOPACKAGESDRIVER_BINARY) builtin

$(rlocation $GOIMPORTS_BINARY)

echo testing staticcheck...
$(rlocation $STATICCHECK_BINARY) -version


echo testing dlv...
$(rlocation $DLV_BINARY) version
18 changes: 17 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go"
bazel_dep(name = "gazelle", version = "0.39.1", repo_name = "bazel_gazelle")

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.2")
go_sdk.download(version = "1.22.7")
use_repo(
go_sdk,
"go_toolchains",
Expand All @@ -124,7 +124,9 @@ use_repo(
"com_github_bazelbuild_buildtools",
"com_github_go_delve_delve",
"com_github_golang_protobuf",
"com_github_google_go_containerregistry",
"com_github_gorilla_websocket",
"com_github_hashicorp_terraform_plugin_framework",
"com_github_itchyny_gojq",
"com_github_oapi_codegen_oapi_codegen_v2",
"com_github_oapi_codegen_runtime",
Expand All @@ -138,6 +140,20 @@ use_repo(
bazel_dep(name = "rules_python_gazelle_plugin", version = "0.40.0")
bazel_dep(name = "aspect_rules_py", version = "1.0.0")

go_deps_with_disabled_proto_generation = [
"github.com/hashicorp/go-plugin",
]

[
go_deps.gazelle_override(
directives = [
"gazelle:go_generate_proto false",
],
path = path,
)
for path in go_deps_with_disabled_proto_generation
]

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
Expand Down
38 changes: 34 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@

module github.com/zemn-me/monorepo

go 1.22.2
go 1.22.7

toolchain go1.22.8

require (
github.com/bazelbuild/bazel-gazelle v0.39.1
github.com/bazelbuild/bazel-watcher v0.25.3
github.com/bazelbuild/buildtools v0.0.0-20240827154017-dd10159baa91
github.com/go-delve/delve v1.22.1
github.com/golang/protobuf v1.5.4
github.com/google/go-containerregistry v0.20.2
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/terraform-plugin-framework v1.13.0
github.com/itchyny/gojq v0.12.16
github.com/oapi-codegen/oapi-codegen/v2 v2.4.1
github.com/oapi-codegen/runtime v1.1.1
Expand All @@ -28,48 +32,74 @@ require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beevik/etree v1.4.1 // indirect
github.com/cilium/ebpf v0.11.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/cosiner/argv v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d // indirect
github.com/docker/cli v27.1.1+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fsnotify/fsevents v0.1.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getkin/kin-openapi v0.127.0 // indirect
github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/google/go-dap v0.11.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-plugin v1.6.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/terraform-plugin-go v0.25.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/yaml v0.3.1 // indirect
github.com/itchyny/timefmt-go v0.1.6 // indirect
github.com/jaschaephraim/lrserver v0.0.0-20171129202958-50d19f603f71 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartystreets/goconvey v1.8.0 // indirect
github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
go.starlark.net v0.0.0-20231101134539-556fd59b42f6 // indirect
golang.org/x/arch v0.6.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/tools/go/vcs v0.1.0-deprecated // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 0636f7e

Please sign in to comment.