Skip to content

Commit 7368939

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 6266d12 + f3a385d commit 7368939

File tree

2 files changed

+4
-54
lines changed

2 files changed

+4
-54
lines changed

internal/resource/service_deployment_model.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ type ServiceDeploymentPolicyBinding struct {
238238
}
239239

240240
type ServiceDeploymentSyncConfig struct {
241-
DiffNormalizer *ServiceDeploymentDiffNormalizer `tfsdk:"diff_normalizer"`
242241
NamespaceMetadata *ServiceDeploymentNamespaceMetadata `tfsdk:"namespace_metadata"`
243242
}
244243

@@ -248,38 +247,10 @@ func (this *ServiceDeploymentSyncConfig) Attributes() *gqlclient.SyncConfigAttri
248247
}
249248

250249
return &gqlclient.SyncConfigAttributes{
251-
DiffNormalizer: this.DiffNormalizer.Attributes(),
252250
NamespaceMetadata: this.NamespaceMetadata.Attributes(),
253251
}
254252
}
255253

256-
type ServiceDeploymentDiffNormalizer struct {
257-
Group types.String `tfsdk:"group"`
258-
JsonPatches types.Set `tfsdk:"json_patches"`
259-
Kind types.String `tfsdk:"kind"`
260-
Name types.String `tfsdk:"name"`
261-
Namespace types.String `tfsdk:"namespace"`
262-
}
263-
264-
func (this *ServiceDeploymentDiffNormalizer) Attributes() *gqlclient.DiffNormalizerAttributes {
265-
if this == nil {
266-
return nil
267-
}
268-
269-
jsonPatches := make([]types.String, len(this.JsonPatches.Elements()))
270-
this.JsonPatches.ElementsAs(context.Background(), &jsonPatches, false)
271-
272-
return &gqlclient.DiffNormalizerAttributes{
273-
Group: this.Group.ValueString(),
274-
Kind: this.Kind.ValueString(),
275-
Name: this.Name.ValueString(),
276-
Namespace: this.Namespace.ValueString(),
277-
JSONPatches: algorithms.Map(jsonPatches, func(v types.String) string {
278-
return v.ValueString()
279-
}),
280-
}
281-
}
282-
283254
type ServiceDeploymentNamespaceMetadata struct {
284255
Annotations types.Map `tfsdk:"annotations"`
285256
Labels types.Map `tfsdk:"labels"`

internal/resource/service_deployment_schema.go

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ func (r *ServiceDeploymentResource) schemaKustomize() schema.SingleNestedAttribu
8585
}
8686
}
8787

88-
func (r *ServiceDeploymentResource) schemaConfiguration() schema.ListNestedAttribute {
89-
return schema.ListNestedAttribute{
88+
func (r *ServiceDeploymentResource) schemaConfiguration() schema.SetNestedAttribute {
89+
return schema.SetNestedAttribute{
9090
Optional: true,
9191
Description: "List of [name, value] secrets used to alter this ServiceDeployment configuration.",
9292
MarkdownDescription: "List of [name, value] secrets used to alter this ServiceDeployment configuration.",
@@ -165,7 +165,7 @@ func (r *ServiceDeploymentResource) schemaBindings() schema.SingleNestedAttribut
165165
Description: "Read and write policies of this ServiceDeployment.",
166166
MarkdownDescription: "Read and write policies of this ServiceDeployment.",
167167
Attributes: map[string]schema.Attribute{
168-
"read": schema.ListNestedAttribute{
168+
"read": schema.SetNestedAttribute{
169169
Optional: true,
170170
Description: "Read policies of this ServiceDeployment.",
171171
MarkdownDescription: "Read policies of this ServiceDeployment.",
@@ -183,7 +183,7 @@ func (r *ServiceDeploymentResource) schemaBindings() schema.SingleNestedAttribut
183183
},
184184
},
185185
},
186-
"write": schema.ListNestedAttribute{
186+
"write": schema.SetNestedAttribute{
187187
Optional: true,
188188
Description: "Write policies of this ServiceDeployment.",
189189
MarkdownDescription: "Write policies of this ServiceDeployment.",
@@ -214,27 +214,6 @@ func (r *ServiceDeploymentResource) schemaSyncConfig() schema.SingleNestedAttrib
214214
Description: "Settings for advanced tuning of the sync process.",
215215
MarkdownDescription: "Settings for advanced tuning of the sync process.",
216216
Attributes: map[string]schema.Attribute{
217-
"diff_normalizer": schema.SingleNestedAttribute{
218-
Optional: true,
219-
Attributes: map[string]schema.Attribute{
220-
"group": schema.StringAttribute{
221-
Optional: true,
222-
},
223-
"json_patches": schema.SetAttribute{
224-
ElementType: types.StringType,
225-
Optional: true,
226-
},
227-
"kind": schema.StringAttribute{
228-
Optional: true,
229-
},
230-
"name": schema.StringAttribute{
231-
Optional: true,
232-
},
233-
"namespace": schema.StringAttribute{
234-
Optional: true,
235-
},
236-
},
237-
},
238217
"namespace_metadata": schema.SingleNestedAttribute{
239218
Optional: true,
240219
Attributes: map[string]schema.Attribute{

0 commit comments

Comments
 (0)