Skip to content

Commit

Permalink
PLT-690: Fixed add-on deployment for cluster day2 operations (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
SivaanandM authored Sep 18, 2023
1 parent 3522634 commit 764987e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions spectrocloud/cluster_common_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@ func toProfiles(c *client.V1Client, d *schema.ResourceData, clusterContext strin
}

func toAddonDeplProfiles(c *client.V1Client, d *schema.ResourceData) ([]*models.V1SpectroClusterProfileEntity, error) {
clusterUid := d.Get("cluster_uid").(string)
clusterContext := d.Get("cluster_context").(string)
clusterUid := ""
clusterContext := ""
// handling cluster attachment flow for cluster created outside terraform and attaching addon profile to it
if uid, ok := d.GetOk("cluster_uid"); ok && uid != nil {
clusterUid = uid.(string) //d.Get("cluster_uid").(string)
}
if ct, ok := d.GetOk("cluster_context"); ok && c != nil {
clusterContext = ct.(string) //d.Get("cluster_context").(string)
}
// handling cluster day 2 addon profile operation flow
if clusterUid == "" {
clusterUid = d.Id()
}
if clusterContext == "" {
clusterContext = d.Get("context").(string)
}

return toProfilesCommon(c, d, clusterUid, clusterContext)
}

Expand Down

0 comments on commit 764987e

Please sign in to comment.