Skip to content

Commit 4897e9e

Browse files
committed
feat: a good start
1 parent 7daf54b commit 4897e9e

File tree

9 files changed

+393
-0
lines changed

9 files changed

+393
-0
lines changed

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.PHONY: build install test testacc
2+
3+
build:
4+
@go build -o terraform-provider-karpor
5+
6+
install: build
7+
@mkdir -p ~/.terraform.d/plugins/registry.terraform.io/KusionStack/karpor/0.1.0/darwin_amd64
8+
@mv terraform-provider-karpor ~/.terraform.d/plugins/registry.terraform.io/KusionStack/karpor/0.1.0/darwin_amd64
9+
10+
test:
11+
@go test -v ./...
12+
13+
testacc:
14+
@TF_ACC=1 go test -v ./...

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Terraform Provider for Karpor
2+
3+
A Terraform provider for managing cluster registration in Karpor
4+
5+
## Features
6+
7+
- ✅ Cluster Registration Management (`karpor_cluster_registration`)
8+
- ⏳ Cluster Health Monitoring (Under Development)
9+
- ⏳ Multi-Credential Support (Under Development)
10+
11+
## Installation
12+
13+
### Local Build & Install
14+
```bash
15+
make install # Install to ~/.terraform.d/plugins
16+
```
17+
18+
### Terraform Configuration
19+
```hcl
20+
terraform {
21+
required_providers {
22+
karpor = {
23+
source = "KusionStack/karpor"
24+
version = "0.1.0"
25+
}
26+
}
27+
}
28+
29+
provider "karpor" {
30+
api_endpoint = "https://api.karpor.example.com"
31+
api_key = "<your-api-key>" # Recommend using environment variables
32+
}
33+
```
34+
35+
## Usage Example
36+
```hcl
37+
resource "karpor_cluster_registration" "production" {
38+
cluster_name = "production-cluster"
39+
api_server_url = "https://k8s.example.com"
40+
credentials = file("~/.kube/config")
41+
description = "Primary production cluster"
42+
}
43+
```
44+
45+
## Development Guide
46+
47+
### Requirements
48+
- Go 1.21+
49+
- Terraform 1.5+
50+
51+
### Common Commands
52+
```bash
53+
make build # Build provider
54+
make test # Run unit tests
55+
make testacc # Run acceptance tests (requires API credentials)
56+
```
57+
58+
### Test Configuration
59+
Set environment variables before testing:
60+
```bash
61+
export KARPOR_ENDPOINT="https://api.karpor.example.com"
62+
export KARPOR_API_KEY="your-api-key"
63+
```
64+
65+
## Contributing
66+
1. Create an issue describing the problem or feature request
67+
2. Develop on a feature branch (feature/xxx)
68+
3. Submit a PR with test cases
69+
4. Pass CI pipeline verification
70+
71+
## License
72+
Mozilla Public License 2.0, see [LICENSE](LICENSE)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# karpor_cluster_registration
2+
3+
Register and manage Kubernetes clusters in Karpor
4+
5+
## Example Usage
6+
7+
```hcl
8+
resource "karpor_cluster_registration" "example" {
9+
cluster_name = "production-cluster"
10+
api_server_url = "https://kubernetes.example.com"
11+
credentials = file("~/.kube/config")
12+
description = "Production Kubernetes cluster"
13+
}
14+
```
15+
16+
## Argument Reference
17+
18+
- `cluster_name` (Required) - Unique name for the cluster
19+
- `api_server_url` (Required) - Kubernetes API server URL
20+
- `credentials` (Required) - Path to kubeconfig file
21+
- `description` (Optional) - Human-readable description
22+
23+
## Attributes Reference
24+
25+
- `id` - Unique identifier for the registration
26+
- `registration_time` - Timestamp of registration
27+
- `health_status` - Current cluster health status

examples/provider/provider.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
terraform {
2+
required_providers {
3+
karpor = {
4+
source = "KusionStack/karpor"
5+
version = "0.1.0"
6+
}
7+
}
8+
}
9+
10+
provider "karpor" {
11+
api_endpoint = "https://api.karpor.example.com"
12+
api_key = "your-api-key-here"
13+
}
14+
15+
resource "karpor_cluster_registration" "example" {
16+
cluster_name = "production-cluster"
17+
api_server_url = "https://kubernetes.example.com"
18+
credentials = file("~/.kube/config")
19+
description = "Production Kubernetes cluster"
20+
}

go.mod

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module github.com/KusionStack/terraform-provider-karpor
2+
3+
go 1.21
4+
5+
require github.com/hashicorp/terraform-plugin-framework v1.5.0
6+
7+
require (
8+
github.com/fatih/color v1.13.0 // indirect
9+
github.com/golang/protobuf v1.5.3 // indirect
10+
github.com/hashicorp/go-hclog v1.5.0 // indirect
11+
github.com/hashicorp/go-plugin v1.6.0 // indirect
12+
github.com/hashicorp/go-uuid v1.0.3 // indirect
13+
github.com/hashicorp/terraform-plugin-go v0.20.0 // indirect
14+
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
15+
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
16+
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
17+
github.com/hashicorp/yamux v0.1.1 // indirect
18+
github.com/mattn/go-colorable v0.1.13 // indirect
19+
github.com/mattn/go-isatty v0.0.16 // indirect
20+
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
21+
github.com/oklog/run v1.0.0 // indirect
22+
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
23+
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
24+
golang.org/x/net v0.17.0 // indirect
25+
golang.org/x/sys v0.13.0 // indirect
26+
golang.org/x/text v0.13.0 // indirect
27+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
28+
google.golang.org/grpc v1.60.0 // indirect
29+
google.golang.org/protobuf v1.31.0 // indirect
30+
)

