Skip to content

Commit

Permalink
Fix cannot upgrade gsk 1.29 to gsk 1.30 due to version validation (#405)
Browse files Browse the repository at this point in the history
* remove gsk multi-node-pool feature validation when reading k8s resource

* remove gsk multi-node-pool feature validation when updating k8s resource
  • Loading branch information
nvthongswansea authored Jan 2, 2025
1 parent f0f1b9e commit 7209505
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions gridscale/resource_gridscale_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ func deriveK8sTemplateFromRelease(client *gsclient.Client, release string) (*gsc

func resourceGridscaleK8sRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*gsclient.Client)
validator := &ResourceGridscaleK8sValidator{}
errorPrefix := fmt.Sprintf("read k8s (%s) resource -", d.Id())
paas, err := client.GetPaaSService(context.Background(), d.Id())

Expand All @@ -566,17 +565,6 @@ func resourceGridscaleK8sRead(d *schema.ResourceData, meta interface{}) error {
}
return fmt.Errorf("%s error: %v", errorPrefix, err)
}
template, err := deriveK8sTemplateFromUUID(client, paas.Properties.ServiceTemplateUUID)

if err != nil {
return fmt.Errorf("%s error: %v", errorPrefix, err)
}
err = validator.checkIfTemplateSupportsMultiNodePools(*template)

if err != nil {
return fmt.Errorf("%s error: %v", errorPrefix, err)
}

props := paas.Properties
creds := props.Credentials
if err = d.Set("name", props.Name); err != nil {
Expand Down Expand Up @@ -1044,7 +1032,6 @@ func resourceGridscaleK8sCreate(d *schema.ResourceData, meta interface{}) error

func resourceGridscaleK8sUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*gsclient.Client)
validator := &ResourceGridscaleK8sValidator{}
errorPrefix := fmt.Sprintf("update k8s (%s) resource -", d.Id())

labels := convSOStrings(d.Get("labels").(*schema.Set).List())
Expand All @@ -1054,15 +1041,10 @@ func resourceGridscaleK8sUpdate(d *schema.ResourceData, meta interface{}) error
}
currentTemplateUUID := d.Get("service_template_uuid")
templateRequested, err := deriveK8sTemplateFromResourceData(client, d)

if err != nil {
return fmt.Errorf("%s error: %v", errorPrefix, err)
}
err = validator.checkIfTemplateSupportsMultiNodePools(*templateRequested)

if err != nil {
return fmt.Errorf("%s error: %v", errorPrefix, err)
}
if templateRequested.Properties.ObjectUUID != currentTemplateUUID.(string) {
requestBody.PaaSServiceTemplateUUID = templateRequested.Properties.ObjectUUID
}
Expand Down

0 comments on commit 7209505

Please sign in to comment.