Skip to content

Commit 11d2ab5

Browse files
Copilottobio
andcommitted
Revert namespace usage in create/update operations to use space_id
Co-authored-by: tobio <[email protected]>
1 parent e5820b3 commit 11d2ab5

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

internal/kibana/synthetics/create.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ func (r *Resource) Create(ctx context.Context, request resource.CreateRequest, r
2626
return
2727
}
2828

29-
// Use namespace if explicitly set, otherwise fall back to space_id
30-
namespace := plan.Namespace.ValueString()
31-
if namespace == "" || plan.Namespace.IsNull() || plan.Namespace.IsUnknown() {
32-
namespace = plan.SpaceID.ValueString()
33-
}
29+
namespace := plan.SpaceID.ValueString()
3430

3531
result, err := kibanaClient.KibanaSynthetics.Monitor.Add(ctx, input.config, input.fields, namespace)
3632
if err != nil {

internal/kibana/synthetics/update.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ func (r *Resource) Update(ctx context.Context, request resource.UpdateRequest, r
3333
return
3434
}
3535

36-
// Use namespace if explicitly set, otherwise fall back to space_id
37-
namespace := plan.Namespace.ValueString()
38-
if namespace == "" || plan.Namespace.IsNull() || plan.Namespace.IsUnknown() {
39-
namespace = plan.SpaceID.ValueString()
40-
}
36+
namespace := plan.SpaceID.ValueString()
4137

4238
result, err := kibanaClient.KibanaSynthetics.Monitor.Update(ctx, kbapi.MonitorID(monitorId.ResourceId), input.config, input.fields, namespace)
4339
if err != nil {

0 commit comments

Comments
 (0)