Skip to content

Commit b0d8426

Browse files
committed
fix: handle omni loc name tag deprecation
1 parent a57dc44 commit b0d8426

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

castai/resource_edge_location.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ type awsModel struct {
6161
VpcID types.String `tfsdk:"vpc_id"`
6262
SecurityGroupID types.String `tfsdk:"security_group_id"`
6363
SubnetIDs types.Map `tfsdk:"subnet_ids"`
64-
NameTag types.String `tfsdk:"name_tag"`
6564
}
6665

6766
type gcpModel struct {
@@ -94,8 +93,7 @@ func (m awsModel) Equal(other *awsModel) bool {
9493
return m.AccountID.Equal(other.AccountID) &&
9594
m.VpcID.Equal(other.VpcID) &&
9695
m.SecurityGroupID.Equal(other.SecurityGroupID) &&
97-
m.SubnetIDs.Equal(other.SubnetIDs) &&
98-
m.NameTag.Equal(other.NameTag)
96+
m.SubnetIDs.Equal(other.SubnetIDs)
9997
}
10098

10199
func (m gcpModel) credentials() types.String {
@@ -249,8 +247,9 @@ func (r *edgeLocationResource) Schema(_ context.Context, _ resource.SchemaReques
249247
Description: "Map of zone names to subnet IDs to be used in the selected region",
250248
},
251249
"name_tag": schema.StringAttribute{
252-
Required: true,
253-
Description: "The value of a 'Name' tag applied to VPC resources",
250+
Optional: true,
251+
Description: "The value of a 'Name' tag applied to VPC resources",
252+
DeprecationMessage: "Deprecated. Can be omitted",
254253
},
255254
},
256255
},
@@ -691,7 +690,6 @@ func (r *edgeLocationResource) toAWS(ctx context.Context, plan, config *awsModel
691690
VpcId: plan.VpcID.ValueString(),
692691
SecurityGroupId: plan.SecurityGroupID.ValueString(),
693692
SubnetIds: subnetMap,
694-
NameTag: plan.NameTag.ValueString(),
695693
},
696694
}
697695

@@ -709,15 +707,13 @@ func (r *edgeLocationResource) toAWSModel(ctx context.Context, config *omni.AWSP
709707
VpcID: types.StringNull(),
710708
SecurityGroupID: types.StringNull(),
711709
SubnetIDs: types.MapNull(types.StringType),
712-
NameTag: types.StringNull(),
713710
AccessKeyIDWO: types.StringNull(),
714711
SecretAccessKeyWO: types.StringNull(),
715712
}
716713

717714
if config.Networking != nil {
718715
aws.VpcID = types.StringValue(config.Networking.VpcId)
719716
aws.SecurityGroupID = types.StringValue(config.Networking.SecurityGroupId)
720-
aws.NameTag = types.StringValue(config.Networking.NameTag)
721717

722718
if config.Networking.SubnetIds != nil {
723719
subnetMap, d := types.MapValueFrom(ctx, types.StringType, config.Networking.SubnetIds)

castai/sdk/omni/api.gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)