Skip to content

Commit c2f6fec

Browse files
committed
Add schema version
1 parent 9d0fc13 commit c2f6fec

File tree

8 files changed

+16
-0
lines changed

8 files changed

+16
-0
lines changed

provider/agent.go

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717

1818
func agentResource() *schema.Resource {
1919
return &schema.Resource{
20+
SchemaVersion: 1,
21+
2022
Description: "Use this resource to associate an agent.",
2123
CreateContext: func(_ context.Context, resourceData *schema.ResourceData, i interface{}) diag.Diagnostics {
2224
// This should be a real authentication token!

provider/app.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ var (
2525

2626
func appResource() *schema.Resource {
2727
return &schema.Resource{
28+
SchemaVersion: 1,
29+
2830
Description: "Use this resource to define shortcuts to access applications in a workspace.",
2931
CreateContext: func(c context.Context, resourceData *schema.ResourceData, i interface{}) diag.Diagnostics {
3032
resourceData.SetId(uuid.NewString())

provider/env.go

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
func envResource() *schema.Resource {
1414
return &schema.Resource{
15+
SchemaVersion: 1,
16+
1517
Description: `Use this resource to set an environment variable in a workspace. Note that this resource cannot be used to overwrite existing environment variables set on the "coder_agent" resource.`,
1618
CreateContext: func(_ context.Context, rd *schema.ResourceData, _ interface{}) diag.Diagnostics {
1719
rd.SetId(uuid.NewString())

provider/externalauth.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
// externalAuthDataSource returns a schema for an external authentication data source.
1414
func externalAuthDataSource() *schema.Resource {
1515
return &schema.Resource{
16+
SchemaVersion: 1,
17+
1618
Description: "Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to pre-authenticate external services in a workspace. (e.g. gcloud, gh, docker, etc)",
1719
ReadContext: func(ctx context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics {
1820
id, ok := rd.Get("id").(string)

provider/provisioner.go

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111

1212
func provisionerDataSource() *schema.Resource {
1313
return &schema.Resource{
14+
SchemaVersion: 1,
15+
1416
Description: "Use this data source to get information about the Coder provisioner.",
1517
ReadContext: func(c context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics {
1618
rd.SetId(uuid.NewString())

provider/script.go

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var ScriptCRONParser = cron.NewParser(cron.Second | cron.Minute | cron.Hour | cr
1515

1616
func scriptResource() *schema.Resource {
1717
return &schema.Resource{
18+
SchemaVersion: 1,
19+
1820
Description: "Use this resource to run a script from an agent.",
1921
CreateContext: func(_ context.Context, rd *schema.ResourceData, _ interface{}) diag.Diagnostics {
2022
rd.SetId(uuid.NewString())

provider/workspace.go

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import (
1515

1616
func workspaceDataSource() *schema.Resource {
1717
return &schema.Resource{
18+
SchemaVersion: 1,
19+
1820
Description: "Use this data source to get information for the active workspace build.",
1921
ReadContext: func(c context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics {
2022
transition := helpers.OptionalEnvOrDefault("CODER_WORKSPACE_TRANSITION", "start") // Default to start!

provider/workspace_tags.go

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type WorkspaceTags struct {
1414

1515
func workspaceTagDataSource() *schema.Resource {
1616
return &schema.Resource{
17+
SchemaVersion: 1,
18+
1719
Description: "Use this data source to configure workspace tags to select provisioners.",
1820
ReadContext: func(ctx context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics {
1921
rd.SetId(uuid.NewString())

0 commit comments

Comments
 (0)