Skip to content

Commit

Permalink
fix: [BMS-948]: deprecate logo for Metal Orgs (#756)
Browse files Browse the repository at this point in the history
This is to deprecate logo from metal orgs since logo was sunset from
Metal API.
Jira link: https://equinixjira.atlassian.net/browse/BMS-948
  • Loading branch information
sbhatnagar-equinix authored Aug 19, 2024
2 parents 59af0b3 + 37e170f commit 58a8f6f
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/metal_organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ In addition to all arguments above, the following attributes are exported:
* `description` - Description string.
* `website` - Website link.
* `twitter` - Twitter handle.
* `logo` - Logo URL.
* `logo` - (Deprecated) Logo URL.
* `address` - Address information
* `address` - Postal address.
* `city` - City name.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/metal_organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The following arguments are supported:
* `description` - (Optional) Description string.
* `website` - (Optional) Website link.
* `twitter` - (Optional) Twitter handle.
* `logo` - (Optional) Logo URL.
* `logo` - (Deprecated) Logo URL.

### Address

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/equinix/terraform-provider-equinix
go 1.22

require (
github.com/equinix/equinix-sdk-go v0.42.0
github.com/equinix/equinix-sdk-go v0.43.0
github.com/equinix/ne-go v1.17.0
github.com/equinix/oauth2-go v1.0.0
github.com/equinix/rest-go v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/equinix/equinix-sdk-go v0.42.0 h1:jjgdFs0rx6nOwsu/dLh6ImopD0M1Rn7QIn9ZSMWzWUc=
github.com/equinix/equinix-sdk-go v0.42.0/go.mod h1:hEb3XLaedz7xhl/dpPIS6eOIiXNPeqNiVoyDrT6paIg=
github.com/equinix/equinix-sdk-go v0.43.0 h1:7i5x6aM1ZDVcIuAr1+yPNSDqsMp1Jye+kVQraGsOBBM=
github.com/equinix/equinix-sdk-go v0.43.0/go.mod h1:hEb3XLaedz7xhl/dpPIS6eOIiXNPeqNiVoyDrT6paIg=
github.com/equinix/ne-go v1.17.0 h1:+wZq0GNognpiTHTsBXtATOCphTFvnowF046NzQXj0n0=
github.com/equinix/ne-go v1.17.0/go.mod h1:eHkkxM4nbTB7DZ9X9zGnwfYnxIJWIsU3aHA+FAoZ1EI=
github.com/equinix/oauth2-go v1.0.0 h1:fHtAPGq82PdgtK5vEThs8Vwz6f7D/8SX4tE3NJu+KcU=
Expand Down
5 changes: 3 additions & 2 deletions internal/resources/metal/organization/datasource_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ func dataSourceSchema(ctx context.Context) schema.Schema {
Computed: true,
},
"logo": schema.StringAttribute{
Description: "Logo URL",
Computed: true,
DeprecationMessage: "Empty string is the only valid value. Support for this field has been removed from the API",
Description: "**Deprecated** Logo URL",
Computed: true,
},

"project_ids": schema.ListAttribute{
Expand Down
4 changes: 2 additions & 2 deletions internal/resources/metal/organization/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (m *ResourceModel) parse(ctx context.Context, org *packngo.Organization) di
m.Description = types.StringValue(org.Description)
m.Website = types.StringValue(org.Website)
m.Twitter = types.StringValue(org.Twitter)
m.Logo = types.StringValue(org.Logo)
m.Logo = types.StringValue("")
m.Created = types.StringValue(org.Created)
m.Updated = types.StringValue(org.Updated)

Expand Down Expand Up @@ -66,7 +66,7 @@ func (m *DataSourceModel) parse(ctx context.Context, org *packngo.Organization)
m.Description = types.StringValue(org.Description)
m.Website = types.StringValue(org.Website)
m.Twitter = types.StringValue(org.Twitter)
m.Logo = types.StringValue(org.Logo)
m.Logo = types.StringValue("")
m.Address = parseAddress(ctx, org.Address)

projects := make([]string, len(org.Projects))
Expand Down
9 changes: 5 additions & 4 deletions internal/resources/metal/organization/resource_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ func GetResourceSchema(ctx context.Context) schema.Schema {
Default: stringdefault.StaticString(""),
},
"logo": schema.StringAttribute{
Description: "Logo URL",
Optional: true,
Computed: true,
Default: stringdefault.StaticString(""),
DeprecationMessage: "The default (empty string) is the only valid value. Support for this field has been removed from the API",
Description: "**Deprecated** Logo URL",
Optional: true,
Computed: true,
Default: stringdefault.StaticString(""),
},
"created": schema.StringAttribute{
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion templates/data-sources/metal_organization.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In addition to all arguments above, the following attributes are exported:
* `description` - Description string.
* `website` - Website link.
* `twitter` - Twitter handle.
* `logo` - Logo URL.
* `logo` - (Deprecated) Logo URL.
* `address` - Address information
* `address` - Postal address.
* `city` - City name.
Expand Down
2 changes: 1 addition & 1 deletion templates/resources/metal_organization.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following arguments are supported:
* `description` - (Optional) Description string.
* `website` - (Optional) Website link.
* `twitter` - (Optional) Twitter handle.
* `logo` - (Optional) Logo URL.
* `logo` - (Deprecated) Logo URL.

### Address

Expand Down

0 comments on commit 58a8f6f

Please sign in to comment.