go.sum

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
2+
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
3+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
5+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6+
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
7+
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
8+
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
9+
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
10+
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
11+
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
12+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
13+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
14+
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
15+
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
16+
github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A=
17+
github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI=
18+
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
19+
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
20+
github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg=
21+
github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc=
22+
github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ=
23+
github.com/hashicorp/terraform-plugin-go v0.20.0/go.mod h1:Rr8LBdMlY53a3Z/HpP+ZU3/xCDqtKNCkeI9qOyT10QE=
24+
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
25+
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
26+
github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI=
27+
github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM=
28+
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
29+
github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc=
30+
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
31+
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
32+
github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c=
33+
github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo=
34+
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
35+
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
36+
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
37+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
38+
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
39+
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
40+
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
41+
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
42+
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
43+
github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
44+
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
45+
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
46+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
47+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
48+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
49+
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
50+
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
51+
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
52+
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
53+
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
54+
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
55+
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
56+
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
57+
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
58+
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
59+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
60+
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
61+
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
62+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
63+
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
64+
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
65+
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
66+
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
67+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
68+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0=
69+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY=
70+
google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k=
71+
google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
72+
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
73+
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
74+
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
75+
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
76+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
77+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
78+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package provider
2+
3+
import (
4+
"context"
5+
"fmt"
6+
7+
"github.com/hashicorp/terraform-plugin-framework/resource"
8+
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
9+
"github.com/hashicorp/terraform-plugin-framework/types"
10+
)
11+
12+
type ClusterRegistrationResource struct {
13+
client *KarporClient
14+
}
15+
16+
func NewClusterRegistrationResource() resource.Resource {
17+
return &ClusterRegistrationResource{}
18+
}
19+
20+
func (r *ClusterRegistrationResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
21+
resp.TypeName = req.ProviderTypeName + "_cluster_registration"
22+
}
23+
24+
func (r *ClusterRegistrationResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
25+
resp.Schema = schema.Schema{
26+
Attributes: map[string]schema.Attribute{
27+
"cluster_name": schema.StringAttribute{
28+
Required: true,
29+
Description: "Unique name for the cluster",
30+
},
31+
"api_server_url": schema.StringAttribute{
32+
Required: true,
33+
Description: "Kubernetes API server URL",
34+
},
35+
"credentials": schema.StringAttribute{
36+
Required: true,
37+
Sensitive: true,
38+
Description: "Path to kubeconfig file",
39+
},
40+
"description": schema.StringAttribute{
41+
Optional: true,
42+
Description: "Human-readable description",
43+
},
44+
"id": schema.StringAttribute{
45+
Computed: true,
46+
Description: "Unique identifier",
47+
},
48+
},
49+
}
50+
}
51+
52+
// 实现Create/Read/Update/Delete方法(根据实际API补充实现)

internal/provider/provider.go

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package provider
2+
3+
import (
4+
"context"
5+
"fmt"
6+
7+
"github.com/hashicorp/terraform-plugin-framework/datasource"
8+
"github.com/hashicorp/terraform-plugin-framework/provider"
9+
"github.com/hashicorp/terraform-plugin-framework/provider/schema"
10+
"github.com/hashicorp/terraform-plugin-framework/resource"
11+
"github.com/hashicorp/terraform-plugin-framework/types"
12+
)
13+
14+
type KarporProvider struct {
15+
version string
16+
}
17+
18+
func New() provider.Provider {
19+
return &KarporProvider{}
20+
}
21+
22+
func (p *KarporProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse) {
23+
resp.TypeName = "karpor"
24+
resp.Version = p.version
25+
}
26+
27+
func (p *KarporProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {
28+
resp.Schema = schema.Schema{
29+
Attributes: map[string]schema.Attribute{
30+
"api_endpoint": schema.StringAttribute{
31+
Optional: true,
32+
Description: "Karpor API endpoint URL",
33+
},
34+
"api_key": schema.StringAttribute{
35+
Optional: true,
36+
Sensitive: true,
37+
Description: "API key for authentication",
38+
},
39+
},
40+
}
41+
}
42+
43+
func (p *KarporProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
44+
var config providerData
45+
diags := req.Config.Get(ctx, &config)
46+
resp.Diagnostics.Append(diags...)
47+
if resp.Diagnostics.HasError() {
48+
return
49+
}
50+
51+
// TODO: Initialize API client with config
52+
resp.DataSourceData = config
53+
resp.ResourceData = config
54+
}
55+
56+
func (p *KarporProvider) Resources(_ context.Context) []func() resource.Resource {
57+
return []func() resource.Resource{
58+
NewClusterRegistrationResource,
59+
}
60+
}
61+
62+
func (p *KarporProvider) DataSources(_ context.Context) []func() datasource.DataSource {
63+
return []func() datasource.DataSource{
64+
// TODO: Add data sources
65+
}
66+
}
67+
68+
type providerData struct {
69+
ApiEndpoint types.String `tfsdk:"api_endpoint"`
70+
ApiKey types.String `tfsdk:"api_key"`
71+
}

0 commit comments

Comments
 (0)