@@ -94,15 +94,15 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe
94
94
"group_sync" : schema.SingleNestedBlock {
95
95
Attributes : map [string ]schema.Attribute {
96
96
"field" : schema.StringAttribute {
97
- Required : true ,
97
+ Optional : true ,
98
98
MarkdownDescription : "The claim field that specifies what groups " +
99
99
"a user should be in." ,
100
100
Validators : []validator.String {
101
101
stringvalidator .LengthAtLeast (1 ),
102
102
},
103
103
},
104
104
"regex" : schema.StringAttribute {
105
- Required : true ,
105
+ Optional : true ,
106
106
MarkdownDescription : "A regular expression that will be used to " +
107
107
"filter the groups returned by the OIDC provider. Any group " +
108
108
"not matched will be ignored." ,
@@ -111,21 +111,21 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe
111
111
},
112
112
},
113
113
"auto_create_missing" : schema.BoolAttribute {
114
- Required : true ,
114
+ Optional : true ,
115
115
MarkdownDescription : "Controls whether groups will be created if " +
116
116
"they are missing." ,
117
117
},
118
118
"mapping" : schema.MapAttribute {
119
119
ElementType : UUIDType ,
120
- Required : true ,
120
+ Optional : true ,
121
121
MarkdownDescription : "A map from OIDC group name to Coder group ID." ,
122
122
},
123
123
},
124
124
},
125
125
"role_sync" : schema.SingleNestedBlock {
126
126
Attributes : map [string ]schema.Attribute {
127
127
"field" : schema.StringAttribute {
128
- Required : true ,
128
+ Optional : true ,
129
129
MarkdownDescription : "The claim field that specifies what " +
130
130
"organization roles a user should be given." ,
131
131
Validators : []validator.String {
@@ -134,7 +134,7 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe
134
134
},
135
135
"mapping" : schema.MapAttribute {
136
136
ElementType : UUIDType ,
137
- Required : true ,
137
+ Optional : true ,
138
138
MarkdownDescription : "A map from OIDC group name to Coder " +
139
139
"organization role." ,
140
140
},
@@ -285,7 +285,7 @@ func (r *OrganizationResource) Update(ctx context.Context, req resource.UpdateRe
285
285
if data .GroupSync .IsNull () {
286
286
err = r .patchGroupSync (ctx , orgID , data .GroupSync )
287
287
if err != nil {
288
- resp .Diagnostics .AddError ("Group Sync Update error" , "uh oh john" )
288
+ resp .Diagnostics .AddError ("Group Sync Update error" , err . Error () )
289
289
return
290
290
}
291
291
}
0 commit comments