Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dedicated server (and (me_)_installation_template ) #639

Merged
merged 11 commits into from
May 3, 2024
Next Next commit
remove default_language from data and resource (type too)
  • Loading branch information
bigbigbang committed Apr 29, 2024
commit bdbeb1dee4d3a4379c5f1aa79e1ee12af925e18e
5 changes: 0 additions & 5 deletions ovh/data_me_installation_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
},

// computed
"default_language": {
Type: schema.TypeString,
Computed: true,
Deprecated: "This field will be removed from the API, please use `userMetadata` instead.",
},
"customization": {
Type: schema.TypeList,
Computed: true,
Expand Down
14 changes: 0 additions & 14 deletions ovh/resource_me_installation_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ func resourceMeInstallationTemplate() *schema.Resource {
ForceNew: true,
Description: "OVH template name yours will be based on, choose one among the list given by compatibleTemplates function",
},
"default_language": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Default: "en",
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
err := helpers.ValidateLanguageCode(v.(string))
if err != nil {
errors = append(errors, err)
}
return
},
Deprecated: "This field is deprecated and will be removed in a future release.",
},
"template_name": {
Type: schema.TypeString,
Required: true,
Expand Down
6 changes: 0 additions & 6 deletions ovh/types_installation_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ func (v InstallationTemplate) ToMap() map[string]interface{} {
}
}

if v.DefaultLanguage != "" {
obj["default_language"] = v.DefaultLanguage
}

obj["description"] = v.Description
obj["distribution"] = v.Distribution
obj["family"] = v.Family
Expand Down Expand Up @@ -69,7 +65,6 @@ type InstallationTemplateCreateOpts struct {
func (opts *InstallationTemplateCreateOpts) FromResource(d *schema.ResourceData) *InstallationTemplateCreateOpts {
opts.BaseTemplateName = d.Get("base_template_name").(string)
opts.Name = d.Get("template_name").(string)
opts.DefaultLanguage = d.Get("default_language").(string)
return opts
}

Expand All @@ -81,7 +76,6 @@ type InstallationTemplateUpdateOpts struct {

func (opts *InstallationTemplateUpdateOpts) FromResource(d *schema.ResourceData) *InstallationTemplateUpdateOpts {
opts.TemplateName = d.Get("template_name").(string)
opts.DefaultLanguage = d.Get("default_language").(string)
customizations := d.Get("customization").([]interface{})
if customizations != nil && len(customizations) == 1 {
opts.Customization = (&InstallationTemplateCustomization{}).FromResource(d, "customization.0")
Expand Down