Skip to content

Commit

Permalink
Add parallel connections
Browse files Browse the repository at this point in the history
  • Loading branch information
littlejo committed Sep 28, 2024
1 parent ad17349 commit f23e7ae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 166 deletions.
8 changes: 8 additions & 0 deletions cilium/cluster_mesh_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listdefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-log/tflog"
Expand All @@ -41,6 +42,7 @@ type CiliumClusterMeshConnectResourceModel struct {
//SourceEndpoints types.List `tfsdk:"source_endpoint"`
//DestinationEndpoints types.List `tfsdk:"destination_endpoint"`
DestinationContexts types.List `tfsdk:"destination_contexts"`
Parallel types.Int64 `tfsdk:"parallel"`
ConnectionMode types.String `tfsdk:"connection_mode"`
Id types.String `tfsdk:"id"`
}
Expand Down Expand Up @@ -68,6 +70,12 @@ func (r *CiliumClusterMeshConnectResource) Schema(ctx context.Context, req resou
Computed: true,
Default: stringdefault.StaticString("bidirectional"),
},
"parallel": schema.Int64Attribute{
MarkdownDescription: ConcatDefault("Number of parallel connections of destination clusters", "1"),
Optional: true,
Computed: true,
Default: int64default.StaticInt64(1),
},
//"destination_endpoint": schema.ListAttribute{
// ElementType: types.StringType,
// MarkdownDescription: "IP of ClusterMesh service of destination cluster",
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ require (
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand Down Expand Up @@ -133,7 +132,6 @@ require (
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.13 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
Expand Down Expand Up @@ -236,3 +234,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/cilium/cilium => github.com/littlejo/cilium v0.0.0-20240925071401-dd6506321871
Loading

0 comments on commit f23e7ae

Please sign in to comment.